open3d.core.append#

open3d.core.append(self: open3d.cpu.pybind.core.Tensor, values: open3d.cpu.pybind.core.Tensor, axis: int | None = None) open3d.cpu.pybind.core.Tensor#

Appends the values tensor to the self tensor, along the given axis and returns a new tensor. Both 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 appended.

This is the same as NumPy’s semantics: - https://numpy.org/doc/stable/reference/generated/numpy.append.html

Returns:

A copy of the self tensor with values appended to axis. Note that append does not occur in-place: a new array is allocated and filled. If axis is null, out is a flattened tensor.

Example

>>> o3d.core.append([[0, 1], [2, 3]], [[4, 5]], axis = 0)
[[0 1],
 [2 3],
 [4 5]]
Tensor[shape={3, 2}, stride={2, 1}, Int64, CPU:0, 0x55555abc6b00]
>>> o3d.core.append([[0, 1], [2, 3]], [[4, 5]])
[0 1 2 3 4 5]
Tensor[shape={6}, stride={1}, Int64, CPU:0, 0x55555abc6b70]