Skip to content

Commit

Permalink
Use rank instead of size
Browse files Browse the repository at this point in the history
Co-authored-by: Mateusz Sluszniak <[email protected]>
  • Loading branch information
0urobor0s and msluszniak authored Oct 16, 2023
1 parent 92710d6 commit 88582f2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/scholar/options.ex
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ defmodule Scholar.Options do
end

def beta(beta) do
if (is_number(beta) and beta >= 0) or (Nx.is_tensor(beta) and Nx.size(beta) == 1) do
if (is_number(beta) and beta >= 0) or (Nx.is_tensor(beta) and Nx.rank(beta) == 0) do
{:ok, beta}
else
{:error, "expect 'beta' to be in the range [0, inf]"}
Expand Down

0 comments on commit 88582f2

Please sign in to comment.