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

Function SetConstSizesOp

tensorflow/core/kernels/nn_ops_test.cc:81–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81static void SetConstSizesOp(const string& name, const std::vector<int32>& sizes,
82 NodeDef* node) {
83 TensorShape shape;
84 shape.AddDim(sizes.size());
85 Tensor tensor(DT_INT32, shape);
86 for (int64 i = 0; i < tensor.NumElements(); ++i) {
87 tensor.flat<int32>()(i) = sizes[i];
88 }
89 TF_CHECK_OK(NodeDefBuilder(name, "Const")
90 .Attr("dtype", DT_INT32)
91 .Attr("value", tensor)
92 .Finalize(node));
93}
94
95namespace {
96

Callers 2

BM_ConvFloatFunction · 0.85
BM_ConvFloatDepthwiseFunction · 0.85

Calls 6

NodeDefBuilderClass · 0.85
AddDimMethod · 0.45
sizeMethod · 0.45
NumElementsMethod · 0.45
FinalizeMethod · 0.45
AttrMethod · 0.45

Tested by

no test coverage detected