code: def log_batch_size(logger, token_data, is_train):
      batch_size = token_data["input_ids"].shape[0]
      seq_len = token_data["input_ids"].shape[1]
      squared = seq_len**2 * batch_size
  
      if is_train:
          logger.info(f"{batch_size} x {seq_len} ({squared}) update")
      else:
          logger.info(f"{batch_size} x {seq_len} ({squared}) predict")
  
imports: from typing import List, Dict, Union, Set
  from pathlib import Path
  import random
  from transformers import AutoModel, AutoTokenizer
  from transformers.tokenization_utils import BatchEncoding
  from transformers.tokenization_utils_fast import PreTrainedTokenizerFast
  import catalogue
  from spacy.util import registry
  from thinc.api import get_torch_default_device
  import torch.cuda
  import tempfile
  import shutil
  import contextlib
  import warnings
label_desc: Use image node_id 7 for calling a global function with example usage: log_batch_size(logger, token_data, is_train) without return types