Skip to content

Commit

Permalink
add shape checking TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhairya Gandhi committed May 12, 2020
1 parent 72c0dde commit f4da6dc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ for (op,fn) in zip((:+, :-, :/, :*), (atg_add, atg_sub, atg_div, atg_matmul))
rank = Ref{Cint}(-1)

$fn(ptr, t1.ptr, t2.ptr)
at_dim(rank, ptr[])
Tensor{T,rank[]}(ptr[], on(t1))

# TODO: using `rank` here causes compiler to emit error
# make shape checking more robust
# at_dim(rank, ptr[])
Tensor{T,max(N,K)}(ptr[], on(t1))
end
end

Expand Down

0 comments on commit f4da6dc

Please sign in to comment.