code: def allocate_hexagon_array(
      dev,
      tensor_shape=None,
      dtype=None,
      data=None,
      axis_separators=None,
      mem_scope=None,
  ):
      """
      Allocate a hexagon array which could be a 2D array
      on physical memory defined by axis_separators
      """
      if tensor_shape is None:
          assert (
              data is not None
          ), "Must provide either tensor shape or numpy data array"
          tensor_shape = data.shape
      elif data is not None:
          assert (
              tensor_shape == data.shape
          ), "Mismatch between provided tensor shape and numpy data array shape"
  
      if dtype is None:
          assert (
              data is not None
          ), "Must provide either dtype or numpy data array"
          dtype = data.dtype.name
      elif data is not None:
          assert (
              dtype == data.dtype
          ), "Mismatch between provided dtype and numpy data array dtype"
  
      if axis_separators is None:
          axis_separators = []
  
      boundaries = [0, *axis_separators, len(tensor_shape)]
      physical_shape = [
          numpy.prod(tensor_shape[dim_i:dim_f])
          for dim_i, dim_f in zip(boundaries[:-1], boundaries[1:])
      ]
  
      arr = tvm.nd.empty(
          physical_shape, dtype=dtype, device=dev, mem_scope=mem_scope
      )
  
      if data is not None:
          arr.copyfrom(data.reshape(physical_shape))
  
      return arr._create_view(tensor_shape)
  
imports: import os
  import pathlib
  import re
  from typing import List, Union
  import subprocess
  import sys
  import tarfile
  import io
  import numpy
  import tvm
  import tvm.contrib.cc
  from ..._ffi.registry import register_func
label_desc: Use image node_id 10 for calling a global function with example usage: allocate_hexagon_array(dev, tensor_shape, dtype, data, axis_separators, mem_scope) and returns: arr