concepts.dsl.constraint.cvt_opt_value#

cvt_opt_value(value, dtype=None)[source]#

Convert a value to OptimisticValue or a (determined) TensorValue. Acceptable types are:

  • OptimisticValue

  • TensorValue, which will be converted to OptimisticValue if it corresponds to an optimistic value.

  • bool, which will be converted to TensorValue.

  • int, which will be converted to OptimisticValue if it is an optimistic identifier, otherwise TensorValue.

Parameters:
Returns:

The converted value.

Return type:

TensorValue | StateObjectReference | OptimisticValue