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

Method CountSubshapes

tensorflow/compiler/xla/shape_tree.h:399–408  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

397
398template <typename T>
399int64 ShapeTree<T>::CountSubshapes(const Shape& shape) {
400 int64 current_count = 1;
401 if (shape.IsTuple()) {
402 int64 count = ShapeUtil::TupleElementCount(shape);
403 for (int i = 0; i < count; ++i) {
404 current_count += CountSubshapes(shape.tuple_shapes(i));
405 }
406 }
407 return current_count;
408}
409
410template <typename T>
411void ShapeTree<T>::InitChildren(const Shape& shape, const T& init_value,

Callers

nothing calls this directly

Calls 2

IsTupleMethod · 0.45
tuple_shapesMethod · 0.45

Tested by

no test coverage detected