ReflectionPad2d は、どの様な使い道があるのでしょうか。
Python
1import torch.nn as nn 2m = nn.ReflectionPad2d((1, 1, 1, 1)) 3 4input = torch.arange(9, dtype=torch.float).reshape(1, 1, 3, 3) 5print(input) 6--------------------------------------- 7tensor([[[[0., 1., 2.], 8 [3., 4., 5.], 9 [6., 7., 8.]]]]) 10--------------------------------------- 11m(input) 12tensor([[[[4., 3., 4., 5., 4.], 13 [1., 0., 1., 2., 1.], 14 [4., 3., 4., 5., 4.], 15 [7., 6., 7., 8., 7.], 16 [4., 3., 4., 5., 4.]]]])
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。