Reduction dtype notes - gchanan/pytorch GitHub Wiki
Same Input and Output Dtype
Integer Upcast
Function |
NumPy Equivalent |
NumPy Int |
NumPy UInt |
NumPy Float |
PyTorch Int |
PyTorch UInt |
PyTorch Float |
prod |
numpy.prod |
int64 |
uint64 |
same |
same |
same |
|
sum |
numpy.sum |
int64 |
uint64 |
same |
same |
same |
|
cumprod |
numpy.cumprod |
int64 |
uint64 |
same |
same |
same |
|
cumsum |
numpy.cumsum |
int64 |
uint64 |
same |
same |
same |
|
Integer Upcast to Float
Function |
NumPy Equivalent |
NumPy Int |
NumPy UInt |
NumPy Float |
PyTorch Int |
PyTorch UInt |
PyTorch Float |
mean |
numpy.mean |
float64 |
float64 |
same |
N/I |
N/I |
|
median |
numpy.median |
float64 |
float64 |
same |
same |
same |
|
norm |
numpy.linalg.norm |
float64 |
float64 |
same |
N/I |
N/I |
|
std |
num.std |
float64 |
float64 |
same |
N/I |
N/I |
|
var |
numpy.var |
float64 |
float64 |
same |
N/I |
N/I |
|
renorm |
None |
N/A |
N/A |
N/A |
N/I |
N/I |
|
- N/I: Not Implemented
- N/A: Not Applicable
- Same: Same input and output type