class_docstr: TestElementWise
docstr: Testing build success/failure
  
  * On Hexagon targets, build must succeed for both 1-d and 2-d memory.
  * On non-Hexagon targets, build must succeed 1-d memory.
  * On non-Hexagon targets, build must fail and report an error for 2-d memory.
docstr_tok: ["Testing","build","success\/failure","*","On","Hexagon","targets",",","build","must","succeed","for","both","1-d","and","2-d","memory",".","*","On","non-Hexagon","targets",",","build","must","succeed","1-d","memory",".","*","On","non-Hexagon","targets",",","build","must","fail","and","report","an","error","for","2-d","memory","."]
code: def test_build(
      self,
      schedule_args,
      target_host,
      input_layout,
      working_layout,
      output_layout,
  ):
      """Testing build success/failure
  
      * On Hexagon targets, build must succeed for both 1-d and 2-d memory.
      * On non-Hexagon targets, build must succeed 1-d memory.
      * On non-Hexagon targets, build must fail and report an error for 2-d memory.
      """
      # contextlib.nullcontext wasn't added until python3.7, and the
      # CI currently runs on python3.6.  Therefore, using ExitStack
      # to manage an optional context instead.
      stack = contextlib.ExitStack()
  
      with stack:
          is_hexagon = target_host.kind.name == "hexagon"
          uses_2d_memory = "nchw-8h8w32c-2d" in [
              input_layout,
              working_layout,
              output_layout,
          ]
          if uses_2d_memory and not is_hexagon:
              stack.enter_context(pytest.raises(tvm.TVMError))
  
          tvm.build(*schedule_args, target=target_host)
  
imports: import contextlib
  import numpy
  import pytest
  import tvm
  import tvm.contrib.hexagon
  import tvm.testing
  from tvm import te
  from tvm.contrib.hexagon.pytest_plugin import requires_hexagon_toolchain
  from tvm.tir.stmt_functor import post_order_visit
  from tvm.contrib.hexagon import allocate_hexagon_array
  from .infrastructure import get_hexagon_target
label_desc: Use image node_id 12 for calling the TestElementWise obj's underlying member method code with example usage: obj.test_build(schedule_args, target_host, input_layout, working_layout, output_layout) without return types