lingvo.core.symbolic module
Utilities for symbolic computation.
- class lingvo.core.symbolic.Symbol(name=None, dummy_index=None, **assumptions)[source]
Bases:
Dummy
- dummy_index
- _explicit_class_assumptions = {}
- _prop_handler = {'extended_negative': <function Expr._eval_is_extended_negative>, 'extended_positive': <function Expr._eval_is_extended_positive>}
- default_assumptions = {}
- class lingvo.core.symbolic._LocalSymbolToValueStack[source]
Bases:
_local
A thread-local stack of symbol-to-value dicts.
- class lingvo.core.symbolic.SymbolToValueMap(value_type, symbol_to_value_map)[source]
Bases:
object
A symbol-to-value mapping.
Usage:
- with SymbolToValueMap(‘static’, {symbol1: value1, symbol2: value2, …}):
- with SymbolToValueMap(‘tensor’, {symbol1: value1, symbol2: value2, …}):
… = EvalExpr(value_type, symbolic_expr)
Multiple SymbolToValueMap context can be nested inside one another. The inner contexts take precedence over outer ones when multiple contexts provide values for the same symbol.
- _local_stack = <lingvo.core.symbolic._LocalSymbolToValueStack object>