-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathTest.py
66 lines (60 loc) · 2.3 KB
/
Test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import torch
import time
emb = torch.randn((114,514,1919))
for i in range(20):
begin = time.time()
torch.cos(emb)
print(time.time() - begin)
'''
<Type Name="DragonianLib::Tensor<*,*>">
<DisplayString>
Shape: {_MyShape}, Data: {_MyData}
</DisplayString>
<Expand>
<Synthetic Name="[ViewAttribute]">
<DisplayString>
{{ ViewShape={_MyShape}, ViewStep={_MyViewStep}, ViewLeftRange={_MyViewLeft}, ViewStride={_MyViewStride} }}
</DisplayString>
<Expand>
<Item Name="[ViewShape]" ExcludeView="simple">_MyShape</Item>
<Item Name="[ViewStep]" ExcludeView="simple">_MyViewStep</Item>
<Item Name="[ViewLeft]" ExcludeView="simple">_MyViewLeft</Item>
<Item Name="[ViewStride]" ExcludeView="simple">_MyViewStride</Item>
</Expand>
</Synthetic>
<Item Name="Allocator">_MyAllocator</Item>
<Item Name="First Element">_MyFirst</Item>
<Item Name="Last Element">_MyLast</Item>
<Item Name="Data">_MyData</Item>
<Item Name="Shape">_MyShape</Item>
<Item Name="View Step">_MyViewStep</Item>
<Item Name="View Left">_MyViewLeft</Item>
<Item Name="View Stride">_MyViewStride</Item>
<Item Name="Is BroadCasted">IsBroadCasted_</Item>
</Expand>
</Type>
<Type Name="DragonianLib::Tensor<*>">
<DisplayString>{{ Type={ float }, Shape={ _MyShape }, Device={ _MyAllocator->Type_ } }}</DisplayString>
<Expand>
<Synthetic Name="[ViewAttribute]">
<DisplayString>{{ ViewShape={ _MyShape }, ViewStep={ _MyViewStep }, ViewLeftRange={ _MyViewLeft }, ViewStride={ _MyViewStride } }}</DisplayString>
<Expand>
<Item Name="[ViewShape]" ExcludeView="simple">_MyShape</Item>
<Item Name="[ViewStep]" ExcludeView="simple">_MyViewStep</Item>
<Item Name="[ViewLeft]" ExcludeView="simple">_MyViewLeft</Item>
<Item Name="[ViewStride]" ExcludeView="simple">_MyViewStride</Item>
</Expand>
</Synthetic>
<Synthetic Name="[Data]">
<DisplayString Condition="(bool)_MyData">{{ Shape = { _MyShape } }}</DisplayString>
<DisplayString Condition="!(bool)_MyData">{{ This = { _MyData } }}</DisplayString>
<Expand>
<Synthetic Name="[Type]">
<DisplayString Condition="(bool)_MyData">{{ Type = { float } }}</DisplayString>
</Synthetic>
<Item Name="[Buffer]" Condition="!(bool)_MyData">_MyFirst</Item>
</Expand>
</Synthetic>
</Expand>
</Type>
'''