ivy.neural_net_functional.layers.linear(x, weight, bias=None)[source]

Applies a linear transformation to the incoming data: y = x * t(weight) + bias. The operation also supports batching of the weight matrices. This is useful if a batch of different network parameters are to be represented.

  • x (array) – The input x compute linear transformation on. [outer_batch_shape,inner_batch_shape,in_features]

  • weight (array) – The weight matrix. [outer_batch_shape,out_features,in_features]

  • bias (array, optional) – The bias vector, default is None. [outer_batch_shape,out_features]


Result array of the linear transformation. [outer_batch_shape,inner_batch_shape,out_features]

Supported Frameworks:

empty jax_logo empty tf_logo empty pytorch_logo empty mxnet_logo empty numpy_logo empty