Loading...
Searching...
No Matches
multihead_attention_layer.h
Go to the documentation of this file.
Definition json.h:92
Definition json.h:24
Layer(LayerType type, Trainability trainability=Trainability::Trainable)
Definition layer.h:210
Index get_head_dimension() const noexcept
Definition multihead_attention_layer.h:34
void set(Index=0, Index=0, Index=0, Index=0, CausalMask=CausalMask::No, const string &="multihead_attention_layer")
Index get_source_sequence_length() const noexcept
Definition multihead_attention_layer.h:31
void set_sdpa_min_sequence_length(Index)
void set_zero_padded_queries(bool new_zero_padded_queries)
void on_compute_dtype_changed() override
vector< TensorSpec > get_backward_specs(Index) const override
void apply_sdpa_choice()
ForwardSlotKind get_forward_slot_kind(size_t slot) const override
Definition multihead_attention_layer.h:42
vector< TensorSpec > get_forward_specs(Index) const override
void set_sdpa_auto(bool new_sdpa_auto)
static const Index default_sdpa_min_sequence_length
Definition multihead_attention_layer.h:82
bool should_use_sdpa() const
Shape get_output_shape() const override
Definition multihead_attention_layer.h:28
void apply_input_shape(const Shape &) override
bool accepts_input_rank(Index rank) const override
Definition multihead_attention_layer.h:67
Index get_query_sequence_length() const noexcept
Definition multihead_attention_layer.h:30
Index get_sources_number() const noexcept override
Definition multihead_attention_layer.h:38
bool backward_uses_forward_output() const noexcept override
Definition multihead_attention_layer.h:53
void read_JSON_body(const Json *) override
Index get_heads_number() const noexcept
Definition multihead_attention_layer.h:33
bool preserves_output_delta_during_backward() const noexcept override
Definition multihead_attention_layer.h:54
MultiHeadAttention(const Shape &, const Shape &, Index=0, const string &={})
bool folds_input_delta_addend(size_t input) const noexcept override
Definition multihead_attention_layer.h:55
Shape get_input_shape() const noexcept override
void set_dropout_rate(float new_dropout_rate)
Definition multihead_attention_layer.h:72
MultiHeadAttention(const Shape &=Shape({0, 0}), Index=0, const string &={})
void write_JSON_body(JsonWriter &) const override
Index get_embedding_dimension() const noexcept
Definition multihead_attention_layer.h:32
Definition configuration.h:10
constexpr bool is_one_of(const T &value, const Candidates &... candidates)
Definition opennn_types.h:273
Definition attention_operator.h:15
Definition combination_operator.h:12
Definition multihead_projection_operator.h:16
Definition tensor_types.h:172