code: def incremental_causal_attention(x, y, z, accum_mat, n):
      """
      efficient causal attention operation
      Args:
          x (Tensor): Tensor with shape `(batch, 1, d1)`
          y (Tensor): Tensor with shape `(batch, 1, d1)`
          z (Tensor): Tensor with shape `(batch, 1, d2)`
          accum_mat (Tensor): Tensor with shape `(batch, d1, d2)`
          n (Tensor): number of steps with shape `(batch, )`
      return:
      """
      bsz = n.size(0)
      # B x d1 x d2
      accum_mat = accum_mat + torch.bmm(y.transpose(1, 2), z)
      # B x 1 x d2
      out = torch.bmm(x, accum_mat).div(n.view(bsz, 1, 1))
      return out, accum_mat
  
imports: import math
  from typing import Dict, Optional, Tuple, Union
  import torch
  import torch.nn.functional
  from fairseq import utils
  from fairseq.incremental_decoding_utils import with_incremental_state
  from fairseq.modules.fairseq_dropout import FairseqDropout
  from torch import nn, Tensor
label_desc: Use image node_id 3 for calling a global function with example usage: incremental_causal_attention(x, y, z, accum_mat, n) and returns: out,  accum_mat