pub enum LayerOutput {
    Embedding(Tensor),
    EncoderWithAttention(HiddenLayer),
}
Expand description

Output of a BERT layer.

Variants§

§

Embedding(Tensor)

Embedding layer output.

§

EncoderWithAttention(HiddenLayer)

Encoder layer output.

Implementations§

Get the layer attention.

Return a Some value if the layer output is from an encoder layer, or None otherwise.

Get the embedding.

Returns Some if the layer output is an embedding or None otherwise.

Map the output representation of this layer.

Get the layer output.

Get the layer output mutably.

Get the output of an encoder layer.

Return a Some value if the layer output is from an encoder layer, or None otherwise.

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.