summaryrefslogtreecommitdiff
path: root/candle-pyo3/test.py
diff options
context:
space:
mode:
authorlaurent <laurent.mazare@gmail.com>2023-07-02 20:42:55 +0100
committerlaurent <laurent.mazare@gmail.com>2023-07-02 20:42:55 +0100
commitfbfe74caab8835d758a1a2bb9ab1c62c9afd50d5 (patch)
treeb577884df10ad2fe3ca9a401cb48520142856b1e /candle-pyo3/test.py
parenteb6f7d30b6f8bae64e9958c27bc8f60f251e5c52 (diff)
downloadcandle-fbfe74caab8835d758a1a2bb9ab1c62c9afd50d5.tar.gz
candle-fbfe74caab8835d758a1a2bb9ab1c62c9afd50d5.tar.bz2
candle-fbfe74caab8835d758a1a2bb9ab1c62c9afd50d5.zip
Preliminary pyo3 support for device.
Diffstat (limited to 'candle-pyo3/test.py')
-rw-r--r--candle-pyo3/test.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/candle-pyo3/test.py b/candle-pyo3/test.py
index 1d792de5..8f906060 100644
--- a/candle-pyo3/test.py
+++ b/candle-pyo3/test.py
@@ -2,12 +2,14 @@ import candle
t = candle.Tensor(42.0)
print(t)
-print("shape", t.shape, t.rank)
+print(t.shape, t.rank, t.device)
print(t + t)
t = candle.Tensor([3.0, 1, 4, 1, 5, 9, 2, 6])
print(t)
print(t+t)
+
t = t.reshape([2, 4])
print(t.matmul(t.t()))
+
print(t.to_dtype("u8"))