The dataparallel tutorial states that if we want to invoke custom functions we made in our model. We’d have to wrap our model into a subclass of data parallel where the subclass is supposed to look something like this.
class MyDataParallel(nn.DataParallel):
    def __getattr__(self, name):
        return getattr(self.module, name)

However when I do this, I get the following error

 File "/.autofs/tools/spack/var/spack/environments/ganvoice/.spack-env/view/lib/python3.6/site-packages/torch/nn/modules/module.py", line 547, in __call__
    result = self.forward(*input, **kwargs)
  File "/.autofs/tools/spack/var/spack/environments/ganvoice/.spack-env/view/lib/python3.6/site-packages/torch/nn/parallel/data_parallel.py", line 142, in forward
    for t in chain(self.module.parameters(), self.module.buffers()):
  File "acai.py", line 27, in __getattr__
    return getattr(self.module, name)
  File "acai.py", line 27, in __getattr__
    return getattr(self.module, name)
  File "acai.py", line 27, in __getattr__
    return getattr(self.module, name)
  [Previous line repeated 327 more times]