Source code for cvnets.layers.identity

#
# For licensing see accompanying LICENSE file.
# Copyright (C) 2023 Apple Inc. All Rights Reserved.
#

from torch import Tensor

from cvnets.layers.base_layer import BaseLayer


[docs]class Identity(BaseLayer): """ This is a place-holder and returns the same tensor. """
[docs] def __init__(self): super(Identity, self).__init__()
[docs] def forward(self, x: Tensor) -> Tensor: return x