jax.experimental.sparse.bcoo_dot_general#

jax.experimental.sparse.bcoo_dot_general(lhs, rhs, *, dimension_numbers, precision=None, preferred_element_type=None)[source]#

A general contraction operation.

Parameters
  • lhs (Union[BCOO, Array]) – An ndarray or BCOO-format sparse array.

  • rhs (Union[BCOO, Array]) – An ndarray or BCOO-format sparse array..

  • dimension_numbers (Tuple[Tuple[Sequence[int], Sequence[int]], Tuple[Sequence[int], Sequence[int]]]) – a tuple of tuples of the form ((lhs_contracting_dims, rhs_contracting_dims), (lhs_batch_dims, rhs_batch_dims)).

  • precision (None) – unused

  • preferred_element_type (None) – unused

Return type

Union[BCOO, Array]

Returns

An ndarray or BCOO-format sparse array containing the result. If both inputs are sparse, the result will be sparse, of type BCOO. If either input is dense, the result will be dense, of type ndarray.