From 6a446d9d73da64daea4dc75e9b57dba78d4180fb Mon Sep 17 00:00:00 2001 From: andrew Date: Thu, 26 Oct 2023 01:39:14 +0700 Subject: convert pytorch's tensor in Python API (#1172) * convert pytorch's tensor * separate tests for convert pytorch tensor --- candle-pyo3/py_src/candle/__init__.pyi | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'candle-pyo3/py_src') diff --git a/candle-pyo3/py_src/candle/__init__.pyi b/candle-pyo3/py_src/candle/__init__.pyi index 7a0b2fcf..43722168 100644 --- a/candle-pyo3/py_src/candle/__init__.pyi +++ b/candle-pyo3/py_src/candle/__init__.pyi @@ -396,6 +396,11 @@ class Tensor: Convert the tensor to a new dtype. """ pass + def to_torch(self) -> torch.Tensor: + """ + Converts candle's tensor to pytorch's tensor + """ + pass def transpose(self, dim1: int, dim2: int) -> Tensor: """ Returns a tensor that is a transposed version of the input, the given dimensions are swapped. -- cgit v1.2.3