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

Method VirtualKernelInit

oneflow/core/kernel/slice_boxing_kernel.cpp:64–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62};
63
64void SliceBoxingKernel::VirtualKernelInit(KernelContext* ctx) {
65 const SliceBoxingConf& conf = GetCustomizedBoxingConf();
66 if (/*is_0size_tensor=*/std::any_of(conf.out_shape().dim().begin(), conf.out_shape().dim().end(),
67 [](int64_t dim) { return dim == 0; })) {
68 return;
69 }
70 const TensorSliceView out_slice(conf.out_slice());
71 for (const TensorSliceViewProto& in_slice_proto : conf.in_slice()) {
72 const TensorSliceView in_slice(in_slice_proto);
73 tensor_slice_copier_vec_.emplace_back(new TensorSliceCopier(
74 out_slice, in_slice, this->kernel_conf().data_type(), ctx->stream()->device_type()));
75 }
76}
77
78const std::vector<std::shared_ptr<TensorSliceCopier>>& SliceBoxingKernel::tensor_slice_copier_vec()
79 const {

Callers

nothing calls this directly

Calls 7

dimMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
emplace_backMethod · 0.45
data_typeMethod · 0.45
device_typeMethod · 0.45
streamMethod · 0.45

Tested by

no test coverage detected