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

Function scalar_const_node

tensorflow/core/graph/graph_constructor.cc:1563–1575  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1561
1562namespace {
1563Node* scalar_const_node(Graph* g, int64 val, const string& name,
1564 const string& device_name) {
1565 Node* ret;
1566 Tensor t(DT_INT32, TensorShape({}));
1567 t.scalar<int32>()() = val;
1568 TF_CHECK_OK(NodeBuilder(g->NewName(name), "Const")
1569 .Device(device_name)
1570 .Attr("dtype", DT_INT32)
1571 .Attr("value", t)
1572 .Finalize(g, &ret));
1573 ret->set_assigned_device_name(device_name);
1574 return ret;
1575}
1576
1577Node* tensor_const_node(Graph* g, Tensor& t, const string& name,
1578 const string& device_name) {

Callers 1

AggregateForSparseApplyFunction · 0.85

Calls 7

NodeBuilderClass · 0.70
TensorShapeClass · 0.50
FinalizeMethod · 0.45
AttrMethod · 0.45
DeviceMethod · 0.45
NewNameMethod · 0.45

Tested by

no test coverage detected