📜  火炬打印全张量 - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:34.395000             🧑  作者: Mango

代码示例2
In [18]: torch.set_printoptions(edgeitems=1)

In [19]: a
Out[19]:
tensor([[-0.7698,  ..., -0.1949],
        ...,
        [-0.7321,  ...,  0.8537]])

In [20]: torch.set_printoptions(edgeitems=3)

In [21]: a
Out[21]:
tensor([[-0.7698,  1.3383,  0.5649,  ...,  1.3567,  0.6896, -0.1949],
        [-0.5761, -0.9789, -0.2058,  ..., -0.5843,  2.6311, -0.0008],
        [ 1.3152,  1.8851, -0.9761,  ...,  0.8639, -0.6237,  0.5646],
        ...,
        [ 0.2851,  0.5504, -0.9471,  ...,  0.0688, -0.7777,  0.1661],
        [ 2.9616, -0.8685, -1.5467,  ..., -1.4646,  1.1098, -1.0873],
        [-0.7321,  0.7610,  0.3182,  ...,  2.5859, -0.9709,  0.8537]])