20 [](
const std::vector<Tensor>& tensors,
23 return core::Concatenate(tensors, axis);
27 R
"(Concatenates the list of tensors in their order, along the given
28 axis into a new tensor. All the tensors must have same data-type, device, and
29 number of dimensions. All dimensions must be the same, except the dimension
30 along the axis the tensors are to be concatenated.
31 Using Concatenate for a single tensor, the tensor is split along its first
32 dimension (length), and concatenated along the axis.
34 This is the same as NumPy's semantics:
35 - https://numpy.org/doc/stable/reference/generated/numpy.concatenate.html
38 A new tensor with the values of list of tensors concatenated in order,
42 >>> a = o3d.core.Tensor([[0, 1], [2, 3]])
43 >>> b = o3d.core.Tensor([[4, 5]])
44 >>> c = o3d.core.Tensor([[6, 7])
45 >>> o3d.core.concatenate((a, b, c), 0)
51 Tensor[shape={5, 2}, stride={2, 1}, Int64, CPU:0, 0x55b454b09390])",
52 "tensors"_a,
"axis"_a = 0);
59 return core::Append(self, values, axis);
63 R
"(Appends the `values` tensor to the `self` tensor, along the
64 given axis and returns a new tensor. Both the tensors must have same data-type
65 device, and number of dimensions. All dimensions must be the same, except the
66 dimension along the axis the tensors are to be appended.
68 This is the same as NumPy's semantics:
69 - https://numpy.org/doc/stable/reference/generated/numpy.append.html
72 A copy of the `self` tensor with `values` appended to axis. Note that
73 append does not occur in-place: a new array is allocated and filled.
74 If axis is null, out is a flattened tensor.
77 >>> o3d.core.append([[0, 1], [2, 3]], [[4, 5]], axis = 0)
81 Tensor[shape={3, 2}, stride={2, 1}, Int64, CPU:0, 0x55555abc6b00]
83 >>> o3d.core.append([[0, 1], [2, 3]], [[4, 5]])
85 Tensor[shape={6}, stride={1}, Int64, CPU:0, 0x55555abc6b70])",
86 "self"_a,
"values"_a,
"axis"_a = py::none());
89 R
"(Computes the element-wise maximum of input and other. The tensors
90 must have same data type and device.
91 If input.GetShape() != other.GetShape(), then they will be broadcasted to a
92 common shape (which becomes the shape of the output).)",
93 "input"_a,
"other"_a);
95 R
"(Computes the element-wise minimum of input and other. The tensors
96 must have same data type and device.
97 If input.GetShape() != other.GetShape(), then they will be broadcasted to a
98 common shape (which becomes the shape of the output).)",
99 "input"_a,
"other"_a);
constexpr bool has_value() const noexcept
void pybind_core_tensor_function(py::module &m)
Tensor Concatenate(const std::vector< Tensor > &tensors, const utility::optional< int64_t > &axis)
Concatenates the list of tensors in their order, along the given axis into a new tensor....
Tensor Append(const Tensor &self, const Tensor &other, const utility::optional< int64_t > &axis)
Appends the two tensors, along the given axis into a new tensor. Both the tensors must have same data...
Tensor Minimum(const Tensor &input, const Tensor &other)
Computes the element-wise minimum of input and other. The tensors must have same data type and device...
Tensor Maximum(const Tensor &input, const Tensor &other)
Computes the element-wise maximum of input and other. The tensors must have same data type and device...
Generic file read and write utility for python interface.