modelzoo.transformers.utils.attention_utils.StridedSparseAttentionBuilder#

class modelzoo.transformers.utils.attention_utils.StridedSparseAttentionBuilder[source]#

Bases: modelzoo.transformers.utils.attention_utils.SparseAttentionBuilder

Methods

build_mask

get_pytorch_mask

set_global_attention

set_local_attention

__init__(num_heads, max_sequence_length, local_attn_ctx=4, stride=2, attention_type='unidirectional')[source]#