MCPcopy Index your code
hub / github.com/apache/tvm / eval_expr

Function eval_expr

python/tvm/script/parser/core/evaluator.py:442–468  ·  view source on GitHub ↗

Expression evaluation for TVMScript parser. Parameters ---------- parser : Parser The parser bound with the evaluator. node : Union[doc.expr, doc.Expression] The root node of AST tree node of expression to evaluate. dict_globals : Optional[Dict[str, Any]]

(
    parser: "Parser",
    node: doc.expr | doc.Expression,
    dict_globals: dict[str, Any] | None,
)

Source from the content-addressed store, hash-verified

440
441
442def eval_expr(
443 parser: "Parser",
444 node: doc.expr | doc.Expression,
445 dict_globals: dict[str, Any] | None,
446) -> Any:
447 """Expression evaluation for TVMScript parser.
448
449 Parameters
450 ----------
451 parser : Parser
452 The parser bound with the evaluator.
453
454 node : Union[doc.expr, doc.Expression]
455 The root node of AST tree node of expression to evaluate.
456
457 dict_globals : Optional[Dict[str, Any]]
458 The optional global value table for expression evaluation.
459
460 Returns
461 -------
462 res : Any
463 The evaluation result.
464 """
465 value_table = {}
466 if dict_globals is not None:
467 value_table.update(dict_globals)
468 return ExprEvaluator.eval(parser, value_table, node)
469
470
471def eval_assign(

Callers 1

eval_exprMethod · 0.85

Calls 2

evalMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…