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

Method WithRankAtLeast

tensorflow/core/framework/shape_inference.cc:393–406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391}
392
393Status InferenceContext::WithRankAtLeast(ShapeHandle shape, int64 rank,
394 ShapeHandle* out) {
395 if (rank > kint32max) {
396 return errors::InvalidArgument("Rank cannot exceed kint32max");
397 }
398 const int32 existing = Rank(shape);
399 if (existing >= rank || existing == kUnknownRank) {
400 *out = shape;
401 return Status::OK();
402 }
403 *out = nullptr;
404 return errors::InvalidArgument("Shape must be at least rank ", rank,
405 " but is rank ", existing);
406}
407
408Status InferenceContext::WithRankAtMost(ShapeHandle shape, int64 rank,
409 ShapeHandle* out) {

Calls 2

InvalidArgumentFunction · 0.85
RankFunction · 0.50

Tested by 2

RFFTShapeFunction · 0.64
TEST_FFunction · 0.64