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

Function EmptyConst

tensorflow/core/graph/graph_partition.cc:657–668  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

655}
656
657Node* EmptyConst(const GraphDefBuilder::Options& options) {
658 if (options.HaveError()) return nullptr;
659 NodeBuilder node_builder(options.GetNameForOp("Const"), "Const",
660 options.op_registry());
661 const DataType dt = DataTypeToEnum<float>::v();
662 TensorProto proto;
663 proto.set_dtype(dt);
664 TensorShape empty_shape({0});
665 empty_shape.AsProto(proto.mutable_tensor_shape());
666 node_builder.Attr("dtype", dt).Attr("value", proto);
667 return options.FinalizeBuilder(&node_builder);
668}
669
670// A dummy const node for control flow.
671Node* AddControlConst(const string& device_name,

Callers 1

AddControlConstFunction · 0.85

Calls 7

HaveErrorMethod · 0.80
FinalizeBuilderMethod · 0.80
GetNameForOpMethod · 0.45
op_registryMethod · 0.45
set_dtypeMethod · 0.45
AsProtoMethod · 0.45
AttrMethod · 0.45

Tested by

no test coverage detected