mirror of
https://github.com/huggingface/candle.git
synced 2025-06-19 19:58:35 +00:00
PyO3: Add pytorch like .to()
operator to candle.Tensor
(#1100)
* add `.to()` operator * Only allow each value to be provided once via `args` or `kwargs`
This commit is contained in:
@ -381,6 +381,11 @@ class Tensor:
|
||||
Transposes the tensor.
|
||||
"""
|
||||
pass
|
||||
def to(self, *args, **kwargs) -> Tensor:
|
||||
"""
|
||||
Performs Tensor dtype and/or device conversion.
|
||||
"""
|
||||
pass
|
||||
def to_device(self, device: Union[str, Device]) -> Tensor:
|
||||
"""
|
||||
Move the tensor to a new device.
|
||||
|
Reference in New Issue
Block a user