Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
joelberkeley committed Dec 7, 2023
1 parent 90733b3 commit 97ffead
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Tensor.idr
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ eval : PrimitiveRW dtype ty => Graph (Tensor shape dtype) -> IO (Literal shape t
eval x =
let (MkEnvN _ env, MkTensor n) = runState (MkEnvN 0 empty) x in
-- in idris_crash "crashing with env: \{show env}"
runEitherT (run {dtype} n $ env) <&> \case
runEitherT (run {dtype} n $ traceVal env) <&> \case
Right lit => lit
Left err => idris_crash (show err)

Expand Down Expand Up @@ -645,7 +645,7 @@ map :
Graph $ Tensor shape b
map f $ MkTensor {shape = _} x = do
MkEnvN next env <- get
let envWithParameter = MkEnvN (S next) (insert next (Arg next) env)
let envWithParameter = MkEnvN (S next) (singleton next (Arg next))
(MkEnvN next' subEnv, MkTensor result) = runState envWithParameter (f $ MkTensor next)
fn = MkFn [(next, MkShapeAndType shape a)] result subEnv
put (MkEnvN next' env)
Expand Down

0 comments on commit 97ffead

Please sign in to comment.