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

Method WithRankAtMost

tensorflow/core/framework/shape_inference.cc:408–421  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

406}
407
408Status InferenceContext::WithRankAtMost(ShapeHandle shape, int64 rank,
409 ShapeHandle* out) {
410 if (rank > kint32max) {
411 return errors::InvalidArgument("Rank cannot exceed kint32max");
412 }
413 const int32 existing = Rank(shape);
414 if (existing <= rank || existing == kUnknownRank) {
415 *out = shape;
416 return Status::OK();
417 }
418 *out = nullptr;
419 return errors::InvalidArgument("Shape must be at most rank ", rank,
420 " but is rank ", existing);
421}
422
423Status InferenceContext::WithValue(DimensionHandle dim, int64 value,
424 DimensionHandle* out) {

Callers 15

ReduceSliceShapeFnFunction · 0.80
xrt_execute_op.ccFile · 0.80
mkl_nn_ops.ccFile · 0.80
lookup_ops.ccFile · 0.80
MutableHashTableShapeFunction · 0.80
io_ops.ccFile · 0.80
nn_ops.ccFile · 0.80
array_ops.ccFile · 0.80
random_ops.ccFile · 0.80
RpcShapeOpFunction · 0.80
RaggedRangeShapeFnFunction · 0.80

Calls 2

InvalidArgumentFunction · 0.85
RankFunction · 0.50

Tested by 1

TEST_FFunction · 0.64