mindsponge.common.vecs_to_tensor

mindsponge.common.vecs_to_tensor(v)[source]

Converts ‘v’ to tensor with last dim shape 3, inverse of ‘vecs_from_tensor’.

Parameters

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

Returns

tensor, concat the tensor in last dims, shape \((..., 3)\) .

Supported Platforms:

Ascend GPU

Examples

>>> import numpy as np
>>> import mindspore as ms
>>> from mindspore import Tensor
>>> from mindsponge.common.geometry import vecs_to_tensor
>>> input_0 = Tensor(np.ones((4, 256)), ms.float32)
>>> input_1 = Tensor(np.ones((4, 256)), ms.float32)
>>> input_2 = Tensor(np.ones((4, 256)), ms.float32)
>>> inputs = (input_0, input_1, input_2)
>>> output = vecs_to_tensor(inputs)
>>> print(output.shape)
(4, 256, 3)