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

Method AddScalar

tensorflow/core/framework/dataset.h:99–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97 // The returned Node pointer is owned by the backing Graph of GraphDefBuilder.
98 template <typename T>
99 Status AddScalar(const T& val, Node** output) {
100 Tensor val_t = Tensor(DataTypeToEnum<T>::v(), TensorShape({}));
101 val_t.scalar<T>()() = val;
102 AddTensorInternal(val_t, output);
103 if (*output == nullptr) {
104 return errors::Internal("AddScalar: Failed to build Const op.");
105 }
106 return Status::OK();
107 }
108
109 // Adds a Const node with vector value to the Graph.
110 // `*output` contains a pointer to the output `Node`. It is guaranteed to be

Callers 2

AsGraphDefInternalMethod · 0.45
AsGraphDefInternalMethod · 0.45

Calls 3

InternalFunction · 0.85
TensorClass · 0.70
TensorShapeClass · 0.70

Tested by

no test coverage detected