diff --git a/python/paddle/tensor/math.py b/python/paddle/tensor/math.py index 5f7e51598cc4373fd28fde92260731f0941dfc05..c4a92b1486d587b2f2d5f484eca882c371a451a7 100755 --- a/python/paddle/tensor/math.py +++ b/python/paddle/tensor/math.py @@ -1118,6 +1118,38 @@ def mm(input, mat2, name=None): Returns: Tensor: The product Tensor. + :: + + * example 1: + + input: [B, ..., M, K], mat2: [B, ..., K, N] + out: [B, ..., M, N] + + * example 2: + + input: [B, M, K], mat2: [B, K, N] + out: [B, M, N] + + * example 3: + + input: [B, M, K], mat2: [K, N] + out: [B, M, N] + + * example 4: + + input: [M, K], mat2: [K, N] + out: [M, N] + + * example 5: + + input: [B, M, K], mat2: [K] + out: [B, M] + + * example 6: + + input: [K], mat2: [K] + out: [1] + Examples: .. code-block:: python