Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/ein/mkoperators.sml
ViewVC logotype

Diff of /branches/charisee/src/compiler/ein/mkoperators.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3720, Mon Apr 4 18:20:42 2016 UTC revision 3721, Mon Apr 4 19:38:34 2016 UTC
# Line 20  Line 20 
20          in ListPair.map  (fn(v,i)=>(v, 0, i-1))   (vs, alpha) end          in ListPair.map  (fn(v,i)=>(v, 0, i-1))   (vs, alpha) end
21       fun sumIds2(n,i)=List.tabulate(n, (fn v=>(E.V v, 0, i)))       fun sumIds2(n,i)=List.tabulate(n, (fn v=>(E.V v, 0, i)))
22      val subst_flag =1(*here*)      val subst_flag =1(*here*)
23        fun mkSxSingle c = (*FIXME- needs a flag E.C (c,false)*)  E.C c
24      (******************************* Add *****************************************)      (******************************* Add *****************************************)
25      val addRR = E.EIN{      val addRR = E.EIN{
26          params = [E.TEN(subst_flag,[]), E.TEN(subst_flag,[])] ,          params = [E.TEN(subst_flag,[]), E.TEN(subst_flag,[])] ,
# Line 670  Line 671 
671          params = [],index = [dim,dim], body = E.G(E.Delta(E.V(0), E.V(1)))          params = [],index = [dim,dim], body = E.G(E.Delta(E.V(0), E.V(1)))
672      }      }
673    
674      fun slice (argTy,mask,const,rstTy) =let      fun sliceT (mask, const, rstTy, argTy) = let
675          fun iter ([],_,cnt)=[]          fun iter ([],_,cnt)=[]
676           | iter(true::es,c::cs,cnt)=[E.C c]@iter(es,cs,cnt)              | iter(true::es, c::cs, cnt)=(mkSxSingle c)::iter(es, cs, cnt)
677           |iter(false::es,cs,cnt)=[E.V cnt]@iter(es,cs,cnt+1)              |iter(false::es, cs, cnt)= (E.V cnt)::iter(es, cs, cnt+1)
678          val ix=iter(mask,const,0)          val ix=iter(mask,const,0)
679          in              val ein0 = E.EIN{params = [E.TEN(subst_flag, argTy)], index = rstTy, body = E.Tensor(0, ix)}
680              E.EIN{  params = [E.TEN(subst_flag,argTy)],index = rstTy,body = E.Tensor(0, ix)}          val _ = print(P.printerE(ein0))
681            in ein0
682          end          end
683    
684        fun sliceF (mask, const, rstTy, dim) = let
685                fun iter ([], _, cnt) = []
686                | iter(true::es, c::cs, cnt)=(mkSxSingle c)::iter(es, cs, cnt)
687                | iter(false::es, cs, cnt)=(E.V cnt)::iter(es, cs, cnt+1)
688                val ix = iter(mask, const,0 )
689                val ein0 =  E.EIN{ params = [E.FLD(dim)], index = rstTy, body = E.Field(0, ix)}
690                val _ =print(P.printerE(ein0))
691            in ein0 end
692    
693      (******************** other field ops  ********************************)      (******************** other field ops  ********************************)
694      (*FLD here is bounded to image field, and dimension of h*)      (*FLD here is bounded to image field, and dimension of h*)
695      fun conv(dim,shape) =let      fun conv(dim,shape) =let

Legend:
Removed from v.3720  
changed lines
  Added in v.3721

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0