your solution is missing a for loop, no? How do you actually do this with a for loop?
Error message:
>>> net
Sequential(
  (0): Linear(in_features=2, out_features=2)
  (1): Linear(in_features=2, out_features=2)
)
>>> net.layer
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/brandomiranda/miniconda3/envs/pytorch_overparam/lib/python3.6/site-packages/torch/nn/modules/module.py", line 366, in __getattr__
    type(self).__name__, name))
AttributeError: 'Sequential' object has no attribute 'layer'