From c90a652d77c4149cb3f700c7840a45ea2f08804d Mon Sep 17 00:00:00 2001 From: wawltor Date: Wed, 5 Jan 2022 14:33:17 +0800 Subject: [PATCH] add the examples for the mm (#38669) * add the examples for the mm * fix the document of paddle.mm --- python/paddle/tensor/math.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/python/paddle/tensor/math.py b/python/paddle/tensor/math.py index 5f7e51598c..c4a92b1486 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 -- GitLab