Closed ioangatop closed 7 months ago
The CLI seems to not be able to handle torch.dtype arguments; pretty important for torchvision ToDtype transform.
torch.dtype
Using the CLI:
# main.py import torch from jsonargparse import CLI def interface(dtype: torch.dtype) -> None: print(f"dtype: {dtype} ({type(dtype)})") CLI(interface)
Run with:
python3 main.py torch.float32
The above to print:
dtype: torch.float32 (<class 'torch.dtype'>)
pip install jsonargparse[all]
Thank you for repointing! This should be fixed with the pull request that was just merged.
🐛 Bug report
The CLI seems to not be able to handle
torch.dtype
arguments; pretty important for torchvision ToDtype transform.To reproduce
Using the CLI:
Run with:
Expected behaviour:
The above to print:
Environment
pip install jsonargparse[all]
):