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

Method MakeShapeFromShapeTensor

tensorflow/core/framework/shape_inference.cc:795–811  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

793}
794
795Status InferenceContext::MakeShapeFromShapeTensor(int input_idx,
796 ShapeHandle* out) {
797 ShapeHandle input_shape;
798 TF_RETURN_IF_ERROR(WithRank(input(input_idx), 1, &input_shape));
799
800 requested_input_tensor_as_partial_shape_[input_idx] = true;
801 if (input_idx < input_tensors_as_shapes_.size() &&
802 input_tensors_as_shapes_[input_idx].IsSet() &&
803 RankKnown(input_tensors_as_shapes_[input_idx])) {
804 *out = input_tensors_as_shapes_[input_idx];
805 return Status::OK();
806 }
807
808 return InternalMakeShapeFromTensor(
809 false /* treat_unknown_scalar_tensor_as_unknown_shape */,
810 input_tensor(input_idx), input_shape, out);
811}
812
813Status InferenceContext::MakeShapeFromTensor(const Tensor* t,
814 ShapeHandle tensor_shape,

Callers 15

StatefulRandomShapeFunction · 0.80
mkl_nn_ops.ccFile · 0.80
nn_ops.ccFile · 0.80
sparse_ops.ccFile · 0.80
SetOutputShapeForReshapeFunction · 0.80
array_ops.ccFile · 0.80
ScatterNdShapeFunction · 0.80
random_ops.ccFile · 0.80
StatelessShapeFunction · 0.80
image_ops.ccFile · 0.80
nccl_ops.ccFile · 0.80

Calls 2

sizeMethod · 0.45
IsSetMethod · 0.45

Tested by 2

TEST_FFunction · 0.64
TensorAsShapeShapeFnFunction · 0.64