MCPcopy Create free account
hub / github.com/apache/arrow / GetTensorFlowType

Function GetTensorFlowType

cpp/src/arrow/adapters/tensorflow/convert.h:80–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80Status GetTensorFlowType(std::shared_ptr<DataType> dtype, ::tensorflow::DataType* out) {
81 switch (dtype->id()) {
82 case Type::BOOL:
83 *out = ::tensorflow::DT_BOOL;
84 break;
85 case Type::UINT8:
86 *out = ::tensorflow::DT_UINT8;
87 break;
88 case Type::INT8:
89 *out = ::tensorflow::DT_INT8;
90 break;
91 case Type::UINT16:
92 *out = ::tensorflow::DT_UINT16;
93 break;
94 case Type::INT16:
95 *out = ::tensorflow::DT_INT16;
96 break;
97 case Type::UINT32:
98 *out = ::tensorflow::DT_UINT32;
99 break;
100 case Type::INT32:
101 *out = ::tensorflow::DT_INT32;
102 break;
103 case Type::UINT64:
104 *out = ::tensorflow::DT_UINT64;
105 break;
106 case Type::INT64:
107 *out = ::tensorflow::DT_INT64;
108 break;
109 case Type::HALF_FLOAT:
110 *out = ::tensorflow::DT_HALF;
111 break;
112 case Type::FLOAT:
113 *out = ::tensorflow::DT_FLOAT;
114 break;
115 case Type::DOUBLE:
116 *out = ::tensorflow::DT_DOUBLE;
117 break;
118 default:
119 return Status::TypeError("Arrow data type is not supported");
120 }
121 return arrow::Status::OK();
122}
123
124} // namespace tensorflow
125

Callers

nothing calls this directly

Calls 3

TypeErrorFunction · 0.50
OKFunction · 0.50
idMethod · 0.45

Tested by

no test coverage detected