From 327f635ef121cce1d16468d9b60fc89394ff6485 Mon Sep 17 00:00:00 2001 From: wawltor Date: Thu, 6 Jan 2022 16:42:06 +0800 Subject: [PATCH] add the examples for the mm (#38746) --- python/paddle/tensor/math.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/python/paddle/tensor/math.py b/python/paddle/tensor/math.py index f5f0b5ed087..f1b811c16b0 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 -- GitLab