“adaptive_average_pool-2d” Code-Antworten

adaptive_average_pool-2d

torch.Size([1, 1, 3, 3])
tensor([[[[1., 2., 3.],
          [4., 5., 6.],
          [7., 8., 9.]]]])
Panicky Pigeon

adaptive_average_pool-2d

tensor([[[[3., 4.],
          [6., 7.]]]])
Panicky Pigeon

adaptive_average_pool-2d

inp = torch.tensor([[[[1,2.,3], [4,5,6], [7,8,9]]]], dtype = torch.float)

print(inp .shape)
print(inp)
Panicky Pigeon

adaptive_average_pool-2d

out = nn.AdaptiveAvgPool2d((2,2))(inp)
print(out)
Panicky Pigeon

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen