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

Method SliceInDim

tensorflow/compiler/xla/client/xla_builder.cc:839–852  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

837}
838
839XlaOp XlaBuilder::SliceInDim(XlaOp operand, int64 start_index,
840 int64 limit_index, int64 stride, int64 dimno) {
841 return ReportErrorOrReturn([&]() -> StatusOr<XlaOp> {
842 TF_ASSIGN_OR_RETURN(const Shape* shape, GetShapePtr(operand));
843 std::vector<int64> starts(shape->rank(), 0);
844 std::vector<int64> limits(shape->dimensions().begin(),
845 shape->dimensions().end());
846 std::vector<int64> strides(shape->rank(), 1);
847 starts[dimno] = start_index;
848 limits[dimno] = limit_index;
849 strides[dimno] = stride;
850 return Slice(operand, starts, limits, strides);
851 });
852}
853
854XlaOp XlaBuilder::DynamicSlice(XlaOp operand, XlaOp start_indices,
855 absl::Span<const int64> slice_sizes) {

Callers 2

SliceInDimFunction · 0.80
testSliceInDimMethod · 0.80

Calls 5

SliceFunction · 0.70
rankMethod · 0.45
beginMethod · 0.45
dimensionsMethod · 0.45
endMethod · 0.45

Tested by 1

testSliceInDimMethod · 0.64