Skip to content

Commit b209a10

Browse files
committed
remove torch_dtype from to()
1 parent 17612de commit b209a10

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

src/diffusers/pipelines/pipeline_utils.py

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -775,32 +775,10 @@ def to(self, *args, **kwargs):
775775
Returns:
776776
[`DiffusionPipeline`]: The pipeline converted to specified `dtype` and/or `dtype`.
777777
"""
778-
779-
torch_dtype = kwargs.pop("torch_dtype", None)
780-
if torch_dtype is not None:
781-
deprecate("torch_dtype", "0.27.0", "")
782-
torch_device = kwargs.pop("torch_device", None)
783-
if torch_device is not None:
784-
deprecate("torch_device", "0.27.0", "")
785-
786-
dtype_kwarg = kwargs.pop("dtype", None)
787-
device_kwarg = kwargs.pop("device", None)
778+
dtype = kwargs.pop("dtype", None)
779+
device= kwargs.pop("device", None)
788780
silence_dtype_warnings = kwargs.pop("silence_dtype_warnings", False)
789781

790-
if torch_dtype is not None and dtype_kwarg is not None:
791-
raise ValueError(
792-
"You have passed both `torch_dtype` and `dtype` as a keyword argument. Please make sure to only pass `dtype`."
793-
)
794-
795-
dtype = torch_dtype or dtype_kwarg
796-
797-
if torch_device is not None and device_kwarg is not None:
798-
raise ValueError(
799-
"You have passed both `torch_device` and `device` as a keyword argument. Please make sure to only pass `device`."
800-
)
801-
802-
device = torch_device or device_kwarg
803-
804782
dtype_arg = None
805783
device_arg = None
806784
if len(args) == 1:

0 commit comments

Comments
 (0)