Describe the bug
At present, the torch.FloatTensor type hint is commonly employed in the codebase. However, if one were to pass a torch.Tensor, Pyright would raise complaints about the inconsistency between these two types. Furthermore, based on information from this thread, it appears that torch.FloatTensor has been deprecated.
Reproduction
import torch
from diffusers.schedulers.scheduling_ddim import DDIMScheduler
scheduler = DDIMScheduler()
a = torch.randn(1, 3, 64, 64)
scheduler.scale_model_input(a)
Output of Pyright:
$ pyright test.py
test.py
test.py:6:29 - error: Argument of type "Tensor" cannot be assigned to parameter "sample" of type "FloatTensor" in function "scale_model_input"
__"Tensor" is incompatible with "FloatTensor" (reportArgumentType)
1 error, 0 warnings, 0 informations
Logs
No response
System Info
pyright version: 1.1.356
diffusers version: 0.27.2
- Platform: Linux-5.4.210-4-velinux1-amd64-x86_64-with-glibc2.31
- Python version: 3.12.2
- PyTorch version (GPU?): 2.2.1 (True)
- Huggingface_hub version: 0.22.0
- Transformers version: not installed
- Accelerate version: 0.28.0
- xFormers version: not installed
- Using GPU in script?: no
- Using distributed or parallel set-up in script?: no
Who can help?
No response
Describe the bug
At present, the
torch.FloatTensortype hint is commonly employed in the codebase. However, if one were to pass atorch.Tensor, Pyright would raise complaints about the inconsistency between these two types. Furthermore, based on information from this thread, it appears thattorch.FloatTensorhas been deprecated.Reproduction
Output of Pyright:
Logs
No response
System Info
pyrightversion: 1.1.356diffusersversion: 0.27.2Who can help?
No response