code: def test_device_config_cycles(acc_config, expected):
      device_config = cs.EthosuDeviceConfig(acc_config)
  
      conv_type = "ethosu_conv2d"
      conv_str = None
      conv_ifm_dtype = "int8"
      conv_ofm_dtype = "int8"
      conv_activation = "LUT"
      conv_cycles = device_config._get_output_cycles(
          conv_type,
          conv_str,
          conv_ifm_dtype,
          conv_ofm_dtype,
          conv_activation,
      )
      assert conv_cycles == expected[0]
  
      pool_type = "ethosu_pooling"
      pool_str = "MAX"
      pool_ifm_dtype = "int8"
      pool_ofm_dtype = "int8"
      pool_activation = "NONE"
      pool_cycles = device_config._get_output_cycles(
          pool_type,
          pool_str,
          pool_ifm_dtype,
          pool_ofm_dtype,
          pool_activation,
      )
      assert pool_cycles == expected[1]
  
      add_type = "ethosu_binary_elementwise"
      add_str = "ADD"
      add_ifm_dtype = "int8"
      add_ofm_dtype = "int8"
      add_activation = "NONE"
      add_cycles = device_config._get_output_cycles(
          add_type,
          add_str,
          add_ifm_dtype,
          add_ofm_dtype,
          add_activation,
      )
      assert add_cycles == expected[2]
  
      mul_type = "ethosu_binary_elementwise"
      mul_str = "MUL"
      mul_ifm_dtype = "int8"
      mul_ofm_dtype = "int8"
      mul_activation = "NONE"
      mul_cycles = device_config._get_output_cycles(
          mul_type,
          mul_str,
          mul_ifm_dtype,
          mul_ofm_dtype,
          mul_activation,
      )
      assert mul_cycles == expected[3]
  
      mul_32_type = "ethosu_binary_elementwise"
      mul_32_str = "MUL"
      mul_32_ifm_dtype = "int8"
      mul_32_ofm_dtype = "int32"
      mul_32_activation = "NONE"
      mul_32_cycles = device_config._get_output_cycles(
          mul_32_type,
          mul_32_str,
          mul_32_ifm_dtype,
          mul_32_ofm_dtype,
          mul_32_activation,
      )
      assert mul_32_cycles == expected[4]
  
file_path: tvm/tests/python/contrib/test_ethosu/cascader/test_ethosu_part_performance.py
imports: import pytest
  from functools import reduce
  import numpy
  import math
  import tvm.contrib.ethosu.cascader
  from tvm.contrib.ethosu.cascader.device_config import _Shape
  from .infra import make_matrices
label_desc: Use image node_id 1 for calling a global function with example usage: test_device_config_cycles(acc_config, expected) without return types