tf.keras.backend.dot
Stay organized with collections
Save and categorize content based on your preferences.
Multiplies 2 tensors (and/or variables) and returns a tensor.
tf.keras.backend.dot(
x, y
)
Arguments |
x
|
Tensor or variable.
|
y
|
Tensor or variable.
|
Returns |
A tensor, dot product of x and y .
|
Examples:
x = tf.keras.backend.placeholder(shape=(2, 3))
y = tf.keras.backend.placeholder(shape=(3, 4))
xy = tf.keras.backend.dot(x, y)
xy
<tf.Tensor ... shape=(2, 4) dtype=float32>
x = tf.keras.backend.placeholder(shape=(32, 28, 3))
y = tf.keras.backend.placeholder(shape=(3, 4))
xy = tf.keras.backend.dot(x, y)
xy
<tf.Tensor ... shape=(32, 28, 4) dtype=float32>
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)
tf.keras.backend.int_shape(xy)
(2, 4, 5)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.keras.backend.dot\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 1 version](/versions/r1.15/api_docs/python/tf/keras/backend/dot) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.2.0/tensorflow/python/keras/backend.py#L1639-L1696) |\n\nMultiplies 2 tensors (and/or variables) and returns a tensor.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.keras.backend.dot`](/api_docs/python/tf/keras/backend/dot)\n\n\u003cbr /\u003e\n\n tf.keras.backend.dot(\n x, y\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Arguments --------- ||\n|-----|---------------------|\n| `x` | Tensor or variable. |\n| `y` | Tensor or variable. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A tensor, dot product of `x` and `y`. ||\n\n\u003cbr /\u003e\n\n#### Examples:\n\n x = tf.keras.backend.placeholder(shape=(2, 3))\n y = tf.keras.backend.placeholder(shape=(3, 4))\n xy = tf.keras.backend.dot(x, y)\n xy\n \u003ctf.Tensor ... shape=(2, 4) dtype=float32\u003e\n\n x = tf.keras.backend.placeholder(shape=(32, 28, 3))\n y = tf.keras.backend.placeholder(shape=(3, 4))\n xy = tf.keras.backend.dot(x, y)\n xy\n \u003ctf.Tensor ... shape=(32, 28, 4) dtype=float32\u003e\n\n x = tf.keras.backend.random_uniform_variable(shape=(2, 3), low=0, high=1)\n y = tf.keras.backend.ones((4, 3, 5))\n xy = tf.keras.backend.dot(x, y)\n tf.keras.backend.int_shape(xy)\n (2, 4, 5)"]]