dgl.sparse.div¶
-
dgl.sparse.
div
(A: Union[dgl.sparse.sparse_matrix.SparseMatrix, dgl.sparse.diag_matrix.DiagMatrix], B: Union[dgl.sparse.diag_matrix.DiagMatrix, numbers.Number, torch.Tensor]) → Union[dgl.sparse.sparse_matrix.SparseMatrix, dgl.sparse.diag_matrix.DiagMatrix][source]¶ Elementwise division for
DiagMatrix
andSparseMatrix
, equivalent toA / B
.The supported combinations are shown as follows.
A \ B
DiagMatrix
SparseMatrix
scalar
DiagMatrix
✅
🚫
✅
SparseMatrix
🚫
🚫
✅
scalar
🚫
🚫
🚫
- Parameters
A (SparseMatrix or DiagMatrix) – Sparse or diagonal matrix
B (DiagMatrix or Scalar) – Diagonal matrix or scalar value
- Returns
Diagonal matrix
- Return type
Examples