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

Method replace_shape_ptr

tensorflow/compiler/xla/shape_tree.h:130–136  ·  view source on GitHub ↗

A ShapeTree object can own the underlying Shape pointer (via the shape_storage_ member), or can point to a Shape object owned by the caller. This API replaces the underlying Shape object to the one supplied by the caller, whom must ensure the object remain valid for the whole lifetime of this ShapeTree object, and also that the Shape is consistent with it.

Source from the content-addressed store, hash-verified

128 // caller, whom must ensure the object remain valid for the whole lifetime of
129 // this ShapeTree object, and also that the Shape is consistent with it.
130 void replace_shape_ptr(const Shape* shape) {
131 if (shape_storage_ != nullptr) {
132 DCHECK_EQ(*shape, *shape_storage_);
133 shape_storage_ = nullptr;
134 }
135 shape_ = shape;
136 }
137
138 // Returns true if the node at the given index is a leaf node (an array
139 // shape).

Callers 3

ShapedBufferMethod · 0.80
shaped_buffer.ccFile · 0.80
set_buffersMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected