code: def make_inference_attention_mask_3d(
      source_block, target_block, pad_id
  ):
      """
      Returns a 3-dimensional (3-D) attention mask
      :param source_block: 2-D array
      :param target_block: 2-D array
      """
      # mask = (target_block[:, None, :] != pad_id) * (source_block[:, :, None] != pad_id)
      return make_attention_mask_3d(
          source_block != pad_id, target_block != pad_id
      )
  
imports: import itertools
  import math
  from typing import Dict, Iterator, List, Tuple, Union
  import torch
  import torch.nn
  from torch import Tensor
label_desc: Use image node_id 18 for calling a global function with example usage: make_inference_attention_mask_3d(source_block, target_block, pad_id) and returns: make_attention_mask_3d