Exemplo n.º 1
0
def _make_abstract_python_scalar(typ, val):
    return ShapedArray((),
                       dtypes._scalar_type_to_dtype(typ, val),
                       weak_type=True)
Exemplo n.º 2
0
def _make_concrete_python_scalar(t, x):
  return ConcreteArray(
    np.array(x, dtype=dtypes._scalar_type_to_dtype(t, x)),
    weak_type=True)
Exemplo n.º 3
0
def _canonicalize_python_scalar_dtype(typ, x):
    return np.asarray(
        x, dtypes.canonicalize_dtype(dtypes._scalar_type_to_dtype(typ, x)))
Exemplo n.º 4
0
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)