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

Method GetShape

tensorflow/compiler/tf2xla/xla_expression.cc:142–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142xla::StatusOr<TensorShape> XlaExpression::GetShape() const {
143 switch (kind_) {
144 case Kind::kConstant:
145 return constant_value().shape();
146 case Kind::kXlaOp: {
147 TF_ASSIGN_OR_RETURN(xla::Shape xla_shape,
148 handle().builder()->GetShape(handle()));
149 TensorShape shape;
150 TF_RETURN_IF_ERROR(XLAShapeToTensorShape(xla_shape, &shape));
151 return shape;
152 }
153 case Kind::kTensorList:
154 return TensorShape({});
155 case Kind::kResource:
156 return TensorShape({});
157 case Kind::kInvalid:
158 return errors::InvalidArgument(
159 "GetShape() called on invalid XlaExpression");
160 }
161}
162
163} // namespace tensorflow

Callers 15

TEST_FFunction · 0.45
BuildComputationFunction · 0.45
PrepareArgumentsFunction · 0.45
AssignVariableTensorFunction · 0.45
XlaScatterFunction · 0.45
CompileMethod · 0.45
GetStackShapeFunction · 0.45
CompileMethod · 0.45
CompileMethod · 0.45

Calls 5

XLAShapeToTensorShapeFunction · 0.85
InvalidArgumentFunction · 0.85
constant_valueFunction · 0.50
TensorShapeClass · 0.50
shapeMethod · 0.45

Tested by 1

TEST_FFunction · 0.36