Struct drug::nodes::Embedding

source ·
pub struct Embedding();
Expand description

Trainable embedding operation, given an index and a 2d-array of embedding vectors, index into the embedding vectors. FIXME drug hardcodes ArrayD<f32> inside the graph so the index should be a batch_size length arrayD<f32> where the values are integers.

Trait Implementations§

Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Mutates Outputs based on inputs. TODO consider modifying output ArrayD in place Read more
Returns gradients of inputs wrt outputs. Note the inputs and output vectors should be the same length. TODO consider modifying output ArrayDs in place Read more
Serialize this value into the given Serde serializer. 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.

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.