Skip to content

Instantly share code, notes, and snippets.

@gautamborad
Last active June 10, 2021 08:02
Show Gist options
  • Save gautamborad/622fdfa344021ccf91cd3215094dc0a0 to your computer and use it in GitHub Desktop.
Save gautamborad/622fdfa344021ccf91cd3215094dc0a0 to your computer and use it in GitHub Desktop.
Eager:
=====
one_d:
tensor([3, 3, 0], dtype=torch.uint8)
TorchScript:
=====
one_d:
tensor([ 3, 3, 0])
[ CPUByteType{3} ]
Eager:
=====
two_d:
tensor([[3, 4],
[4, 3]], dtype=torch.uint8)
TorchScript:
=====
two_d:
tensor([[ 3, 4],
[ 4, 3]])
[ CPUByteType{2,2} ]
Eager:
=====
three_d:
tensor([[[2, 2],
[1, 2]],
[[2, 2],
[1, 1]]], dtype=torch.uint8)
TorchScript:
=====
three_d:
tensor([[[ 2, 2],
[ 1, 2]],
[[ 2, 2],
[ 1, 1]]])
[ CPUByteType{2,2,2} ]
Eager:
=====
four_d:
tensor([[[[3, 3, 6],
[4, 4, 4],
[5, 6, 3]],
[[6, 4, 3],
[4, 6, 5],
[5, 6, 3]],
[[4, 3, 4],
[5, 6, 3],
[5, 4, 5]]],
[[[6, 6, 5],
[6, 5, 4],
[5, 5, 4]],
[[3, 4, 3],
[6, 3, 4],
[3, 4, 4]],
[[4, 6, 3],
[5, 6, 3],
[5, 6, 5]]],
[[[6, 4, 5],
[6, 6, 3],
[5, 5, 3]],
[[5, 5, 5],
[3, 6, 6],
[3, 6, 5]],
[[6, 6, 4],
[6, 4, 3],
[5, 6, 6]]]], dtype=torch.uint8)
TorchScript:
=====
four_d:
tensor([[[[ 3, 3, 6],
[ 4, 4, 4],
[ 5, 6, 3]],
[[ 6, 4, 3],
[ 4, 6, 5],
[ 5, 6, 3]],
[[ 4, 3, 4],
[ 5, 6, 3],
[ 5, 4, 5]]],
[[[ 6, 6, 5],
[ 6, 5, 4],
[ 5, 5, 4]],
[[ 3, 4, 3],
[ 6, 3, 4],
[ 3, 4, 4]],
[[ 4, 6, 3],
[ 5, 6, 3],
[ 5, 6, 5]]],
[[[ 6, 4, 5],
[ 6, 6, 3],
[ 5, 5, 3]],
[[ 5, 5, 5],
[ 3, 6, 6],
[ 3, 6, 5]],
[[ 6, 6, 4],
[ 6, 4, 3],
[ 5, 6, 6]]]])
[ CPUByteType{3,3,3,3} ]
-------------------------------------------------------------------
Eager:
=====
one_d:
tensor([1, 1, 0], dtype=torch.int8)
TorchScript:
=====
one_d:
tensor([ 1, 1, 0])
[ CPUCharType{3} ]
Eager:
=====
two_d:
tensor([[4, 2],
[3, 3]], dtype=torch.int8)
TorchScript:
=====
two_d:
tensor([[ 4, 2],
[ 3, 3]])
[ CPUCharType{2,2} ]
Eager:
=====
three_d:
tensor([[[1, 1],
[2, 1]],
[[1, 2],
[2, 1]]], dtype=torch.int8)
TorchScript:
=====
three_d:
tensor([[[ 1, 1],
[ 2, 1]],
[[ 1, 2],
[ 2, 1]]])
[ CPUCharType{2,2,2} ]
Eager:
=====
four_d:
tensor([[[[3, 4, 4],
[3, 3, 6],
[4, 4, 4]],
[[4, 5, 4],
[5, 4, 6],
[5, 6, 5]],
[[3, 3, 6],
[6, 3, 5],
[3, 5, 6]]],
[[[4, 5, 3],
[4, 4, 3],
[3, 6, 5]],
[[5, 6, 3],
[3, 5, 6],
[5, 4, 3]],
[[5, 4, 3],
[5, 3, 6],
[4, 6, 3]]],
[[[3, 3, 4],
[3, 6, 6],
[3, 6, 5]],
[[6, 4, 5],
[4, 6, 5],
[3, 6, 6]],
[[5, 6, 3],
[3, 4, 3],
[5, 3, 4]]]], dtype=torch.int8)
TorchScript:
=====
four_d:
tensor([[[[ 3, 4, 4],
[ 3, 3, 6],
[ 4, 4, 4]],
[[ 4, 5, 4],
[ 5, 4, 6],
[ 5, 6, 5]],
[[ 3, 3, 6],
[ 6, 3, 5],
[ 3, 5, 6]]],
[[[ 4, 5, 3],
[ 4, 4, 3],
[ 3, 6, 5]],
[[ 5, 6, 3],
[ 3, 5, 6],
[ 5, 4, 3]],
[[ 5, 4, 3],
[ 5, 3, 6],
[ 4, 6, 3]]],
[[[ 3, 3, 4],
[ 3, 6, 6],
[ 3, 6, 5]],
[[ 6, 4, 5],
[ 4, 6, 5],
[ 3, 6, 6]],
[[ 5, 6, 3],
[ 3, 4, 3],
[ 5, 3, 4]]]])
[ CPUCharType{3,3,3,3} ]
-------------------------------------------------------------------
Eager:
=====
one_d:
tensor([3, 0, 0], dtype=torch.int16)
TorchScript:
=====
one_d:
tensor([ 3, 0, 0])
[ CPUShortType{3} ]
Eager:
=====
two_d:
tensor([[2, 2],
[2, 4]], dtype=torch.int16)
TorchScript:
=====
two_d:
tensor([[ 2, 2],
[ 2, 4]])
[ CPUShortType{2,2} ]
Eager:
=====
three_d:
tensor([[[2, 2],
[1, 1]],
[[2, 2],
[2, 1]]], dtype=torch.int16)
TorchScript:
=====
three_d:
tensor([[[ 2, 2],
[ 1, 1]],
[[ 2, 2],
[ 2, 1]]])
[ CPUShortType{2,2,2} ]
Eager:
=====
four_d:
tensor([[[[6, 6, 4],
[4, 5, 6],
[5, 4, 5]],
[[4, 4, 3],
[5, 5, 5],
[3, 4, 6]],
[[5, 4, 5],
[5, 3, 4],
[3, 4, 5]]],
[[[3, 5, 3],
[5, 3, 4],
[3, 3, 4]],
[[3, 5, 3],
[4, 4, 3],
[4, 5, 3]],
[[3, 6, 4],
[3, 4, 3],
[3, 5, 4]]],
[[[5, 4, 3],
[5, 6, 5],
[4, 5, 4]],
[[4, 4, 5],
[6, 3, 5],
[6, 5, 3]],
[[6, 3, 3],
[3, 3, 3],
[6, 4, 6]]]], dtype=torch.int16)
TorchScript:
=====
four_d:
tensor([[[[ 6, 6, 4],
[ 4, 5, 6],
[ 5, 4, 5]],
[[ 4, 4, 3],
[ 5, 5, 5],
[ 3, 4, 6]],
[[ 5, 4, 5],
[ 5, 3, 4],
[ 3, 4, 5]]],
[[[ 3, 5, 3],
[ 5, 3, 4],
[ 3, 3, 4]],
[[ 3, 5, 3],
[ 4, 4, 3],
[ 4, 5, 3]],
[[ 3, 6, 4],
[ 3, 4, 3],
[ 3, 5, 4]]],
[[[ 5, 4, 3],
[ 5, 6, 5],
[ 4, 5, 4]],
[[ 4, 4, 5],
[ 6, 3, 5],
[ 6, 5, 3]],
[[ 6, 3, 3],
[ 3, 3, 3],
[ 6, 4, 6]]]])
[ CPUShortType{3,3,3,3} ]
-------------------------------------------------------------------
Eager:
=====
one_d:
tensor([2, 2, 3], dtype=torch.int32)
TorchScript:
=====
one_d:
tensor([ 2, 2, 3])
[ CPUIntType{3} ]
Eager:
=====
two_d:
tensor([[2, 2],
[2, 2]], dtype=torch.int32)
TorchScript:
=====
two_d:
tensor([[ 2, 2],
[ 2, 2]])
[ CPUIntType{2,2} ]
Eager:
=====
three_d:
tensor([[[1, 2],
[1, 2]],
[[1, 1],
[2, 1]]], dtype=torch.int32)
TorchScript:
=====
three_d:
tensor([[[ 1, 2],
[ 1, 2]],
[[ 1, 1],
[ 2, 1]]])
[ CPUIntType{2,2,2} ]
Eager:
=====
four_d:
tensor([[[[3, 6, 4],
[6, 6, 6],
[5, 6, 5]],
[[5, 5, 4],
[4, 4, 6],
[5, 5, 5]],
[[4, 6, 4],
[4, 6, 5],
[4, 5, 3]]],
[[[6, 6, 5],
[3, 4, 4],
[4, 3, 3]],
[[6, 6, 4],
[6, 4, 5],
[5, 5, 4]],
[[6, 3, 6],
[5, 6, 6],
[5, 4, 3]]],
[[[6, 6, 6],
[5, 5, 5],
[3, 6, 5]],
[[6, 6, 6],
[4, 3, 5],
[3, 6, 4]],
[[4, 5, 4],
[5, 6, 3],
[3, 6, 6]]]], dtype=torch.int32)
TorchScript:
=====
four_d:
tensor([[[[ 3, 6, 4],
[ 6, 6, 6],
[ 5, 6, 5]],
[[ 5, 5, 4],
[ 4, 4, 6],
[ 5, 5, 5]],
[[ 4, 6, 4],
[ 4, 6, 5],
[ 4, 5, 3]]],
[[[ 6, 6, 5],
[ 3, 4, 4],
[ 4, 3, 3]],
[[ 6, 6, 4],
[ 6, 4, 5],
[ 5, 5, 4]],
[[ 6, 3, 6],
[ 5, 6, 6],
[ 5, 4, 3]]],
[[[ 6, 6, 6],
[ 5, 5, 5],
[ 3, 6, 5]],
[[ 6, 6, 6],
[ 4, 3, 5],
[ 3, 6, 4]],
[[ 4, 5, 4],
[ 5, 6, 3],
[ 3, 6, 6]]]])
[ CPUIntType{3,3,3,3} ]
-------------------------------------------------------------------
Eager:
=====
one_d:
tensor([0, 0, 2])
TorchScript:
=====
one_d:
tensor([ 0, 0, 2])
[ CPULongType{3} ]
Eager:
=====
two_d:
tensor([[4, 2],
[2, 3]])
TorchScript:
=====
two_d:
tensor([[ 4, 2],
[ 2, 3]])
[ CPULongType{2,2} ]
Eager:
=====
three_d:
tensor([[[2, 2],
[1, 2]],
[[2, 2],
[1, 2]]])
TorchScript:
=====
three_d:
tensor([[[ 2, 2],
[ 1, 2]],
[[ 2, 2],
[ 1, 2]]])
[ CPULongType{2,2,2} ]
Eager:
=====
four_d:
tensor([[[[3, 4, 4],
[4, 5, 4],
[4, 6, 4]],
[[4, 6, 5],
[4, 6, 3],
[6, 5, 4]],
[[3, 4, 6],
[6, 4, 4],
[5, 3, 5]]],
[[[6, 5, 4],
[5, 5, 5],
[3, 6, 6]],
[[5, 3, 3],
[4, 3, 4],
[5, 3, 3]],
[[3, 6, 3],
[5, 6, 3],
[6, 4, 4]]],
[[[6, 5, 4],
[3, 4, 3],
[3, 4, 6]],
[[4, 3, 3],
[4, 5, 3],
[5, 3, 5]],
[[5, 5, 4],
[5, 4, 6],
[6, 3, 4]]]])
TorchScript:
=====
four_d:
tensor([[[[ 3, 4, 4],
[ 4, 5, 4],
[ 4, 6, 4]],
[[ 4, 6, 5],
[ 4, 6, 3],
[ 6, 5, 4]],
[[ 3, 4, 6],
[ 6, 4, 4],
[ 5, 3, 5]]],
[[[ 6, 5, 4],
[ 5, 5, 5],
[ 3, 6, 6]],
[[ 5, 3, 3],
[ 4, 3, 4],
[ 5, 3, 3]],
[[ 3, 6, 3],
[ 5, 6, 3],
[ 6, 4, 4]]],
[[[ 6, 5, 4],
[ 3, 4, 3],
[ 3, 4, 6]],
[[ 4, 3, 3],
[ 4, 5, 3],
[ 5, 3, 5]],
[[ 5, 5, 4],
[ 5, 4, 6],
[ 6, 3, 4]]]])
[ CPULongType{3,3,3,3} ]
-------------------------------------------------------------------
End------------> all_int_dtypes
Start------------> all_fp_dtypes
Eager:
=====
Eager one_d:
tensor([0.8862, 0.6374, 0.5895, 0.4836])
TorchScript:
=====
TorchScript one_d:
tensor([ 0.8862, 0.6374, 0.5895, 0.4836])
[ CPUFloatType{4} ]
Eager:
=====
Eager two_d:
tensor([[0.7447, 0.6302, 0.3191, 0.4868, 0.1060],
[0.5758, 0.0270, 0.3764, 0.9104, 0.7007]])
TorchScript:
=====
TorchScript two_d:
tensor([[ 0.7447, 0.6302, 0.3191, 0.4868, 0.1060],
[ 0.5758, 0.0270, 0.3764, 0.9104, 0.7007]])
[ CPUFloatType{2,5} ]
Eager:
=====
Eager three_d:
tensor([[[0.3013, 0.8141, 0.4720, 0.1424, 0.9305],
[0.2058, 0.5577, 0.9546, 0.0137, 0.6347],
[0.0715, 0.6876, 0.7069, 0.2962, 0.7511]]])
TorchScript:
=====
TorchScript three_d:
tensor([[[ 0.3013, 0.8141, 0.4720, 0.1424, 0.9305],
[ 0.2058, 0.5577, 0.9546, 0.0137, 0.6347],
[ 0.0715, 0.6876, 0.7069, 0.2962, 0.7511]]])
[ CPUFloatType{1,3,5} ]
Eager:
=====
TorchScript:
=====
Eager four_d:
tensor([[[[0.8764, 0.1956, 0.5063, 0.1208],
[0.0147, 0.1540, 0.1596, 0.5032],
[0.7086, 0.7997, 0.9963, 0.7269]],
[[0.3030, 0.5717, 0.6340, 0.8958],
[0.6083, 0.3048, 0.0234, 0.8670],
[0.9913, 0.4057, 0.7230, 0.0731]]]])
TorchScript four_d:
tensor([[[[ 0.8764, 0.1956, 0.5063, 0.1208],
[ 0.0147, 0.1540, 0.1596, 0.5032],
[ 0.7086, 0.7997, 0.9963, 0.7269]],
[[ 0.3030, 0.5717, 0.6340, 0.8958],
[ 0.6083, 0.3048, 0.0234, 0.8670],
[ 0.9913, 0.4057, 0.7230, 0.0731]]]])
[ CPUFloatType{1,2,3,4} ]
-------------------------------------------------------------------
Eager:
=====
Eager one_d:
tensor([0.0750, 0.2591, 0.1479, 0.8752], dtype=torch.float64)
TorchScript:
=====
TorchScript one_d:
tensor([ 0.0750, 0.2591, 0.1479, 0.8752])
[ CPUDoubleType{4} ]
Eager:
=====
Eager two_d:
tensor([[0.2920, 0.4998, 0.8367, 0.7295, 0.7714],
[0.6530, 0.6883, 0.3495, 0.0512, 0.8327]], dtype=torch.float64)
TorchScript:
=====
TorchScript two_d:
tensor([[ 0.2920, 0.4998, 0.8367, 0.7295, 0.7714],
[ 0.6530, 0.6883, 0.3495, 0.0512, 0.8327]])
[ CPUDoubleType{2,5} ]
Eager:
=====
Eager three_d:
tensor([[[0.0440, 0.0733, 0.9754, 0.9970, 0.8539],
[0.4797, 0.2951, 0.3387, 0.1441, 0.3260],
[0.7813, 0.2350, 0.3746, 0.8920, 0.9625]]], dtype=torch.float64)
TorchScript:
=====
TorchScript three_d:
tensor([[[ 0.0440, 0.0733, 0.9754, 0.9970, 0.8539],
[ 0.4797, 0.2951, 0.3387, 0.1441, 0.3260],
[ 0.7813, 0.2350, 0.3746, 0.8920, 0.9625]]])
[ CPUDoubleType{1,3,5} ]
Eager:
=====
TorchScript:
=====
Eager four_d:
tensor([[[[0.3015, 0.0089, 0.9725, 0.4227],
[0.6755, 0.7912, 0.2659, 0.0508],
[0.3258, 0.7791, 0.6802, 0.9657]],
[[0.0207, 0.6678, 0.3000, 0.5074],
[0.2995, 0.2149, 0.3225, 0.2816],
[0.8775, 0.9692, 0.8431, 0.8633]]]], dtype=torch.float64)
TorchScript four_d:
tensor([[[[ 0.3015, 0.0089, 0.9725, 0.4227],
[ 0.6755, 0.7912, 0.2659, 0.0508],
[ 0.3258, 0.7791, 0.6802, 0.9657]],
[[ 0.0207, 0.6678, 0.3000, 0.5074],
[ 0.2995, 0.2149, 0.3225, 0.2816],
[ 0.8775, 0.9692, 0.8431, 0.8633]]]])
[ CPUDoubleType{1,2,3,4} ]
-------------------------------------------------------------------
Eager:
=====
Eager one_d:
tensor([0.2559, 0.1602, 0.7837, 0.2524], dtype=torch.float16)
TorchScript:
=====
TorchScript one_d:
tensor([ 0.2559, 0.1602, 0.7837, 0.2524])
[ CPUHalfType{4} ]
Eager:
=====
Eager two_d:
tensor([[0.0161, 0.2734, 0.5391, 0.9702, 0.9204],
[0.0752, 0.3149, 0.9150, 0.4385, 0.3818]], dtype=torch.float16)
TorchScript:
=====
TorchScript two_d:
tensor([[ 0.0161, 0.2734, 0.5391, 0.9702, 0.9204],
[ 0.0752, 0.3149, 0.9150, 0.4385, 0.3818]])
[ CPUHalfType{2,5} ]
Eager:
=====
Eager three_d:
tensor([[[0.3042, 0.2334, 0.0874, 0.7773, 0.6895],
[0.6040, 0.1104, 0.3315, 0.9590, 0.9683],
[0.7227, 0.1987, 0.7422, 0.0474, 0.7676]]], dtype=torch.float16)
TorchScript:
=====
TorchScript three_d:
tensor([[[ 0.3042, 0.2334, 0.0874, 0.7773, 0.6895],
[ 0.6040, 0.1104, 0.3315, 0.9590, 0.9683],
[ 0.7227, 0.1987, 0.7422, 0.0474, 0.7676]]])
[ CPUHalfType{1,3,5} ]
Eager:
=====
TorchScript:
=====
Eager four_d:
tensor([[[[0.4927, 0.5718, 0.7095, 0.8052],
[0.3682, 0.4893, 0.0215, 0.6582],
[0.3120, 0.2988, 0.7896, 0.8662]],
[[0.7812, 0.4932, 0.9380, 0.5259],
[0.5703, 0.3125, 0.0415, 0.2192],
[0.0645, 0.5864, 0.3037, 0.8804]]]], dtype=torch.float16)
TorchScript four_d:
tensor([[[[ 0.4927, 0.5718, 0.7095, 0.8052],
[ 0.3682, 0.4893, 0.0215, 0.6582],
[ 0.3120, 0.2988, 0.7896, 0.8662]],
[[ 0.7812, 0.4932, 0.9380, 0.5259],
[ 0.5703, 0.3125, 0.0415, 0.2192],
[ 0.0645, 0.5864, 0.3037, 0.8804]]]])
[ CPUHalfType{1,2,3,4} ]
-------------------------------------------------------------------
Eager:
=====
Eager one_d:
tensor([0.3203, 0.3438, 0.3438, 0.0273], dtype=torch.bfloat16)
TorchScript:
=====
TorchScript one_d:
tensor([ 0.3203, 0.3438, 0.3438, 0.0273])
[ CPUBFloat16Type{4} ]
Eager:
=====
Eager two_d:
tensor([[0.0508, 0.9922, 0.1133, 0.9102, 0.1797],
[0.8594, 0.4766, 0.8477, 0.3125, 0.3750]], dtype=torch.bfloat16)
TorchScript:
=====
TorchScript two_d:
tensor([[ 0.0508, 0.9922, 0.1133, 0.9102, 0.1797],
[ 0.8594, 0.4766, 0.8477, 0.3125, 0.3750]])
[ CPUBFloat16Type{2,5} ]
Eager:
=====
Eager three_d:
tensor([[[0.9844, 0.4766, 0.8906, 0.3945, 0.7227],
[0.6016, 0.7227, 0.8789, 0.8906, 0.3438],
[0.0742, 0.5586, 0.0000, 0.3125, 0.1523]]], dtype=torch.bfloat16)
TorchScript:
=====
TorchScript three_d:
tensor([[[ 0.9844, 0.4766, 0.8906, 0.3945, 0.7227],
[ 0.6016, 0.7227, 0.8789, 0.8906, 0.3438],
[ 0.0742, 0.5586, 0.0000, 0.3125, 0.1523]]])
[ CPUBFloat16Type{1,3,5} ]
Eager:
=====
TorchScript:
=====
Eager four_d:
tensor([[[[0.8008, 0.1719, 0.3672, 0.0781],
[0.6367, 0.1875, 0.0469, 0.5117],
[0.2578, 0.9609, 0.5703, 0.8203]],
[[0.8008, 0.7695, 0.3359, 0.8633],
[0.1875, 0.2031, 0.9219, 0.8633],
[0.3164, 0.0742, 0.1016, 0.0977]]]], dtype=torch.bfloat16)
TorchScript four_d:
tensor([[[[ 0.8008, 0.1719, 0.3672, 0.0781],
[ 0.6367, 0.1875, 0.0469, 0.5117],
[ 0.2578, 0.9609, 0.5703, 0.8203]],
[[ 0.8008, 0.7695, 0.3359, 0.8633],
[ 0.1875, 0.2031, 0.9219, 0.8633],
[ 0.3164, 0.0742, 0.1016, 0.0977]]]])
[ CPUBFloat16Type{1,2,3,4} ]
-------------------------------------------------------------------
Eager:
=====
one_d:
tensor([0.4078+0.1507j, 0.2374+0.5789j, 0.6729+0.9506j, 0.3730+0.2517j],
dtype=torch.complex128)
TorchScript:
=====
one_d:
tensor([ 0.4078, 0.2374, 0.6729, 0.3730])
[ CPUComplexDoubleType{4} ]
Eager:
=====
two_d:
tensor([[0.6952+0.4326j, 0.6554+0.8845j, 0.5624+0.7947j, 0.5934+0.2842j,
0.7831+0.5603j],
[0.2269+0.5127j, 0.1438+0.4418j, 0.3071+0.5625j, 0.8339+0.0586j,
0.1310+0.6380j]], dtype=torch.complex128)
TorchScript:
=====
two_d:
tensor([[ 0.6952, 0.6554, 0.5624, 0.5934, 0.7831],
[ 0.2269, 0.1438, 0.3071, 0.8339, 0.1310]])
[ CPUComplexDoubleType{2,5} ]
Eager:
=====
three_d:
tensor([[[0.4554+0.8411j, 0.5804+0.0306j, 0.7246+0.2556j, 0.9033+0.0010j,
0.4620+0.2163j],
[0.1318+0.8564j, 0.2276+0.5338j, 0.9912+0.6022j, 0.9679+0.6979j,
0.1361+0.1670j],
[0.2906+0.1830j, 0.4380+0.8863j, 0.8733+0.0768j, 0.7432+0.5442j,
0.6892+0.4287j]]], dtype=torch.complex128)
TorchScript:
=====
three_d:
tensor([[[ 0.4554, 0.5804, 0.7246, 0.9033, 0.4620],
[ 0.1318, 0.2276, 0.9912, 0.9679, 0.1361],
[ 0.2906, 0.4380, 0.8733, 0.7432, 0.6892]]])
[ CPUComplexDoubleType{1,3,5} ]
-------------------------------------------------------------------
Eager:
=====
one_d:
tensor([True, True])
TorchScript:
=====
one_d:
tensor([ 1, 1])
[ CPUBoolType{2} ]
Eager:
=====
two_d:
tensor([[True, True],
[True, True],
[True, True],
[True, True]])
three_d:
tensor([[[True, True],
[True, True]],
[[True, True],
[True, True]]])
four_d:
tensor([[True, True],
[True, True],
[True, True],
[True, True],
[True, True]])
-------------------------------------------------------------------
two_d:
tensor([[ 1, 1],
[ 1, 1],
[ 1, 1],
[ 1, 1]])
[ CPUBoolType{4,2} ]
three_d:
tensor([[[ 1, 1],
[ 1, 1]],
[[ 1, 1],
[ 1, 1]]])
[ CPUBoolType{2,2,2} ]
four_d:
tensor([[ 1, 1],
[ 1, 1],
[ 1, 1],
[ 1, 1],
[ 1, 1]])
[ CPUBoolType{5,2} ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment