mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Updated TH to ATen porting guide (markdown)
@ -154,12 +154,12 @@ General guidance: maybe someone has ported something similar before! You can use
|
||||
|
||||
## Caveats for `native_functions.yaml`
|
||||
|
||||
* The argument order in [native_functions.yaml](https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/native/native_functions.yaml) does not match the order in [NativeFunctions.h](https://github.com/pytorch/pytorch/blob/master/torch/include/ATen/NativeFunctions.h). Example:
|
||||
* The argument order in [native_functions.yaml](https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/native/native_functions.yaml) does not match the order in the generated file `torch/include/ATen/NativeFunctions.h`. Example:
|
||||
|
||||
1) Signature:
|
||||
a) Signature:
|
||||
`adaptive_max_pool2d(Tensor self, int[2] output_size, *, Tensor(a!) out, Tensor(b!) indices) -> (Tensor(a!), Tensor(b!))`
|
||||
|
||||
2) Function prototype:
|
||||
b) Function prototype:
|
||||
`std::tuple<Tensor &,Tensor &> adaptive_max_pool2d_out_cpu(Tensor & out, Tensor & indices, const Tensor & self, IntArrayRef output_size);`
|
||||
|
||||
* Argument names matter, the convention is to use `out` for output arguments. See: https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/native/README.md)
|
Reference in New Issue
Block a user