Document feedback

Question document fragment

When a question document fragment contains a formula, it is displayed as a space.

Submission type
issue

It's a little complicated...

I'd like to ask someone.

PR

Just a small problem.

I can fix it online!

Please select the submission type

Problem type
Specifications and Common Mistakes

- Specifications and Common Mistakes:

- Misspellings or punctuation mistakes,incorrect formulas, abnormal display.

- Incorrect links, empty cells, or wrong formats.

- Chinese characters in English context.

- Minor inconsistencies between the UI and descriptions.

- Low writing fluency that does not affect understanding.

- Incorrect version numbers, including software package names and version numbers on the UI.

Usability

- Usability:

- Incorrect or missing key steps.

- Missing main function descriptions, keyword explanation, necessary prerequisites, or precautions.

- Ambiguous descriptions, unclear reference, or contradictory context.

- Unclear logic, such as missing classifications, items, and steps.

Correctness

- Correctness:

- Technical principles, function descriptions, supported platforms, parameter types, or exceptions inconsistent with that of software implementation.

- Incorrect schematic or architecture diagrams.

- Incorrect commands or command parameters.

- Incorrect code.

- Commands inconsistent with the functions.

- Wrong screenshots.

- Sample code running error, or running results inconsistent with the expectation.

Risk Warnings

- Risk Warnings:

- Lack of risk warnings for operations that may damage the system or important data.

Content Compliance

- Content Compliance:

- Contents that may violate applicable laws and regulations or geo-cultural context-sensitive words and expressions.

- Copyright infringement.

Please select the type of question

Problem description

Describe the bug so that we can quickly locate the problem.

mindspore.ops.vecdot

View Source On Gitee
mindspore.ops.vecdot(x, y, *, axis=- 1)[source]

Calculates the dot product of two batches of vectors across the specified dimension.

The formula of calculation is as follows. xi¯ represents the conjugate for complex vectors, and xi¯ is the raw value for real vectors.

i=1nxi¯yi

Warning

This is an experimental API that is subject to change or deletion.

Parameters
  • x (Tensor) – First batch of vectors. The shape of Tensor is (,N) where means, any number of additional dimensions. Supporting broadcasting. The dtype of Tensor should be one of the following types: float, double, int, complex64 and complex128.

  • y (Tensor) – Second batch of vectors. The shape of Tensor is (,N) where means, any number of additional dimensions. Supporting broadcasting. The dtype of Tensor should be one of the following types: float, double, int, complex64 and complex128.

  • axis (int) – Dimension across which to calculate the dot product. Default: -1 .

Returns

Tensor, the shape is almost same as the shape of Tensor after broadcasting, while the specified dimension axis in shape has been removed.

Raises
Supported Platforms:

Ascend GPU CPU

Note

Currently, complex numbers are not supported on GPU.

Examples

>>> import mindspore as ms
>>> from mindspore import ops
>>> x = ms.Tensor([[1, 3], [5, 7], [9, 8]], dtype=ms.float32)
>>> y = ms.Tensor([[4, 5], [6, 7], [3, 2]], dtype=ms.float32)
>>> output = ops.vecdot(x, y, axis=-1)
>>> print(output)
[19. 79. 43.]