MCPcopy Create free account
hub / github.com/NVIDIA/DALI / CalcPadCopyExtents

Function CalcPadCopyExtents

dali/kernels/slice/slice_kernel_utils.h:101–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99}
100
101inline std::tuple<int64_t, int64_t, int64_t> CalcPadCopyExtents(int64_t anchor,
102 int64_t in_extent,
103 int64_t out_extent) {
104 int64_t pad_before = std::min(out_extent, std::max<int64_t>(0, -anchor));
105 int64_t to_copy = std::max<int64_t>(
106 0, std::min(in_extent - std::max<int64_t>(0, anchor), out_extent - pad_before));
107 int64_t pad_after = out_extent - pad_before - to_copy;
108 return std::tuple<int64_t, int64_t, int64_t>{pad_before, to_copy, pad_after};
109}
110
111
112template <typename OutputType, typename InputType, int Dims>

Calls 1

minClass · 0.50

Tested by

no test coverage detected