class_docstr: .. note::
      This class should not be instantiated directly; use :func:`Constant` function
      with appropriate arguments to create instances of this class.
  
  Wrapper for a constant value that can be used in DALI :ref:`mathematical expressions`
  and applied element-wise to the results of DALI Operators representing Tensors in
  :meth:`nvidia.dali.Pipeline.define_graph` step.
  
  ScalarConstant indicates what type should the value be treated as with respect
  to type promotions. The actual values passed to the backend from python
  would be `int32` for integer values and `float32` for floating point values.
  Python builtin types `bool`, `int` and `float` will be marked to indicate
  :const:`nvidia.dali.types.DALIDataType.BOOL`, :const:`nvidia.dali.types.DALIDataType.INT32`,
  and :const:`nvidia.dali.types.DALIDataType.FLOAT` respectively.
  
  Args
  ----
  value: bool or int or float
      The constant value to be passed to DALI expression.
  dtype: DALIDataType, optional
      Target type of the constant to be used in types promotions.
class_docstr_tok: ["..","note",":",":","This","class","should","not","be","instantiated","directly",";","use",":","func",":","`","Constant","`","function","with","appropriate","arguments","to","create","instances","of","this","class",".","Wrapper","for","a","constant","value","that","can","be","used","in","DALI",":","ref",":","`","mathematical","expressions","`","and","applied","element-wise","to","the","results","of","DALI","Operators","representing","Tensors","in",":","meth",":","`","nvidia.dali.Pipeline.define_graph","`","step",".","ScalarConstant","indicates","what","type","should","the","value","be","treated","as","with","respect","to","type","promotions",".","The","actual","values","passed","to","the","backend","from","python","would","be","`","int32","`","for","integer","values","and","`","float32","`","for","floating","point","values",".","Python","builtin","types","`","bool","`",",","`","int","`","and","`","float","`","will","be","marked","to","indicate",":","const",":","`","nvidia.dali.types.DALIDataType.BOOL","`",",",":","const",":","`","nvidia.dali.types.DALIDataType.INT32","`",",","and",":","const",":","`","nvidia.dali.types.DALIDataType.FLOAT","`","respectively",".","Args","--","--","value",":","bool","or","int","or","float","The","constant","value","to","be","passed","to","DALI","expression",".","dtype",":","DALIDataType",",","optional","Target","type","of","the","constant","to","be","used","in","types","promotions","."]
code: def __float__(self):
      if self.dtype in _float_types:
          return self.value
      raise TypeError(
          f"DALI ScalarConstant must be converted to one of the float types: "
          f"({_float_types}) explicitly before casting to builtin `float`."
      )
  
imports: from enum import Enum, unique
  import re
  from nvidia.dali._backend_enums import DALIDataType, DALIImageType, DALIInterpType
  from nvidia.dali.backend_impl.types import *
label_desc: Use image node_id 18 for calling the ScalarConstant obj's underlying member method code with example usage: obj.__float__() and returns: self