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

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/high-to-mid/probe-ein.sml
ViewVC logotype

Diff of /branches/vis15/src/compiler/high-to-mid/probe-ein.sml

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

revision 4168, Thu Jul 7 16:48:41 2016 UTC revision 4169, Thu Jul 7 17:05:09 2016 UTC
# Line 269  Line 269 
269            val E.Probe(E.Conv(Vid, alpha, hid, dx), E.Tensor(tid, _)) = probe            val E.Probe(E.Conv(Vid, alpha, hid, dx), E.Tensor(tid, _)) = probe
270            val E.IMG(dim, shape) = List.nth(params, Vid)            val E.IMG(dim, shape) = List.nth(params, Vid)
271            val freshIndex = getsumshift (sx, length index)            val freshIndex = getsumshift (sx, length index)
272            val (dx', sx', Ps) = T.imageToWorld (freshIndex, dim, dx, pid)            val (dx', tshape, sx', Ps) = T.imageToWorld (freshIndex, dim, dx, pid)
273            val sxn = freshIndex + length dx' (*next available index id *)            val sxn = freshIndex + length dx' (*next available index id *)
274            val (args', vP, probe') = fieldReconstruction (            val (args', vP, probe') = fieldReconstruction (
275                  avail, sxn, alpha, shape, dx', Vid, Vidnew, kid, hid, tid, args)                  avail, sxn, alpha, shape, dx', Vid, Vidnew, kid, hid, tid, args)
# Line 288  Line 288 
288      fun createEinApp (body, alpha, index, freshIndex, dim, dx, sx) = let      fun createEinApp (body, alpha, index, freshIndex, dim, dx, sx) = let
289            val Pid = 0            val Pid = 0
290            val tid = 1            val tid = 1
291            val (dx', newsx, Ps) = T.imageToWorld(freshIndex, dim, dx, Pid)            val (dx', tshape, newsx, Ps) = T.imageToWorld(freshIndex, dim, dx, Pid)
292          (* need to rewrite dx *)          (* need to rewrite dx *)
293            val sxx = sx@newsx            val sxx = sx@newsx
294            (* DEBUG val _ = print(String.concat["\npost image to world",EinPP.expToString(E.Sum(newsx,E.Opn(E.Prod,E.Tensor(8,dx')::Ps)))]) *)
295            val (_, sizes, E.Conv(_, alpha', _, dx)) = (case sxx            val (_, sizes, E.Conv(_, alpha', _, dx)) = (case sxx
296                   of [] => ([], index, E.Conv(0, alpha, 1, dx'))                   of [] => ([], index, E.Conv(0, alpha, 1, dx'))
297                    | _ => CleanIndex.clean(E.Conv(0, alpha, 1, dx'), index, sxx)                    | _ => CleanIndex.clean(E.Conv(0, alpha, 1, dx'), index, sxx)
298                  (* end case *))                  (* end case *))
299            fun filterAlpha [] = dx'            fun filterAlpha [] = (*dx'*) tshape
300              | filterAlpha (E.C _::es) = filterAlpha es              | filterAlpha (E.C _::es) = filterAlpha es
301              | filterAlpha (e1::es) = e1::(filterAlpha es)              | filterAlpha (e1::es) = e1::(filterAlpha es)
302            val exp = E.Tensor(tid, filterAlpha alpha')            val exp = E.Tensor(tid, filterAlpha alpha')
303            val (splitvar, body') = arrangeBody(body, Ps, newsx, exp)            val (splitvar, body') = arrangeBody(body, Ps, newsx, exp)
304            val params = [E.TEN(true, [dim,dim]), E.TEN(true, sizes)]            val params = [E.TEN(true, [dim,dim]), E.TEN(true, sizes)]
305            val ein0 = mkEin(params, index, body')            val ein0 = mkEin(params, index, body')
306            (* DEBUG  val _ = print(String.concat["\nein0",EinPP.toString(ein0)]) *)
307            in            in
308              (splitvar, ein0, sizes, dx, alpha')              (splitvar, ein0, sizes, dx, alpha')
309            end            end
# Line 324  Line 326 
326            val (args', vP, probe') =            val (args', vP, probe') =
327                  fieldReconstruction (avail, sxn, alpha', shape, dx,  Vid, Vid, kid, hid, tid, args)                  fieldReconstruction (avail, sxn, alpha', shape, dx,  Vid, Vid, kid, hid, tid, args)
328            val einApp1 = IR.EINAPP(mkEin(params', sizes, probe'), args')            val einApp1 = IR.EINAPP(mkEin(params', sizes, probe'), args')
329              val einr= mkEin(params', sizes, probe')
330          (* transform T*P*P..Ps *)          (* transform T*P*P..Ps *)
331            val rtn0 = if splitvar            val rtn0 = if splitvar
332                  then FloatEin.transform(y, EinSums.transform ein0, [vP, vT])                  then FloatEin.transform(y, EinSums.transform ein0, [vP, vT])

Legend:
Removed from v.4168  
changed lines
  Added in v.4169

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