class model(nn.Module):
...
def forward(self, x):
a = tensor.zeros(1, 256, 64, 48)
...
y = model(input).cuda()
if i call model like this then local parameter a
is in GPU?
class model(nn.Module):
...
def forward(self, x):
a = tensor.zeros(1, 256, 64, 48)
...
y = model(input).cuda()
if i call model like this then local parameter a
is in GPU?
.cuda()
only transfers the registered parameters of a model to the gpu, since a
is a tensor created locally in forward
, u have to transfer it to gpu mannually.
i got it, thanks for reply