megengine.functional.nn.linear#

linear(inp, weight, bias=None, compute_mode='default')[source]#

Applies a linear transformation to the input tensor.

Refer to Linear for more information.

Parameters:
  • inp (Tensor) – input tensor with shape (N, in_features).

  • weight (Tensor) – weight with shape (out_features, in_features).

  • bias (Optional[Tensor]) – bias with shape (out_features,). Default: None

Return type:

Tensor