How can I use legacy torch module?
Because I need to employ nn.Replicate from torch, I tried the below <SCODE>import torch
import torch.nn.functional as F
from torch.legacy import nn as nn
from torch.autograd import Variable

input = Variable(torch.rand(32,128,1,1))
replicate = nn.Replicate(nf = 32, dim = 3)
output = replicate(input)
<ECODE> But, I got the error message TypeError: ‘Replicate’ object is not callable Can you tell me how I can use nn.Replicate ?
Seungyoung_Park
torch.expand can do the same thing, however the arguments are a little different from nn.Replicate.
ruotianluo
Thanks for your reply.
Seungyoung_Park
apaszke