def extend(self, modules: Iterable[Module]) -> "ModuleList":
        r"""Appends modules from a Python iterable to the end of the list.

        Args:
            modules (iterable): iterable of modules to append
        """
        if not isinstance(modules, container_abcs.Iterable):
            raise TypeError(
                "ModuleList.extend should be called with an "
                "iterable, but got " + type(modules).__name__
            )
        offset = len(self)
        for i, module in enumerate(modules):
            self.add_module(str(offset + i), module)
        return self
Appends modules from a Python iterable to the end of the list.

        Args:
            modules (iterable): iterable of modules to append
        
python/aitemplate/frontend/nn/container.py