code: def attention_reference(
      q_input: torch.Tensor,  # [*, Dim_Q, H, C_hid]
      k_input: torch.Tensor,  # [*, Dim_Q, H, C_hid]
      v_input: torch.Tensor,  # [*, Dim_Q, H, C_hid]
      biases: List[torch.Tensor],
      sm_scale: float,
  ) -> torch.Tensor:
      q = q_input.transpose(-2, -3)
      k = k_input.transpose(-2, -3)
      v = v_input.transpose(-2, -3)
      k_t = k.transpose(-1, -2)
      a = torch.matmul(q, k_t) * sm_scale
  
      for b in biases:
          a += b
  
      a = F.softmax(a, dim=-1)
      a_v = torch.matmul(a, v)
      o = a_v.transpose(-2, -3)
  
      return o
  
file_path: DeepSpeed/tests/unit/ops/deepspeed4science/test_DS4Sci_EvoformerAttention.py
imports: from typing import List
  import pytest
  import torch
  from torch.nn import functional
  import deepspeed
  from deepspeed.ops.op_builder import EvoformerAttnBuilder
  from deepspeed.ops.deepspeed4science import DS4Sci_EvoformerAttention
  from deepspeed.accelerator import get_accelerator
  from unit.util import skip_on_arch
label_desc: Use image node_id 1 for calling a global function with example usage: attention_reference(q_input, k_input, v_input, biases, sm_scale) and returns: o