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

Method IsValid

tensorflow/core/framework/tensor_shape_test.cc:354–362  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352static const int64 kMaxElements = (1LL << 40);
353
354bool TensorShapeOld::IsValid(const TensorShapeProto& proto) {
355 int64 num_elements = 1;
356 for (const auto& d : proto.dim()) {
357 if (d.size() < 0) return false;
358 num_elements *= d.size();
359 if (num_elements > kMaxElements) return false;
360 }
361 return true;
362}
363
364Status TensorShapeOld::IsValidShape(const TensorShapeProto& proto) {
365 int64 num_elements = 1;

Callers

nothing calls this directly

Calls 2

dimMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected