matmul.py 331 Bytes
Newer Older
rusty1s's avatar
rusty1s committed
1
2
3
4
5
6
7
8
9
10
11
import torch


def matmul(src, other, reduce='add'):
    if torch.is_tensor(other):
        pass
    if isinstance(other, src.__class__):
        if reduce != 'add':
            raise NotImplementedError(
                (f'Reduce argument "{reduce}" not implemented for sparse-'
                 f'sparse matrix multiplication'))