Sequential length

If I refer to the the documentation we have :

  def __len__(self):
        return len(self._modules) 

in the Sequential classe.
But if I am trying to len(sequential_object) I have :

TypeError: object of type 'Sequential' has no len()

Am I doing something wrong ? I am quite new to python and it might be wrong

i think you’ll have to subclass Sequential for your custom __len__ to activate.