At first, I write a samll net named Tnet, and it works well, but now I want to use it in a bigger net named Mnet, so I write

self.tnet=Tnet()

in Mnet’s   __init__  function, but it catches a error during forward process like this:
out, _ = cls(data)
  File "/home/zqk/anaconda2/envs/torch/lib/python2.7/site-packages/torch/nn/modules/module.py", line 489, in __call__
    result = self.forward(*input, **kwargs)
  File "mynet.py", line 109, in forward
    tout = self.tnet(x)
  File "/home/zqk/anaconda2/envs/torch/lib/python2.7/site-packages/torch/nn/modules/module.py", line 535, in __getattr__
    type(self).__name__, name))
AttributeError: 'Mnet' object has no attribute 'tnet'

what’s wrong with it?