official/projects/longformer/longformer_attention.py
File longformer_attention.py
has 815 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
# Copyright 2024 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
Function _compute_global_attn_output_from_hidden
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _compute_global_attn_output_from_hidden(
Function _concat_with_global_key_attn_probs
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _concat_with_global_key_attn_probs(
Function call
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def call(self,
Function _compute_attn_output_with_global_indices
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _compute_attn_output_with_global_indices(