Linear(input_channels, output_channels, dev_str='cpu', v=None)¶
__init__(input_channels, output_channels, dev_str='cpu', v=None)¶
Linear layer, also referred to as dense or fully connected. The layer receives tensors with input_channels last dimension and returns a new tensor with output_channels last dimension, following matrix multiplication with the weight matrix and addition with the bias vector.
input_channels (int) – Number of input channels for the layer.
output_channels (int) – Number of output channels for the layer.
dev_str (str, optional) – device on which to create the layer’s variables ‘cuda:0’, ‘cuda:1’, ‘cpu’ etc. Default is cpu.
v (ivy container of variables, optional) – the variables for each of the linear layer, as a container, constructed internally by default.