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

Method ElementsInRecursive

tensorflow/compiler/xla/shape_util.cc:436–446  ·  view source on GitHub ↗

static */

Source from the content-addressed store, hash-verified

434}
435
436/* static */ int64 ShapeUtil::ElementsInRecursive(const Shape& shape) {
437 CHECK(shape.IsArray() || shape.IsTuple());
438 if (shape.IsArray()) {
439 return ElementsIn(shape);
440 }
441 int64 count = 0;
442 for (const Shape& element_shape : shape.tuple_shapes()) {
443 count += ElementsInRecursive(element_shape);
444 }
445 return count;
446}
447
448/* static */ bool ShapeUtil::HasPrimitiveType(const Shape& shape,
449 PrimitiveType primitive_type) {

Callers

nothing calls this directly

Calls 3

IsArrayMethod · 0.45
IsTupleMethod · 0.45
tuple_shapesMethod · 0.45

Tested by

no test coverage detected