Skip to content

Commit 0ecb55d

Browse files
Add the description that 0 should not in the arg axes in keras.layers.dot() (#21718)
* Add the description that `0` should not in the arg `axes` in `keras.layers.dot()` * Update keras/src/layers/merging/dot.py Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Update dot.py to fix the doc of `Dot` and `batch_dot` --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent ce51d74 commit 0ecb55d

File tree

1 file changed

+4
-1
lines changed
  • keras/src/layers/merging

1 file changed

+4
-1
lines changed

keras/src/layers/merging/dot.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def batch_dot(x, y, axes=None):
4141
axes: Tuple or list of integers with target dimensions, or single
4242
integer. The sizes of `x.shape[axes[0]]` and `y.shape[axes[1]]`
4343
should be equal.
44+
Note that axis `0` (the batch axis) cannot be included.
4445
4546
Returns:
4647
A tensor with shape equal to the concatenation of `x`'s shape
@@ -226,7 +227,8 @@ class Dot(Merge):
226227
take the dot product. If a tuple, should be two integers
227228
corresponding to the desired axis from the first input and the
228229
desired axis from the second input, respectively. Note that the
229-
size of the two selected axes must match.
230+
size of the two selected axes must match, and that
231+
axis `0` (the batch axis) cannot be included.
230232
normalize: Whether to L2-normalize samples along the dot product axis
231233
before taking the dot product. If set to `True`, then
232234
the output of the dot product is the cosine proximity
@@ -363,6 +365,7 @@ def dot(inputs, axes=-1, **kwargs):
363365
inputs: A list of input tensors (at least 2).
364366
axes: Integer or tuple of integers,
365367
axis or axes along which to take the dot product.
368+
Note that axis `0` (the batch axis) cannot be included.
366369
normalize: Whether to L2-normalize samples along the
367370
dot product axis before taking the dot product.
368371
If set to `True`, then the output of the dot product

0 commit comments

Comments
 (0)