towhee.hub.builtin.operators.tensor_like.tensor_reshape¶
- class towhee.hub.builtin.operators.tensor_like.tensor_reshape(shape)[source]¶
Bases:
object
Reshape input tensor.
Examples:
>>> import numpy as np >>> from towhee import dc >>> df = dc['tensor']([np.array([i, j]) for i, j in zip(range(3), range(3))]) >>> df.tensor_reshape['tensor', 'new_tensor'](shape = [2, 1]).map(lambda x: x.new_tensor.shape).to_list() [(2, 1), (2, 1), (2, 1)]
>>> df.to_column() >>> df.tensor_reshape['tensor', 'new_new_tensor'](shape = [2, 1])['new_new_tensor'].map(lambda x: x.shape).to_list() [(2, 1), (2, 1), (2, 1)]
Methods
Attributes
metainfo
- __call__(*args, **kws)¶
Call self as a function.