Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(53)  |  Call(35)  |  Derive(0)  |  Import(18)

src/p/a/parakeet-0.23.2/parakeet/type_inference/type_inference.py   parakeet(Download)
                      ActualArgs, FormalArgs, MissingArgsError, TooManyArgsError)
 
from ..syntax.helpers import (get_type, get_types,  get_elt_types, 
                              one_i64, zero_i64, none, true, false, 
                              gen_data_arg_names, unwrap_constant)
  def transform_PrimCall(self, expr):
    args = self.transform_args(expr.args)
 
    arg_types = get_types(args)
 
  def transform_Map(self, expr):
    closure = self.transform_fn(expr.fn)
    new_args = self.transform_args(expr.args, flat = True)
    arg_types = get_types(new_args)
    assert len(arg_types) > 0, "Map requires array arguments"
  def transform_Reduce(self, expr):
    assert len(expr.args) > 0, "Can't have Reduce without any arguments %s" % expr 
    new_args = self.transform_args(expr.args, flat = True)
    arg_types = get_types(new_args)
    axis = self.transform_if_expr(expr.axis)
    emit_fn = self.transform_fn(expr.emit)
    new_args = self.transform_args(expr.args, flat = True)
    arg_types = get_types(new_args)
 
    init = self.transform_expr(expr.init) if expr.init else None

src/p/a/parakeet-HEAD/parakeet/cuda_backend/cuda_compiler.py   parakeet(Download)
from ..openmp_backend import MulticoreCompiler
from ..syntax import PrintString, SourceExpr
from ..syntax.helpers import get_types, get_fn, get_closure_args, const_int, zero_i32, one_i32
 
import config 
  def build_kernel(self, clos, bounds, write_only = None):
    n_indices = len(bounds)
    fn = get_fn(clos)
    outer_closure_exprs = get_closure_args(clos)
    closure_arg_types = get_types(outer_closure_exprs)
  def use_closure(self, clos):
    fn = get_fn(clos)
    closure_exprs = get_closure_args(clos)
    closure_arg_types = get_types(closure_exprs)
    host_closure_args = self.visit_expr_list(closure_exprs)

src/p/a/parakeet-HEAD/parakeet/type_inference/type_inference.py   parakeet(Download)
                      ActualArgs, FormalArgs, MissingArgsError, TooManyArgsError)
 
from ..syntax.helpers import (get_type, get_types,  get_elt_types, 
                              one_i64, zero_i64, none, true, false, 
                              gen_data_arg_names, unwrap_constant)
  def transform_PrimCall(self, expr):
    args = self.transform_args(expr.args)
 
    arg_types = get_types(args)
    if all(isinstance(t, ScalarT) for t in arg_types):
  def transform_Map(self, expr):
    closure = self.transform_fn(expr.fn)
    new_args = self.transform_args(expr.args, flat = True)
    arg_types = get_types(new_args)
    assert len(arg_types) > 0, "Map requires array arguments"
  def transform_Reduce(self, expr):
    assert len(expr.args) > 0, "Can't have Reduce without any arguments %s" % expr 
    new_args = self.transform_args(expr.args, flat = True)
    arg_types = get_types(new_args)
    axis = self.transform_if_expr(expr.axis)
    emit_fn = self.transform_fn(expr.emit)
    new_args = self.transform_args(expr.args, flat = True)
    arg_types = get_types(new_args)
 
    init = self.transform_expr(expr.init) if expr.init else None

src/p/a/parakeet-0.23.2/parakeet/cuda_backend/cuda_compiler.py   parakeet(Download)
from ..openmp_backend import MulticoreCompiler
from ..syntax import PrintString, SourceExpr
from ..syntax.helpers import get_types, get_fn, get_closure_args, const_int, zero_i32, one_i32
 
import config 
  def build_kernel(self, clos, bounds):
    n_indices = len(bounds)
    fn = get_fn(clos)
    outer_closure_exprs = get_closure_args(clos)
    closure_arg_types = get_types(outer_closure_exprs)

src/p/a/parakeet-0.23.2/parakeet/transforms/simplify.py   parakeet(Download)
                       OuterMap, Map, Reduce, Scan, IndexMap, IndexReduce, 
                       IndexScan, FilterReduce)
from .. syntax.helpers import (collect_constants, is_one, is_zero, is_false, is_true, all_constants,
                               get_types, 
                               slice_none_t, const_int, one, none, true, false, slice_none, 
        assert isinstance(fn.type.fn, UntypedFn)
        from .. type_inference import specialize 
        fn = specialize(fn, get_types(combined_args))
      assert fn.return_type == expr.type
      return Call(fn, combined_args, type = fn.return_type)

src/p/a/parakeet-HEAD/parakeet/transforms/simplify.py   parakeet(Download)
                       OuterMap, Map, Reduce, Scan, IndexMap, IndexReduce, 
                       IndexScan, FilterReduce)
from .. syntax.helpers import (collect_constants, is_one, is_zero, is_false, is_true, all_constants,
                               get_types, 
                               slice_none_t, const_int, one, none, true, false, slice_none, 
        assert isinstance(fn.type.fn, UntypedFn)
        from .. type_inference import specialize 
        fn = specialize(fn, get_types(combined_args))
      assert fn.return_type == expr.type
      return Call(fn, combined_args, type = fn.return_type)

src/p/a/parakeet-0.23.2/parakeet/type_inference/rewrite_typed.py   parakeet(Download)
from ..syntax import (Assign, Tuple, Var, Cast, Return, Index, Map, 
                      ConstArrayLike, Const)
from ..syntax.helpers import get_types, zero_i64, none, const 
from ..transforms import Transform 
 
    elif isinstance(lhs, syntax.Tuple):
      elts = map(self.transform_lhs, lhs.elts)
      elt_types = get_types(elts)
      if elt_types != lhs.type.elt_types:
        return syntax.Tuple(elts, type = make_tuple_type(elt_types))
  def transform_PrimCall(self, expr):
      arg_types = get_types(expr.args)
      upcast_types = expr.prim.expected_input_types(arg_types)
      result_type = expr.prim.result_type(upcast_types)
      upcast_args = [self.coerce_expr(x, t)

src/p/a/parakeet-0.23.2/parakeet/analysis/verify.py   parakeet(Download)
from .. ndtypes import ArrayT, NoneT, NoneType, ScalarT, ClosureT, TupleT, FnT, Type, SliceT, PtrT
from .. ndtypes import lower_rank 
 
from .. syntax import Expr, Tuple, Var, Index, Closure, TypedFn 
from .. syntax.helpers import get_types, get_elt_types 
  def check_fn_args(self, fn, args = None, arg_types = None):
    if arg_types is None: 
      assert args is not None, "Function args missing" 
      arg_types = get_types(args)
    n_given = len(arg_types)
  def get_fn_and_closure(self, fn):
    if fn.__class__ is Closure: 
      return fn.fn, tuple(get_types(fn.args)) 
    elif fn.__class__ is TypedFn:
      return fn, ()
    else:
      elt_types = [lower_rank(arg.type, 1) for arg in expr.args]
    arg_types = tuple(get_types(closure_elts)) + tuple(elt_types)
    args = tuple(closure_elts) + tuple(expr.args)                      
    self.check_fn_args(fn, args, arg_types)

src/p/a/parakeet-HEAD/parakeet/type_inference/rewrite_typed.py   parakeet(Download)
  Assign, Tuple, Var, Return, Index, Map, ConstArrayLike, Const, Cast
)
from ..syntax.helpers import get_types, zero_i64, none, const 
from ..transforms import Transform 
 
    elif isinstance(lhs, syntax.Tuple):
      elts = map(self.transform_lhs, lhs.elts)
      elt_types = get_types(elts)
      if elt_types != lhs.type.elt_types:
        return syntax.Tuple(elts, type = make_tuple_type(elt_types))
  def transform_PrimCall(self, expr):
      arg_types = get_types(expr.args)
      upcast_types = expr.prim.expected_input_types(arg_types)
      result_type = expr.prim.result_type(upcast_types)
      upcast_args = [self.coerce_expr(x, t)

src/p/a/parakeet-HEAD/parakeet/analysis/verify.py   parakeet(Download)
from .. ndtypes import ArrayT, NoneT, NoneType, ScalarT, ClosureT, TupleT, FnT, Type, SliceT, PtrT
from .. ndtypes import lower_rank 
 
from .. syntax import Expr, Tuple, Var, Index, Closure, TypedFn 
from .. syntax.helpers import get_types, get_elt_types 
  def check_fn_args(self, fn, args = None, arg_types = None):
    if arg_types is None: 
      assert args is not None, "Function args missing" 
      arg_types = get_types(args)
    n_given = len(arg_types)
  def get_fn_and_closure(self, fn):
    if fn.__class__ is Closure: 
      return fn.fn, tuple(get_types(fn.args)) 
    elif fn.__class__ is TypedFn:
      return fn, ()
    else:
      elt_types = [lower_rank(arg.type, 1) for arg in expr.args]
    arg_types = tuple(get_types(closure_elts)) + tuple(elt_types)
    args = tuple(closure_elts) + tuple(expr.args)                      
    self.check_fn_args(fn, args, arg_types)

  1 | 2  Next