Created
July 12, 2022 07:49
-
-
Save rpitonak/c950f1fcf81e943675ccfc5bb8efa4b3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Permute dimension, after resize they are in this order | |
# N W H C | |
# 0 1 2 3 | |
# After transpose we want them in shape | |
# N C W H | |
# 0 3 1 2 | |
perm = onnx.helper.make_node("Constant", inputs=[], outputs=["perm"], name="perm-constant", | |
value=onnx.helper.make_tensor(name="perm-values", | |
data_type=onnx.TensorProto.INT64, | |
dims=np.array([0,3,1,2]).shape, | |
vals=np.array([0,3,1,2]).flatten() | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment