github.com
  
  
    pytorch/pytorch/blob/master/torch/nn/modules/module.py#L241 2



    Returns:
        Module: self
    """
    return self._apply(lambda t: t.type(dst_type))


def float(self):
    """Casts all floating point parameters and buffers to float datatype.


    Returns:
        Module: self
    """
    return self._apply(lambda t: t.float() if not type(t) in torch._integer_tensor_classes else t)


def double(self):
    """Casts all floating point parameters and buffers to double datatype.


    Returns:
        Module: self
    """
    return self._apply(lambda t: t.double() if not type(t) in torch._integer_tensor_classes else t)