Skip to content

Instantly share code, notes, and snippets.

@AmosLewis
Last active December 15, 2022 05:07
Show Gist options
  • Save AmosLewis/932a8dee3ba7657dcc6d09a4da4775d4 to your computer and use it in GitHub Desktop.
Save AmosLewis/932a8dee3ba7657dcc6d09a4da4775d4 to your computer and use it in GitHub Desktop.
value1:
vec:[0,0,0,0,0,0,0]
shape: 1*4*2*1
tosa::getConstTensor
tensor([[
[
[0], [0]
],
[
[0], [0]
],
[
[0], [0]
],
[
[0], [0]
],
]]) 1*4*2*1
value2:
vec: [0,0,1,1,2,2,3,3]
shape: 1*4*2*1
tosa::getConstTensor
tensor([[
[
[0], [0]
],
[
[1], [1]
],
[
[2], [2]
],
[
[3], [3]
],
]]) 1*4*2*1
value3:
type: RankedTensor
shape: 1*4*2
tensor([[
[
0, 0
],
[
1, 0
],
[
2, 1
],
[
2, 1
],
]]) 1*4*2
reshape value3: add 1 dim on last dim to 1*4*2*1
tosa::reshape
tensor([[
[
[0], [0]
],
[
[1], [0]
],
[
[2], [1]
],
[
[2], [1]
],
]]) 1*4*2*1
value4:
tosa::concat([value1,value2,value3], dim=2)????????????????????????????????????????????????????
concat on the last dim got 1*4*2*3
tensor([[
[
[0, 0, 0],[0, 0, 0]
],
[
[0, 1, 1],[0, 1, 0]
],
[
[0, 2, 2],[0, 2, 1]
],
[
[0, 3, 2],[0, 3, 1]
]
]]) # 1*4*2*3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment