def abs_(context, node, x): import builtinmodule argtype = get_type(x) if argtype.is_array and argtype.is_numeric: # Handle np.abs() on arrays dtype = builtinmodule.abstype(argtype.dtype) result_type = argtype.copy(dtype=dtype) node.variable = Variable(result_type) return node return builtinmodule.abs_(context, node, x)
def abs_(typesystem, node, x): import builtinmodule argtype = get_type(x) if argtype.is_array and argtype.is_numeric: # Handle np.abs() on arrays dtype = builtinmodule.abstype(argtype.dtype) result_type = argtype.add("dtype", dtype) node.variable = Variable(result_type) return node return builtinmodule.abs_(typesystem, node, x)