(self)
Delete all layers that are not needed for the forward pass.
Delete all layers that are not needed for the forward pass.
Delete all layers that are not needed for the forward pass .
def remove_unused(self):
        """Delete all layers that are not needed for the forward pass.

        """
        if self._pick is None:
            return

        # The biggest index among indices of the layers that are included
        # in pick.
        last_index = max(self.layer_names.index(name) for name in self._pick)
        for name in self.layer_names[last_index + 1:]:
            delattr(self, name)
def remove_unused ( self ) : if self . _pick is None : return # The biggest index among indices of the layers that are included # in pick. last_index = max ( self . layer_names . index ( name ) for name in self . _pick ) for name in self . layer_names [ last_index + 1 : ] : delattr ( self , name )