Skip to content

Commit

Permalink
[system-a] rectify
Browse files Browse the repository at this point in the history
  • Loading branch information
xieyuheng committed May 25, 2024
1 parent 4ed4428 commit 36d003f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# system-a

[system-a] `rectify`
[system-a] `linear11`
[system-a] `linear`

# the-book

Expand Down
3 changes: 3 additions & 0 deletions src/system-a/toys/rectify.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { Scalar } from "../tensor/index.js"
import { extend1 } from "./extend.js"
import { lt } from "./toys.js"

export function rectifyScalar(s: Scalar): Scalar {
Expand All @@ -8,3 +9,5 @@ export function rectifyScalar(s: Scalar): Scalar {
return s
}
}

export const rectify = extend1(rectifyScalar, 0)

0 comments on commit 36d003f

Please sign in to comment.