forward method

  1. @override
Tensor forward(
  1. Tensor input
)
override

The core logic of the layer's transformation.

Subclasses must implement this method to define how they process input tensors and return an output tensor.

Implementation

@override
Tensor<dynamic> forward(Tensor<dynamic> input) {
  Tensor<dynamic> currentOutput = input;
  for (Layer layer in layers) {
    currentOutput = layer.call(currentOutput);
  }
  return currentOutput;
}