mirror of
https://github.com/hanzoai/ml.git
synced 2026-11-20 23:08:29 +00:00
15 lines
329 B
Python
15 lines
329 B
Python
import hanzo
|
|
import torch
|
|
|
|
# convert from hanzo tensor to torch tensor
|
|
t = hanzo.randn((3, 512, 512))
|
|
torch_tensor = t.to_torch()
|
|
print(torch_tensor)
|
|
print(type(torch_tensor))
|
|
|
|
# convert from torch tensor to hanzo tensor
|
|
t = torch.randn((3, 512, 512))
|
|
hanzo_tensor = hanzo.Tensor(t)
|
|
print(hanzo_tensor)
|
|
print(type(hanzo_tensor))
|