torch.is_tensor(obj)
torch.is_storage(obj)
torch.is_complex(input) -> (bool)
torch.is_floating_point(input) -> (bool)
torch.set_default_dtype(d)
torch.get_default_dtype() → torch.dtype
torch.set_default_tensor_type(t)
torch.numel(input) → int
torch.set_printoptions(precision=None, threshold=None, edgeitems=None, linewidth=None, profile=None, sci_mode=None)
torch.set_flush_denormal(mode) → bool
示例:
>>> torch.set_flush_denormal(True)
True
>>> torch.tensor([1e-323], dtype=torch.float64)
tensor([ 0.], dtype=torch.float64)
>>> torch.set_flush_denormal(False)
True
>>> torch.tensor([1e-323], dtype=torch.float64)
tensor(9.88131e-324 *
[ 1.0000], dtype=torch.float64)