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

Method ReplaceDim

tensorflow/core/framework/shape_inference.cc:713–731  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

711}
712
713Status InferenceContext::ReplaceDim(ShapeHandle s, int64 dim_index_in,
714 DimensionHandle new_dim, ShapeHandle* out) {
715 if (!RankKnown(s)) {
716 return ReturnUnknownShape(out);
717 }
718 int64 dim_index = dim_index_in;
719 if (dim_index < 0) {
720 dim_index = s->dims_.size() + dim_index;
721 }
722 if (!FastBoundsCheck(dim_index, s->dims_.size())) {
723 *out = nullptr;
724 return errors::InvalidArgument("Out of range dim_index ", dim_index_in,
725 " for shape with ", s->dims_.size(),
726 " dimensions");
727 }
728 std::vector<DimensionHandle> dims(s->dims_);
729 dims[dim_index] = new_dim;
730 return ReturnCreatedShape(dims, out);
731}
732
733ShapeHandle InferenceContext::MakeShape(
734 const std::vector<DimensionHandle>& dims) {

Callers 15

mpi_ops.ccFile · 0.80
mpi_ops.ccFile · 0.80
ReduceSliceShapeFnFunction · 0.80
RFFTShapeFunction · 0.80
ctc_ops.ccFile · 0.80
nn_ops.ccFile · 0.80
batch_ops.ccFile · 0.80
SetOutputShapeForReshapeFunction · 0.80
array_ops.ccFile · 0.80

Calls 3

FastBoundsCheckFunction · 0.85
InvalidArgumentFunction · 0.85
sizeMethod · 0.45

Tested by 2

RFFTShapeFunction · 0.64
TEST_FFunction · 0.64