def _need_reduce_last_dim(ufeat, efeat):
    """Indicates whether to reduce the last dimension on edges
    in the backward pass of spmm,
    if so, use dot instead of mul."""
    ushp = ufeat.shape
    eshp = efeat.shape
    return ushp[1:-1] == eshp[1:-1] and eshp[-1] == 1 and ushp[-1] > 1
Indicates whether to reduce the last dimension on edges
    in the backward pass of spmm,
    if so, use dot instead of mul.
python/dgl/backend/tensorflow/sparse.py