def _make_abstract_python_scalar(typ, val): return ShapedArray((), dtypes._scalar_type_to_dtype(typ, val), weak_type=True)
def _make_concrete_python_scalar(t, x): return ConcreteArray( np.array(x, dtype=dtypes._scalar_type_to_dtype(t, x)), weak_type=True)
def _canonicalize_python_scalar_dtype(typ, x): return np.asarray( x, dtypes.canonicalize_dtype(dtypes._scalar_type_to_dtype(typ, x)))
def _make_concrete_python_scalar(t, x): dtype = dtypes._scalar_type_to_dtype(t, x) return canonical_concrete_aval(np.array(x, dtype=dtype), weak_type=True)