diff --git a/tensorflow/python/keras/backend.py b/tensorflow/python/keras/backend.py index 7bab18084dd..b8ae91dff02 100644 --- a/tensorflow/python/keras/backend.py +++ b/tensorflow/python/keras/backend.py @@ -1817,6 +1817,8 @@ def moving_average_update(x, value, momentum): def dot(x, y): """Multiplies 2 tensors (and/or variables) and returns a tensor. + This operation corresponds to `numpy.dot(a, b, out=None)`. + Arguments: x: Tensor or variable. y: Tensor or variable. @@ -1826,6 +1828,7 @@ def dot(x, y): Examples: + If inputs `x` and `y` are 2-D arrays, then it is equivalent to `tf.matmul`. >>> x = tf.keras.backend.placeholder(shape=(2, 3)) >>> y = tf.keras.backend.placeholder(shape=(3, 4)) >>> xy = tf.keras.backend.dot(x, y) @@ -1838,6 +1841,8 @@ def dot(x, y): >>> xy + If `x` is an N-D array and `y` is an M-D array (where M>=2), it is a sum + product over the last axis of `x` and the second-to-last axis of `y`. >>> x = tf.keras.backend.random_uniform_variable(shape=(2, 3), low=0, high=1) >>> y = tf.keras.backend.ones((4, 3, 5)) >>> xy = tf.keras.backend.dot(x, y)