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

Function GetAreaPixel

oneflow/user/kernels/upsample_kernel.h:49–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47}
48
49OF_DEVICE_FUNC double GetAreaPixel(const double scale, const int64_t dst_index, bool align_corners,
50 bool cubic = false) {
51 if (align_corners) {
52 return scale * dst_index;
53 } else {
54 double src_idx = scale * (dst_index + 0.5) - 0.5;
55 return (!cubic && src_idx < 0) ? static_cast<double>(0) : src_idx;
56 }
57}
58
59template<typename T>
60struct BilinearParam {

Callers 4

ComputeMethod · 0.85
ComputeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected