>>> import torch
>>> import torch.nn as nn
>>> class F(nn.Module):
...   def __init__(self):
...     super(F, self).__init__()
...   def forward(self, x):
...     return 2 * x
... 
>>> f = F()
>>> a = torch.DoubleTensor([4])
>>> f(a)
tensor([8.], dtype=torch.float64)