mindsponge.common.vecs_from_tensor

View Source On Gitee
mindsponge.common.vecs_from_tensor(inputs)[source]

Get vectors from the last axis of input tensor.

Parameters

inputs (Tensor) – Atom position information. Shape is \((..., 3)\).

Returns

tuple \((x, y, z)\) with three tensors, including the coordinate information of x, y and z.

Supported Platforms:

Ascend GPU

Examples

>>> import numpy as np
>>> import mindspore as ms
>>> from mindspore import Tensor
>>> from mindsponge.common.geometry import vecs_from_tensor
>>> input_0 = Tensor(np.ones((4, 256, 3)), ms.float32)
>>> output = vecs_from_tensor(input_0)
>>> print(len(output), output[0].shape)
3, (4,256)