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

Function GetStackShape

tensorflow/compiler/tf2xla/kernels/stack_ops.cc:40–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38namespace {
39
40Status GetStackShape(xla::XlaBuilder* builder, XlaResource* resource,
41 TensorShape* stack_shape) {
42 auto shape_or_status = builder->GetShape(resource->value());
43 if (!shape_or_status.ok()) {
44 return shape_or_status.status();
45 }
46 xla::Shape shape = shape_or_status.ValueOrDie();
47 TF_RET_CHECK(shape.IsTuple());
48 return XLAShapeToTensorShape(xla::ShapeUtil::GetTupleElementShape(shape, 0),
49 stack_shape);
50}
51
52// Since the element shape is not provided to the Stack operator,
53// we lazily initialize the Stack at the time of the first write.

Callers 2

MaybeInitializeStackFunction · 0.85
CompileMethod · 0.85

Calls 6

XLAShapeToTensorShapeFunction · 0.85
GetShapeMethod · 0.45
valueMethod · 0.45
okMethod · 0.45
statusMethod · 0.45
IsTupleMethod · 0.45

Tested by

no test coverage detected