code: def calculate_workspace_bytes(
      func: PrimFunc, workspace_byte_alignment: int
  ) -> int:
      """Calculate the workspace size in bytes needed by the TIR allocates inside the TIR
      PrimFunc.
  
      Parameters
      ----------
      func: tvm.tir.PrimFunc
          The function to be detected.
      workspace_byte_alignment : int
          The byte alignment required for each tensor
  
      Returns
      -------
      result : int
          Workspace size in bytes.
      """
      return _ffi_api.calculate_workspace_bytes(
          func, workspace_byte_alignment
      )
  
imports: from typing import Dict, List, Optional, Union
  import tvm
  from tvm import Object
  from tvm.ir import IRModule
  from tvm.tir.expr import Var
  from tvm.tir.stmt import Block, BufferRegion, PrimExpr
  from ..None import Buffer, Stmt
  from ..function import PrimFunc
  from .None import _ffi_api
label_desc: Use image node_id 7 for calling a global function with example usage: calculate_workspace_bytes(func, workspace_byte_alignment) and returns: _ffi_api