add new api paddle.Tensor.fill_diagonal_#34460
add new api paddle.Tensor.fill_diagonal_#34460jeff41404 merged 1 commit intoPaddlePaddle:developfrom zhiboniu:develop_fill_diagonal_
Conversation
|
Thanks for your contribution! |
There was a problem hiding this comment.
“the clipped tensor”的说明在这里有什么特殊意义不,是否去掉?
There was a problem hiding this comment.
常规做法是先 out->mutable_data 分配内存后再使用 TensorCopy,这里反过来是否有特殊考虑
There was a problem hiding this comment.
done, TensorCopy中也有out->mutable_data,所以其实都可以。不过也已经修改。
There was a problem hiding this comment.
常规做法是先 out->mutable_data 分配内存后再使用 TensorCopy,这里反过来是否有特殊考虑
There was a problem hiding this comment.
反向的逻辑中是否也可以使用TensorCopy 批量实现数据cp
There was a problem hiding this comment.
反向的逻辑中是否也可以使用TensorCopy 批量实现数据cp
There was a problem hiding this comment.
以float类型读取python数值,然后填入时转化为实际类型填入。
There was a problem hiding this comment.
Kernel注册了Bool类型,也加上bool类型的测试
python/paddle/tensor/manipulation.py
Outdated
a7376d0
PR types
Others
PR changes
APIs
Describe
补充缺失API,新增 api paddle.Tensor.fill_diagonal_
功能:实现对Tensor对角线向量值的修改。
使用示例:
x = paddle.ones((3,3))
x.fill_diagonal_(5)
tensor([[5., 1., 1.],
[1., 5., 1.],
[1., 1., 5.]])