MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / TensorSliceCopier

Method TensorSliceCopier

oneflow/core/register/tensor_slice_copier.cpp:38–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36} // namespace
37
38TensorSliceCopier::TensorSliceCopier(const TensorSliceView& dst_view,
39 const TensorSliceView& src_view,
40 const TensorSliceView& copy_view, const DataType data_type,
41 const DeviceType device_type)
42 : dst_view_(dst_view), src_view_(src_view), extent_(copy_view.shape()), data_type_(data_type) {
43 copy_nd_primitive_ = ep::primitive::NewPrimitive<ep::primitive::CopyNdFactory>(
44 device_type, dst_view_.shape().NumAxes());
45 CHECK(dst_view.Contains(copy_view));
46 CHECK(src_view.Contains(copy_view));
47 dst_pos_ = copy_view.OffsetTo(dst_view);
48 src_pos_ = copy_view.OffsetTo(src_view);
49}
50
51TensorSliceCopier::TensorSliceCopier(const TensorSliceView& dst_view,
52 const TensorSliceView& src_view, const DataType data_type,

Callers

nothing calls this directly

Calls 5

OffsetToMethod · 0.80
IntersectMethod · 0.80
shapeMethod · 0.45
NumAxesMethod · 0.45
ContainsMethod · 0.45

Tested by

no test coverage detected