#include <math_ops.h>
Multiplies slices of two tensors in batches.
Multiplies all slices of Tensor
x
and y
(each slice can be viewed as an element of a batch), and arranges the individual results in a single output tensor of the same batch size. Each of the individual slices can optionally be adjointed (to adjoint a matrix means to transpose and conjugate it) before multiplication by setting the adj_x
or adj_y
flag to True
, which are by default False
.
The input tensors x
and y
are 2-D or higher with shape [..., r_x, c_x]
and [..., r_y, c_y]
.
The output tensor is 2-D or higher with shape [..., r_o, c_o]
, where:
r_o = c_x if adj_x else r_x c_o = r_y if adj_y else c_y
It is computed as:
output[..., :, :] = matrix(x[..., :, :]) * matrix(y[..., :, :])
NOTE: BatchMatMulV2
supports broadcasting in the batch dimensions. More about broadcasting here.
Arguments:
[..., r_x, c_x]
.[..., r_y, c_y]
.Optional attributes (see Attrs
):
True
, adjoint the slices of x
. Defaults to False
.True
, adjoint the slices of y
. Defaults to False
.Returns:
Output
: 3-D or higher with shape [..., r_o, c_o]
Constructors and Destructors | |
---|---|
BatchMatMulV2(const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input y) | |
BatchMatMulV2(const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input y, const BatchMatMulV2::Attrs & attrs) |
Public attributes | |
---|---|
operation | |
output |
Public functions | |
---|---|
node() const | ::tensorflow::Node * |
operator::tensorflow::Input() const | |
operator::tensorflow::Output() const |
Public static functions | |
---|---|
AdjX(bool x) | |
AdjY(bool x) |
Structs | |
---|---|
tensorflow::ops::BatchMatMulV2::Attrs | Optional attribute setters for BatchMatMulV2. |
Operation operation
::tensorflow::Output output
BatchMatMulV2( const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input y )
BatchMatMulV2( const ::tensorflow::Scope & scope, ::tensorflow::Input x, ::tensorflow::Input y, const BatchMatMulV2::Attrs & attrs )
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operator::tensorflow::Output() const
Attrs AdjX( bool x )
Attrs AdjY( bool x )
© 2020 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/versions/r2.3/api_docs/cc/class/tensorflow/ops/batch-mat-mul-v2