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

Function UpdateSlice

tensorflow/compiler/xla/client/lib/slicing.cc:58–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58XlaOp UpdateSlice(XlaOp x, XlaOp update, absl::Span<const int64> start) {
59 XlaBuilder* builder = x.builder();
60 return builder->ReportErrorOrReturn([&]() -> StatusOr<XlaOp> {
61 TF_ASSIGN_OR_RETURN(Shape shape, builder->GetShape(x));
62 const int64 n_dims = shape.rank();
63 TF_RET_CHECK(start.size() == n_dims);
64
65 // TODO(phawkins): make int64 work on all backends, remove the int32 cast.
66 std::vector<int32> start_as_int32(start.begin(), start.end());
67 std::vector<XlaOp> start_ops(start.size());
68 for (int i = 0; i < start.size(); ++i) {
69 start_ops[i] = ConstantR0(builder, start_as_int32[i]);
70 }
71 return DynamicUpdateSlice(x, update, start_ops);
72 });
73}
74
75XlaOp UpdateSliceInMinorDims(XlaOp x, XlaOp update,
76 absl::Span<const int64> start) {

Callers 1

UpdateSliceInMinorDimsFunction · 0.85

Calls 8

ConstantR0Function · 0.85
DynamicUpdateSliceFunction · 0.85
ReportErrorOrReturnMethod · 0.80
builderMethod · 0.45
rankMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected