use from_value API which is safer.
  Parameters:
     **dtype** (*Optional**[**dtype**]*) -- A torch.dtype to
     create a JitScalarType from

  Returns:
     JitScalarType

  Raises:
     **OnnxExporterError** -- if dtype is not a valid torch.dtype
     or if it is None.

  Return type:
     *JitScalarType*

classmethod from_value(value, default=None)
  Create a JitScalarType from an value's scalar type.

  Parameters:
     * **value** (*Union**[**None**, **Value**, **Tensor**]*) --
       An object to fetch scalar type from.

     * **default** -- The JitScalarType to return if a valid
       scalar cannot be fetched from value

  Returns:
     JitScalarType.

  Raises:
     * **OnnxExporterError** -- if value does not have a valid
       scalar type and default is None.

     * **SymbolicValueError** -- when value.type()'s info are
       empty and default is None

  Return type:
