Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Fix the implicitly constructions of ArraySlice from initializer lists #447

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
24 changes: 15 additions & 9 deletions src/ngraph_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,43 +176,49 @@ void print_node_histogram(const std::unordered_map<string, int>& histogram,
}

const gtl::ArraySlice<DataType>& NGraphDTypes() {
static gtl::ArraySlice<DataType> result{
static std::vector<DataType> vector{
DT_FLOAT, DT_DOUBLE, DT_INT8, DT_INT16, DT_INT32, DT_INT64, DT_UINT8,
DT_UINT16, DT_UINT32, DT_UINT64, DT_BOOL, DT_QINT8, DT_QUINT8};
static gtl::ArraySlice<DataType> result{vector};
return result;
}

const gtl::ArraySlice<DataType>& NGraphNumericDTypes() {
static gtl::ArraySlice<DataType> result{
DT_FLOAT, DT_DOUBLE, DT_INT8, DT_INT16, DT_INT32,
DT_INT64, DT_UINT8, DT_UINT16, DT_UINT32, DT_UINT64};
static std::vector<DataType> vector{DT_FLOAT, DT_DOUBLE, DT_INT8, DT_INT16,
DT_INT32, DT_INT64, DT_UINT8, DT_UINT16, DT_UINT32, DT_UINT64};
static gtl::ArraySlice<DataType> result{vector};
return result;
}

const gtl::ArraySlice<DataType>& NGraphNumericAndQuantizedDTypes() {
static gtl::ArraySlice<DataType> result{
static std::vector<DataType> vector{
DT_FLOAT, DT_DOUBLE, DT_INT8, DT_INT16, DT_INT32, DT_INT64,
DT_UINT8, DT_UINT16, DT_UINT32, DT_UINT64, DT_QINT8, DT_QUINT8};
static gtl::ArraySlice<DataType> result{vector};
return result;
}

const gtl::ArraySlice<DataType>& NGraphIndexDTypes() {
static gtl::ArraySlice<DataType> result{DT_INT32, DT_INT64};
static std::vector<DataType> vector{DT_INT32, DT_INT64};
static gtl::ArraySlice<DataType> result{vector};
return result;
}

const gtl::ArraySlice<DataType>& NGraphSupportedQuantizedDTypes() {
static gtl::ArraySlice<DataType> result{DT_QINT8, DT_QUINT8};
static std::vector<DataType> vector{DT_QINT8, DT_QUINT8};
static gtl::ArraySlice<DataType> result{vector};
return result;
}

const gtl::ArraySlice<DataType>& NGraphRealDTypes() {
static gtl::ArraySlice<DataType> result{DT_FLOAT, DT_DOUBLE};
static std::vector<DataType> vector{DT_FLOAT, DT_DOUBLE};
static gtl::ArraySlice<DataType> result{vector};
return result;
}

const gtl::ArraySlice<DataType>& NGraphBiasDTypes() {
static gtl::ArraySlice<DataType> result{DT_FLOAT, DT_QINT32};
static std::vector<DataType> vector{DT_FLOAT, DT_QINT32};
static gtl::ArraySlice<DataType> result{vector};
return result;
}

Expand Down