Pytorch 核心方法

pytorch 核心方法

Tensors

  • torch.is_tensor(obj)
  • torch.is_storage(obj)
  • torch.numel(input)->int <=> a.numel()
  • torch.eye(n, m=None, out=None)
  • torch.from_numpy(ndarray) → Tensor
  • torch.linspace(start, end, steps=100, out=None) → Tensor
  • torch.logspace(start, end, steps=100, out=None) → Tensor
  • torch.ones(*sizes, out=None) → Tensor
  • torch.rand(*sizes, out=None)→Tensor 区间[0,1)
  • torch.randn(*sizes, out=None) → Tensor (正态分布)
  • torch.randperm(n, out=None) → LongTensor (0 到n -1 的随机整数排列。上边界(不包含))

你可能感兴趣的:(NLP,pytorch,深度学习,python)