-
Notifications
You must be signed in to change notification settings - Fork 242
Closed
Description
Hello and thanks for this great repository!
Can you give me a hint on how to implement default arguments? I tried the following so far but it does not work:
at::Tensor torch_func(at::Tensor tensor1, at::Tensor tensor2={}) {
...
}
PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
m.def("torch_func", &torch_func, py::arg("tensor1"), py::arg("tensor2")={});
}
torch_func(tensor1, None)
I would be very grateful for help.
- OS: macOS
- PyTorch version: 0.4.0
- How you installed PyTorch (conda, pip, source): source
- Python version: 3.6
- CUDA/cuDNN version: -
- GPU models and configuration: -
- GCC version (if compiling from source): 4.9
Metadata
Metadata
Assignees
Labels
No labels