towhee.hub.builtin.operators.tensor_like.tensor_concat¶
- class towhee.hub.builtin.operators.tensor_like.tensor_concat(axis=0)[source]¶
Bases:
object
Concat the sequence of inputs along a axis (no new axis)
- Parameters:
axis (int, optional) – the axis alone which to concat inputs. Defaults to 0.
- Returns:
the stacked array.
- Return type:
ndarray
Examples:
>>> import numpy as np >>> from towhee.functional import DataCollection >>> dc = ( ... DataCollection.range(10) ... .map(lambda x: np.array([x])) ... .batch(2) ... .tensor_concat(axis=0) ... ) >>> dc.to_list() [array([0, 1]), array([2, 3]), array([4, 5]), array([6, 7]), array([8, 9])]
Methods
Attributes
metainfo
- __call__(*args, **kws)¶
Call self as a function.