Skip to content

Allow Tensor.store API to receive .var as value #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions KLR/Trace/Tensor.lean
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,8 @@ nki load (src : Access) (dtype : Dtype := .float32) := do
let dst <- declare "load" dtype shape .sbuf
return .store (.simple dst) .load [.access src]

nki store (dst : Access) (value : Access) := do
let s1 <- dst.shape
let s2 <- value.shape
if s1 != s2 then
throw s!"incompatible shapes {s1} {s2}"
return Term.store dst .save [.access value]
nki store (dst : Access) (value : Core.Value) := do
return Term.store dst .save [value]

nki tensor_scalar (data : Access)
(op0 : AluOp)
Expand Down