公众号【计算机视觉联盟】后台回复【PyTorch】可以获得独家PyTorch学习教程pdf版

举例子说明torch.full()使用方法:

    t = torch.full((3,3),10)
    print("torch.full((3,3),10)的输出结果\n",t)

运行结果呢:

torch.full((3,3),10)的输出结果
 tensor([[10., 10., 10.],
        [10., 10., 10.],
        [10., 10., 10.]])

推荐阅读:

PyTorch | torch.from_numpy使用方法

PyTorch | torch.randperm()使用方法

PyTorch | torch.tensor使用方法

PyTorch | torch.zeros()使用方法

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐