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

Method ConstantInputAsShape

tensorflow/compiler/tf2xla/xla_op_kernel.cc:339–346  ·  view source on GitHub ↗

TODO(phawkins): validate that the dimensions form a valid shape, fail gracefully if they do not.

Source from the content-addressed store, hash-verified

337// TODO(phawkins): validate that the dimensions form a valid shape, fail
338// gracefully if they do not.
339Status XlaOpKernelContext::ConstantInputAsShape(int index, TensorShape* shape) {
340 xla::Literal literal;
341 TF_RETURN_IF_ERROR(ConstantInput(index, &literal));
342 std::vector<int64> dims;
343 TF_RETURN_IF_ERROR(LiteralToInt64Vector(literal, &dims));
344 *shape = TensorShape(dims);
345 return Status::OK();
346}
347
348Status XlaOpKernelContext::ConstantInputAsPartialShape(
349 int index, PartialTensorShape* shape) {

Callers 15

CompileImplFunction · 0.80
CompileMethod · 0.80
CompileMethod · 0.80
CompileMethod · 0.80
CompileMethod · 0.80
CompileMethod · 0.80
CompileMethod · 0.80
CompileMethod · 0.80
CompileMethod · 0.80
CompileMethod · 0.80
CompileMethod · 0.80
CompileMethod · 0.80

Calls 2

LiteralToInt64VectorFunction · 0.85
TensorShapeClass · 0.50

Tested by

no test coverage detected