Rate this Page

Identity#

class torch.nn.modules.linear.Identity(*args, **kwargs)[source]#

A placeholder identity operator that is argument-insensitive.

Parameters
  • args (Any) – any argument (unused)

  • kwargs (Any) – any keyword argument (unused)

Shape:
  • Input: (), where means any number of dimensions.

  • Output: (), same shape as the input.

Examples:

>>> m = nn.Identity(54, unused_argument1=0.1, unused_argument2=False)
>>> input = torch.randn(128, 20)
>>> output = m(input)
>>> print(output.size())
torch.Size([128, 20])
forward(input)[source]#

Runs the forward pass.

Return type

Tensor

Docs

Access comprehensive developer documentation for PyTorch

View Docs

Tutorials

Get in-depth tutorials for beginners and advanced developers

View Tutorials

Resources

Find development resources and get your questions answered

View Resources
Morty Proxy This is a proxified and sanitized view of the page, visit original site.