Skip to content

Commit

Permalink
ndarray: make _plus type stable (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
iblislin authored and pluskid committed Dec 2, 2017
1 parent 8a19651 commit fd7fb79
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ndarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -571,10 +571,10 @@ function add_to!(dst::NDArray{T}, args::NDArrayOrReal...) where T
if isa(arg, Real)
_plus_scalar(dst, scalar = convert(T, arg), out = dst)
else
_plus(dst, arg, out = dst)
_plus!(dst, arg)
end
end
return dst
dst
end

import Base: +
Expand Down Expand Up @@ -1100,6 +1100,9 @@ _mxsig[:reshape] = :(reshape(arr; shape = dim, reverse = !reverse))
# remapping to solving type unstablility
################################################################################

@_remap _plus(x::NDArray, y::NDArray) _plus(x, y)
@_remap _plus!(x::NDArray, y::NDArray) _plus(x, y)

@_remap _minus(x::NDArray, y::NDArray) _minus(x, y)
@_remap _minus!(x::NDArray, y::NDArray) _minus(x, y)

Expand Down Expand Up @@ -1228,6 +1231,8 @@ const _op_import_bl = [ # import black list; do not import these funcs
"dot",
"transpose",
"prod",

"_plus",
"_minus",
]

Expand Down

0 comments on commit fd7fb79

Please sign in to comment.