Skip to content

Commit

Permalink
Fix lens errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kenranunderscore authored and fkm3 committed Mar 5, 2023
1 parent 00aeb23 commit bfd8de5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tensorflow-ops/src/TensorFlow/Gradient.hs
Original file line number Diff line number Diff line change
@@ -168,7 +168,7 @@ gradients y xs = build $ do
(\f x -> fromMaybe (error $ "no NodeDef found for " ++ show x) (f x))
. flip Map.lookup
let (gr, nodeMap) = createGraph yName nodeDefLookup
xnodes = mapMaybe (\x -> nodeMap ^. (at . outputNodeName . renderedOutput $ x)) xs
xnodes = mapMaybe (\x -> nodeMap ^. (at $ outputNodeName $ renderedOutput x)) xs
-- make a set of the nodes reachable from the xnodes
-- The xnodes are not part of this set (unless reachable from another xnode)
reachableSet = computeReachableSet xnodes gr
@@ -199,7 +199,8 @@ computeReachableSet vs g =
IntSet.fromList $ concatMap (drop 1 . FGL.preorder) (FGL.dff vs g)

outputIxAt :: OutputIx -> Lens' (IntMap.IntMap v) (Maybe v)
outputIxAt = intAt . unOutputIx
-- NOTE: point-free notation leads to unification problems here
outputIxAt x = intAt (unOutputIx x)

-- | Incomplete gradients of a node's outputs.
--

0 comments on commit bfd8de5

Please sign in to comment.