提交 e5fcb367 编写于 作者: HansBug's avatar HansBug 😆

dev(hansbug): update runs script

上级 dcfaa799
......@@ -56,7 +56,7 @@ jobs:
CI: 'true'
LINETRACE: 1
run: |
make clean build run
make run
- name: Show the artifacts
run: |
tree runs/artifacts
......
import treetensor.torch as torch
if __name__ == '__main__':
# create a tree tensor
t = torch.randn({
'a': (6, 2, 3),
'b': {'x': (6, 3), 'y': (6, 1, 4)},
})
# create a tree tensor
t = torch.randn({
'a': (6, 2, 3),
'b': {'x': (6, 3), 'y': (6, 1, 4)},
})
# structural operation
print(torch.stack([t, t, t]))
print(torch.cat([t, t, t]))
print(torch.split(t, (1, 2, 3)))
# structural operation
print(torch.stack([t, t, t]))
print(torch.cat([t, t, t]))
print(torch.split(t, (1, 2, 3)))
# math calculations
print(t ** 2)
print(torch.sin(t).cos())
# math calculations
print(t ** 2)
print(torch.sin(t).cos())
import torch
if __name__ == '__main__':
# create a native tensor
t = torch.randn((6, 2, 3))
# create a native tensor
t = torch.randn((6, 2, 3))
# structural operation
print(torch.stack([t, t, t]))
print(torch.cat([t, t, t]))
print(torch.split(t, (1, 2, 3)))
# structural operation
print(torch.stack([t, t, t]))
print(torch.cat([t, t, t]))
print(torch.split(t, (1, 2, 3)))
# math calculations
print(t ** 2)
print(torch.sin(t).cos())
# math calculations
print(t ** 2)
print(torch.sin(t).cos())
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册