Loading...
Searching...
No Matches
embedding_layer.h
Go to the documentation of this file.
55 void set_add_positional_encoding(bool enabled) { embedding_lookup.add_positional_encoding = enabled; }
66 void set_weights_follow_compute_dtype(bool enabled) { embedding_lookup.weights_follow_compute_dtype = enabled; }
69 void on_compute_dtype_changed() override { embedding_lookup.compute_dtype = get_compute_dtype(); }
void set_scale_embedding(bool enabled)
Definition embedding_layer.h:54
bool allows_bf16_input_cast(size_t) const noexcept override
Definition embedding_layer.h:22
void set_output_shape(const Shape &shape) override
Definition embedding_layer.h:30
bool accepts_input_rank(Index rank) const override
Definition embedding_layer.h:21
void read_JSON_body(const Json *) override
Embedding(const Shape &={0, 0}, Index=0, const string &="embedding_layer")
void on_compute_dtype_changed() override
Definition embedding_layer.h:69
Index get_sequence_length() const
Definition embedding_layer.h:37
ForwardSlotKind get_forward_slot_kind(size_t slot) const override
Definition embedding_layer.h:42
void set(Index=0, Index=0, Index=0, const string &="embedding_layer")
vector< TensorSpec > get_forward_specs(Index) const override
void set_export_valid_lengths(bool enabled)
Definition embedding_layer.h:64
bool get_learned_positional() const
Definition embedding_layer.h:62
void set_add_positional_encoding(bool enabled)
Definition embedding_layer.h:55
vector< TensorSpec > get_backward_specs(Index) const override
Definition embedding_layer.h:41
Shape get_input_shape() const noexcept override
Definition embedding_layer.h:24
bool get_export_valid_lengths() const
Definition embedding_layer.h:65
void set_learned_positional(bool enabled)
Definition embedding_layer.h:57
void set_weights_follow_compute_dtype(bool enabled)
Definition embedding_layer.h:66
Index get_vocabulary_size() const
Definition embedding_layer.h:36
Index get_embedding_dimension() const
Definition embedding_layer.h:38
void apply_input_shape(const Shape &new_input_shape) override
Definition embedding_layer.h:26
Shape get_output_shape() const override
void write_JSON_body(JsonWriter &) const override
Definition json.h:92
Definition json.h:24
Layer(LayerType type, Trainability trainability=Trainability::Trainable)
Definition layer.h:210
Definition configuration.h:10
constexpr bool is_one_of(const T &value, const Candidates &... candidates)
Definition opennn_types.h:273
Definition dropout_operator.h:15
Definition embedding_lookup_operator.h:23
Definition tensor_types.h:172