open3d.core.concatenate#
- open3d.core.concatenate(tensors: List[open3d.cpu.pybind.core.Tensor], axis: int | None = 0) open3d.cpu.pybind.core.Tensor #
Concatenates the list of tensors in their order, along the given axis into a new tensor. All the tensors must have same data-type, device, and number of dimensions. All dimensions must be the same, except the dimension along the axis the tensors are to be concatenated. Using Concatenate for a single tensor, the tensor is split along its first dimension (length), and concatenated along the axis.
This is the same as NumPy’s semantics: - https://numpy.org/doc/stable/reference/generated/numpy.concatenate.html
- Returns:
A new tensor with the values of list of tensors concatenated in order, along the given axis.
Example
>>> a = o3d.core.Tensor([[0, 1], [2, 3]]) >>> b = o3d.core.Tensor([[4, 5]]) >>> c = o3d.core.Tensor([[6, 7]) >>> o3d.core.concatenate((a, b, c), 0) [[0 1], [2 3], [4 5], [6 7], [8 9]] Tensor[shape={5, 2}, stride={2, 1}, Int64, CPU:0, 0x55b454b09390]