tyxe/guides.py
def from_net(cls, net, prefix=""):
        """Alternative init method for instantiating the class from the parameter values of an nn.Module."""
        values = {}
        for name, parameter in net.named_parameters(prefix):
            values[name] = parameter.data.clone()
        return cls(values)
Alternative init method for instantiating the class from the parameter values of an nn.Module.
Alternative init method for instantiating the class from the parameter values of an nn.Module.
Alternative init method for instantiating the class from the parameter values of an nn . Module .
def from_net(cls, net, prefix=""):
        values = {}
        for name, parameter in net.named_parameters(prefix):
            values[name] = parameter.data.clone()
        return cls(values)
def from_net ( cls , net , prefix = "" ) : values = { } for name , parameter in net . named_parameters ( prefix ) : values [ name ] = parameter . data . clone ( ) return cls ( values )
Alternative init method for instantiating the class from the parameter values of an nn.Module.
Alternative init method for instantiating the class from the parameter values of an nn . Module .
"""Alternative init method for instantiating the class from the parameter values of an nn.Module."""
cls
net
prefix