RSVP for your your local TensorFlow Everywhere event today!

Module

  • The input type of the layer.

    Declaration

    associatedtype Input
  • The output type of the layer.

    Declaration

    associatedtype Output : Differentiable
  • Returns the output obtained from applying the layer to the given input.

    Declaration

    @differentiable(wrt: self)
    func callAsFunction(_ input: Input) -> Output

    Parameters

    input

    The input to the layer.

    Return Value

    The output.

  • forward(_:)

    Default implementation

    Returns the output obtained from applying the layer to the given input.

    Default Implementation

    Returns the output obtained from applying the layer to the given input.

    Declaration

    @differentiable(wrt: self)
    func forward(_ input: Input) -> Output

    Parameters

    input

    The input to the layer.

    Return Value

    The output.

  • callAsFunction(_:)

    Default implementation

    Default Implementation

    Returns the annotated output obtained from applying the layer to the given input.

    Declaration

    @differentiable(wrt: self)
    public func callAsFunction(_ input: Input) -> Output

    Parameters

    input

    The input to the layer.

    Return Value

    The annotated output.

  • annotated(_:)

    Extension method

    Annotates output.

    Note: Returns output if using a backend that does not support annotations.

    Declaration

    @differentiable
    public func annotated(_ output: Output) -> Output

    Parameters

    output

    The output to the layer.

    Return Value

    The annotated output.

  • summary(input:)

    Extension method

    Returns the annotations obtained from applying the layer to the given input.

    Declaration

    public func summary(input: Input) -> String

    Parameters

    input

    The input to the layer.

    Return Value

    All collected annotations from the XLA graph.