Viewing File: /home/ubuntu/combine_ai/combine/lib/python3.10/site-packages/torch/include/ATen/div_rtn.h

#pragma once

// Integer division rounding to -Infinity
template <typename T>
static inline T div_rtn(T x, T y) {
  int q = x / y;
  int r = x % y;
  if ((r != 0) && ((r < 0) != (y < 0)))
    --q;
  return q;
}
Back to Directory File Manager