mindspore.dataset.transforms.c_transforms.Duplicate

class mindspore.dataset.transforms.c_transforms.Duplicate[source]

Duplicate the input tensor to a new output tensor. The input tensor is carried over to the output list.

Examples

>>> import mindspore.dataset.transforms.c_transforms as c_transforms
>>>
>>> # Data before
>>> # |  x      |
>>> # +---------+
>>> # | [1,2,3] |
>>> # +---------+
>>> data1 = data1.map(operations=c_transforms.Duplicate(), input_columns=["x"],
>>>         output_columns=["x", "y"], column_order=["x", "y"])
>>> # Data after
>>> # |  x      |  y      |
>>> # +---------+---------+
>>> # | [1,2,3] | [1,2,3] |
>>> # +---------+---------+