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

Function AddValueBounded

oneflow/user/kernels/grid_sample_kernel_util.h:322–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

320
321template<typename scalar_t, typename index_t>
322static OF_DEVICE_FUNC void AddValueBounded(scalar_t* data, scalar_t x, scalar_t y, int W, int H,
323 int sW, int sH, scalar_t delta,
324 GridSamplerPadding padding_mode, bool align_corners,
325 const index_t NC_offset, const index_t memory_span) {
326 x = ComputeCoordinates(x, W, padding_mode, align_corners);
327 y = ComputeCoordinates(y, H, padding_mode, align_corners);
328
329 int ix = static_cast<int>(x);
330 int iy = static_cast<int>(y);
331
332 SafeAdd2D(data, iy, ix, sH, sW, H, W, delta, NC_offset, memory_span);
333}
334
335// Calculate the differential of the cubic convolution, i.e. `d coeff / d x`
336template<typename scalar_t>

Callers

nothing calls this directly

Calls 2

ComputeCoordinatesFunction · 0.85
SafeAdd2DFunction · 0.85

Tested by

no test coverage detected