concepts.dsl.executors.tensor_value_executor.compose_bvdict#
- compose_bvdict(input_dict, state=None)[source]#
Compose a bounded variable dict from raw inputs.
- Parameters:
input_dict (None | Sequence[Variable] | Dict[str | Variable, str | int | slice | bool | float | Tensor | TensorValue | ObjectConstant | StateObjectReference] | Dict[str, Dict[str, StateObjectReference | slice | TensorValue]]) –
the input dict. There are three types of inputs:
A sequence of
concepts.dsl.dsl_types.Variableinstances, which represents a set of variables with no values.A dictionary mapping from
concepts.dsl.dsl_types.Variableinstances to the actual value.A dictionary mapping from strings (the name of the variables) to values.
Acceptable values are:
A
str, which represents a reference to an object in the state (so the state must be object-named).An integer, which represents a reference to an object in the state (so the state must be object-named).
A QINDEX (a.k.a.,
slice(None)), which represents all objects in the state of a given type (so the state must be object-named).A
concepts.dsl.tensor_value.TensorValueinstance, which represents an actual value.A
StateObjectReferenceinstance, which represents a reference to an object in the state (so the state must be object-named).A
bool,int,float, ortorch.Tensorinstance, which represents an actual value. They will be converted to aconcepts.dsl.tensor_value.TensorValueinstance.
state (TensorState | None) – the state.
- Returns:
a dictionary mapping from strings (the typename) to a dictionary mapping from strings (the name of the variables) to values.
- Return type:
Dict[str, Dict[str, StateObjectReference | slice | TensorValue]]