MCPcopy Create free account
hub / github.com/apache/tvm / FunctionScope

Class FunctionScope

python/tvm/relax/block_builder.py:39–61  ·  view source on GitHub ↗

Auxiliary scope for function

Source from the content-addressed store, hash-verified

37
38
39class FunctionScope:
40 """Auxiliary scope for function"""
41
42 def __init__(self, block_builder, name, params, attrs, is_pure):
43 self._bb = block_builder
44 self._name = name
45 self._params = params
46 self._attrs = attrs
47 self._is_pure = is_pure
48
49 # Blocks that have been collected within the function
50 self._blocks = []
51 # a boolean flag that tracks if emit_func_output has been called
52 self._is_emit_func_output_called = False
53
54 def __enter__(self):
55 self._bb._enter_function_scope(self)
56
57 def __exit__(self, exc_type, exc_val, exc_tb):
58 # __exit__ should properly handle the case where the with block exits with an exception
59 # when handling error case in exit, always check if there is already an exception
60 # been thrown in the with block
61 self._bb._exit_function_scope(exc_type, exc_val, exc_tb)
62
63
64class DataflowScope:

Callers 1

functionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…