Hi,
I am trying to script some PyTorch code that utilizes ModuleList.  The code makes use of subscripting of a ModuleList object as follows:
or i in range(self.n_layers):
acts = fused_add_tanh_sigmoid_multiply(
self.in_layersi,
self.cond_layersi,
torch.IntTensor([self.n_channels]))
I am met with the following error:
RuntimeError:
‘module’ object is not subscriptable:
at /workspace/tacotron2/waveglow/model.py:147:16
for i in range(self.n_layers):
acts = fused_add_tanh_sigmoid_multiply(
self.in_layersi,
~~~~~~~~~~~~~~~~ <— HERE
self.cond_layersi,
torch.IntTensor([self.n_channels]))
Any help would be greatly appreciated.
Thanks.