From 70d66e007bf8e6a184986c7890fba600ebe0419a Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Mon, 18 Apr 2022 15:56:38 -0600 Subject: [PATCH 1/2] Fix tensordot broadcasting rules The noncontracted axes do not broadcast together and do not need to be broadcast compatible. --- spec/API_specification/signatures/linear_algebra_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/API_specification/signatures/linear_algebra_functions.py b/spec/API_specification/signatures/linear_algebra_functions.py index d32245673..8b7c292e2 100644 --- a/spec/API_specification/signatures/linear_algebra_functions.py +++ b/spec/API_specification/signatures/linear_algebra_functions.py @@ -61,7 +61,7 @@ def tensordot(x1: array, x2: array, /, *, axes: Union[int, Tuple[Sequence[int], x1: array first input array. Should have a numeric data type. x2: array - second input array. Must be compatible with ``x1`` for all non-contracted axes (see :ref:`broadcasting`). Should have a numeric data type. + second input array. Should have a numeric data type. Corresponding contracted axes of ``x1`` and ``x2`` should be equal. .. note:: Contracted axes (dimensions) must not be broadcasted. From 2a181ff9cadafe0187987da02a1f12728bbf7038 Mon Sep 17 00:00:00 2001 From: Aaron Meurer Date: Mon, 18 Apr 2022 18:24:03 -0600 Subject: [PATCH 2/2] Replace a "should" with "must" --- spec/API_specification/signatures/linear_algebra_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/API_specification/signatures/linear_algebra_functions.py b/spec/API_specification/signatures/linear_algebra_functions.py index 8b7c292e2..30d09c254 100644 --- a/spec/API_specification/signatures/linear_algebra_functions.py +++ b/spec/API_specification/signatures/linear_algebra_functions.py @@ -61,7 +61,7 @@ def tensordot(x1: array, x2: array, /, *, axes: Union[int, Tuple[Sequence[int], x1: array first input array. Should have a numeric data type. x2: array - second input array. Should have a numeric data type. Corresponding contracted axes of ``x1`` and ``x2`` should be equal. + second input array. Should have a numeric data type. Corresponding contracted axes of ``x1`` and ``x2`` must be equal. .. note:: Contracted axes (dimensions) must not be broadcasted.