eye_

class paddle.nn.init. eye_ ( tensor ) [源代码]

将二维输入张量的值设置为单位矩阵,该操作会直接修改输入张量。

参数

  • tensor (Tensor) - 输入张量。