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

Function ShapeHandleFromDims

tensorflow/c/c_api.cc:261–274  ·  view source on GitHub ↗

Helper method that creates a shape handle for a shape described by dims.

Source from the content-addressed store, hash-verified

259
260// Helper method that creates a shape handle for a shape described by dims.
261tensorflow::shape_inference::ShapeHandle ShapeHandleFromDims(
262 tensorflow::shape_inference::InferenceContext* ic, int num_dims,
263 const int64_t* dims) {
264 if (num_dims != -1) {
265 std::vector<tensorflow::shape_inference::DimensionHandle> dim_vec;
266 dim_vec.reserve(num_dims);
267 for (int i = 0; i < num_dims; ++i) {
268 dim_vec.push_back(ic->MakeDim(dims[i]));
269 }
270 return ic->MakeShape(dim_vec);
271 } else {
272 return ic->UnknownShape();
273 }
274}
275
276} // namespace
277

Callers 2

TF_GraphSetTensorShapeFunction · 0.85

Calls 5

UnknownShapeMethod · 0.80
reserveMethod · 0.45
push_backMethod · 0.45
MakeDimMethod · 0.45
MakeShapeMethod · 0.45

Tested by

no test coverage detected