MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / AddVector

Method AddVector

tensorflow/core/framework/dataset.h:115–126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113 // TODO(shivaniagrawal): Consider changing to gtl::ArraySlice?
114 template <typename T>
115 Status AddVector(const std::vector<T>& val, Node** output) {
116 Tensor val_t = Tensor(DataTypeToEnum<T>::v(),
117 TensorShape({static_cast<int64>(val.size())}));
118 for (size_t i = 0; i < val.size(); i++) {
119 val_t.flat<T>()(i) = val[i];
120 }
121 AddTensorInternal(val_t, output);
122 if (*output == nullptr) {
123 return errors::Internal("AddVector: Failed to build Const op.");
124 }
125 return Status::OK();
126 }
127
128#ifdef USE_TSTRING
129 // TODO(dero): Temp guard to prevent duplicate declaration during tstring

Callers 12

AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80
AsGraphDefInternalMethod · 0.80

Calls 4

InternalFunction · 0.85
TensorClass · 0.70
TensorShapeClass · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected