Skip to content

Commit

Permalink
Merge pull request #16 from pedroboechat/15-datatype-error
Browse files Browse the repository at this point in the history
Fix type size gather
  • Loading branch information
pedromxavier authored Apr 2, 2024
2 parents dbff168 + 67ff77b commit ec4f233
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/model/model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct WNN{S<:Any,T<:WNNINT}
error("Values for 'd' and 'n' must be positive")
end

if T !== BigInt && d > (T.size * 8)
if T !== BigInt && d > (sizeof(T) * 8)
error("'$T' is insufficient to provide 'd' addressing bits")
end

Expand Down Expand Up @@ -72,7 +72,7 @@ end
Base.show(io::IO, wnn::WNN{S,T}) where {S<:Any,T<:BigInt} =
print(io, "WNN[∞ bits, $(wnn.d) × $(wnn.n)]")
Base.show(io::IO, wnn::WNN{S,T}) where {S<:Any,T<:Unsigned} =
print(io, "WNN[$(T.size * 8) bits, $(wnn.d) × $(wnn.n)]")
print(io, "WNN[$(sizeof(T) * 8) bits, $(wnn.d) × $(wnn.n)]")

Base.Broadcast.broadcastable(wnn::WNN) = Ref(wnn)

Expand Down

0 comments on commit ec4f233

Please sign in to comment.