mindspore.mint.nn.Identity
- class mindspore.mint.nn.Identity(*args, **kwargs)[source]
A placeholder identity operator that returns the same as input.
- Parameters
args (Any) – Any argument.
kwargs (Any) – Any keyword argument.
- Inputs:
input (Any) - The input of Identity.
- Outputs:
The same as input.
- Supported Platforms:
Ascend
Examples
>>> import mindspore >>> from mindspore import Tensor, mint >>> import numpy as np >>> input = Tensor(np.array([1, 2, 3, 4]), mindspore.int64) >>> net = mint.nn.Identity() >>> output = net(input) >>> print(output) [1 2 3 4]