Tensor that declared in model(class) is in gpu or cpu?

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.

1 Like

i got it, thanks for reply :slight_smile: