def bmm(x, y, name=None):
    '\n    Applies batched matrix multiplication to two tensors.\n\n    Both of the two input tensors must be three-dementional and share the same batch size.\n\n    if x is a (b, m, k) tensor, y is a (b, k, n) tensor, the output will be a (b, m, n) tensor.\n\n    Args:\n        x (Tensor): The input Tensor.\n        y (Tensor): The input Tensor.\n        name(str|None): A name for this layer(optional). If set None, the layer\n            will be named automatically.\n\n    Returns:\n        Tensor: The product Tensor.\n\n    Examples:\n        .. code-block:: python\n\n            import paddle\n\n            # In imperative mode:\n            # size x: (2, 2, 3) and y: (2, 3, 2)\n            x = paddle.to_tensor([[[1.0, 1.0, 1.0],\n                                [2.0, 2.0, 2.0]],\n                                [[3.0, 3.0, 3.0],\n                                [4.0, 4.0, 4.0]]])\n            y = paddle.to_tensor([[[1.0, 1.0],[2.0, 2.0],[3.0, 3.0]],\n                                [[4.0, 4.0],[5.0, 5.0],[6.0, 6.0]]])\n            out = paddle.bmm(x, y)\n            #output size: (2, 2, 2)\n            #output value:\n            #[[[6.0, 6.0],[12.0, 12.0]],[[45.0, 45.0],[60.0, 60.0]]]\n            out_np = out.numpy()\n\n    '
    x_shape = x.shape
    y_shape = y.shape
    if (not (len(x_shape) == len(y_shape) == 3)):
        raise ValueError("x and y should be 3-dimensional. But received x's dimention: {}, y's dimention: {}".format(x_shape, y_shape))
    if (x_shape[2] != y_shape[1]):
        raise ValueError("x's width must be equal with y's height. But received x's shape: {}, y's shape: {}".format(x_shape, y_shape))
    if (x_shape[0] != y_shape[0]):
        raise ValueError("x's batch (shape[0]) must be equal with y's batch (shape[0]). But received x's shape: {}, y's shape: {}".format(x_shape, y_shape))
    if paddle.in_dynamic_mode():
        return _C_ops.bmm(x, y)
    helper = LayerHelper('bmm', **locals())
    out = helper.create_variable_for_type_inference(dtype=x.dtype)
    helper.append_op(type='bmm', inputs={'X': x, 'Y': y}, outputs={'Out': out})
    return out
Applies batched matrix multiplication to two tensors.

Both of the two input tensors must be three-dementional and share the same batch size.

if x is a (b, m, k) tensor, y is a (b, k, n) tensor, the output will be a (b, m, n) tensor.

Args:
    x (Tensor): The input Tensor.
    y (Tensor): The input Tensor.
    name(str|None): A name for this layer(optional). If set None, the layer
        will be named automatically.

Returns:
    Tensor: The product Tensor.

Examples:
    .. code-block:: python

        import paddle

        # In imperative mode:
        # size x: (2, 2, 3) and y: (2, 3, 2)
        x = paddle.to_tensor([[[1.0, 1.0, 1.0],
                            [2.0, 2.0, 2.0]],
                            [[3.0, 3.0, 3.0],
                            [4.0, 4.0, 4.0]]])
        y = paddle.to_tensor([[[1.0, 1.0],[2.0, 2.0],[3.0, 3.0]],
                            [[4.0, 4.0],[5.0, 5.0],[6.0, 6.0]]])
        out = paddle.bmm(x, y)
        #output size: (2, 2, 2)
        #output value:
        #[[[6.0, 6.0],[12.0, 12.0]],[[45.0, 45.0],[60.0, 60.0]]]
        out_np = out.numpy()
def bmm(x, y, name=None):
    '\n    Applies batched matrix multiplication to two tensors.\n\n    Both of the two input tensors must be three-dementional and share the same batch size.\n\n    if x is a (b, m, k) tensor, y is a (b, k, n) tensor, the output will be a (b, m, n) tensor.\n\n    Args:\n        x (Tensor): The input Tensor.\n        y (Tensor): The input Tensor.\n        name(str|None): A name for this layer(optional). If set None, the layer\n            will be named automatically.\n\n    Returns:\n        Tensor: The product Tensor.\n\n    Examples:\n        .. code-block:: python\n\n            import paddle\n\n            # In imperative mode:\n            # size x: (2, 2, 3) and y: (2, 3, 2)\n            x = paddle.to_tensor([[[1.0, 1.0, 1.0],\n                                [2.0, 2.0, 2.0]],\n                                [[3.0, 3.0, 3.0],\n                                [4.0, 4.0, 4.0]]])\n            y = paddle.to_tensor([[[1.0, 1.0],[2.0, 2.0],[3.0, 3.0]],\n                                [[4.0, 4.0],[5.0, 5.0],[6.0, 6.0]]])\n            out = paddle.bmm(x, y)\n            #output size: (2, 2, 2)\n            #output value:\n            #[[[6.0, 6.0],[12.0, 12.0]],[[45.0, 45.0],[60.0, 60.0]]]\n            out_np = out.numpy()\n\n    '
    x_shape = x.shape
    y_shape = y.shape
    if (not (len(x_shape) == len(y_shape) == 3)):
        raise ValueError("x and y should be 3-dimensional. But received x's dimention: {}, y's dimention: {}".format(x_shape, y_shape))
    if (x_shape[2] != y_shape[1]):
        raise ValueError("x's width must be equal with y's height. But received x's shape: {}, y's shape: {}".format(x_shape, y_shape))
    if (x_shape[0] != y_shape[0]):
        raise ValueError("x's batch (shape[0]) must be equal with y's batch (shape[0]). But received x's shape: {}, y's shape: {}".format(x_shape, y_shape))
    if paddle.in_dynamic_mode():
        return _C_ops.bmm(x, y)
    helper = LayerHelper('bmm', **locals())
    out = helper.create_variable_for_type_inference(dtype=x.dtype)
    helper.append_op(type='bmm', inputs={'X': x, 'Y': y}, outputs={'Out': out})
    return out