diff --git a/python/paddle/tensor/math.py b/python/paddle/tensor/math.py index f5f0b5ed0873c1965d2bd6f000dd337177049323..f1b811c16b0e9e8071a629be58bb5cb285951b61 100755 --- a/python/paddle/tensor/math.py +++ b/python/paddle/tensor/math.py @@ -932,6 +932,37 @@ 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