


torch.diagflat(a, 1)
      tensor([[ 0.0000, -0.2956,  0.0000,  0.0000],
              [ 0.0000,  0.0000, -0.9068,  0.0000],
              [ 0.0000,  0.0000,  0.0000,  0.1695],
              [ 0.0000,  0.0000,  0.0000,  0.0000]])



  >>> a = torch.randn(2, 2)
  >>> a
  tensor([[ 0.2094, -0.3018],
          [-0.1516,  1.9342]])
  >>> torch.diagflat(a)
  tensor([[ 0.2094,  0.0000,  0.0000,  0.0000],
          [ 0.0000, -0.3018,  0.0000,  0.0000],
          [ 0.0000,  0.0000, -0.1516,  0.0000],
          [ 0.0000,  0.0000,  0.0000,  1.9342]])
