class_docstr: A compile-time operation that returns a constant output value upon casting its constant input.
  
  .. sourcecode:: python
  
      Expression: output = constexpr_cast(source_val, output_dtype="fp32")
  
  Parameters
  ----------
  source_val: const tensor<SrcT, [...]> (Required)
  
  output_dtype: const tensor<string, []> (Required)
  
  Returns
  -------
  const tensor<DstT, [...]>
  
  Attributes
  ----------
  SrcT: fp16
  DstT: fp32
class_docstr_tok: ["A","compile-time","operation","that","returns","a","constant","output","value","upon","casting","its","constant","input",".","..","sourcecode",":",":","python","Expression",":","output","=","constexpr_cast","(","source_val",",","output_dtype=","''","fp32","''",")","Parameters","--","--","--","--","--","source_val",":","const","tensor","<","SrcT",",","[","...","]",">","(","Required",")","output_dtype",":","const","tensor","<","string",",","[","]",">","(","Required",")","Returns","--","--","--","-","const","tensor","<","DstT",",","[","...","]",">","Attributes","--","--","--","--","--","SrcT",":","fp16","DstT",":","fp32"]
code: def type_inference(self):
      dtype = types.string_to_builtin(self.output_dtype.val)
      if dtype != types.fp32:
          raise NotImplementedError(
              "Only output_dtype = fp32 is supported"
          )
  
      shape = self.source_val.shape
      return types.tensor(dtype, shape)
  
imports: import numpy
  from coremltools.converters.mil.mil import types
  from coremltools.converters.mil.mil.input_type import InputSpec, TensorInputType
  from coremltools.converters.mil.mil.operation import Operation
  from coremltools.converters.mil.mil.ops.defs._op_reqs import register_op
  from coremltools.converters.mil.mil.ops.defs._utils import restore_elements_from_packed_bits
  from coremltools.converters.mil.mil.ops.defs.iOS16 import _IOS16_TARGET
label_desc: Use image node_id 1 for calling the constexpr_cast obj's underlying member method code with example usage: obj.type_inference() and returns: types