MCPcopy Index your code
hub / github.com/YunwenTechnology/QueryGeneration / attention_layer

Function attention_layer

train/modeling.py:131–209  ·  view source on GitHub ↗

:param x_flat: Tensor input, should be [batch_size*seq_length, dim] :param attention_mask: Attention mask to use of size [seq_length, seq_length+cached_length] :param size_per_head: dim = size_per_head * num_attention_heads :param num_attention_heads: dim = size_per_head * num_att

(x_flat, attention_mask, batch_size, seq_length, size_per_head=512, num_attention_heads=1, *,
                    cache=None,
                    initializer_range=0.02, hidden_dropout_prob=0.1,
                    attention_probs_dropout_prob=0.1, do_cache=False)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 1

__init__Method · 0.85

Calls 5

get_shape_listFunction · 0.90
dropoutFunction · 0.90
mask_attention_for_ltrFunction · 0.85
create_initializerFunction · 0.85

Tested by

no test coverage detected