chengchingwen / Pickle.jl

An experimental package for loading and saving object in Python Pickle format.
MIT License
51 stars 9 forks source link

StridedView type piracy #27

Closed cossio closed 2 years ago

cossio commented 2 years ago

The following line:

https://github.com/chengchingwen/Pickle.jl/blob/f36db91d5ea75ffe4f16d1cc8c010b8c3a5a77a4/src/torch/torch_save.jl#L37

is type piracy.

It's also not necessary, since this method was recently added in Strided.jl:

https://github.com/Jutho/Strided.jl/blob/10cc9872f5b994d5f906c0ef0f28cef77ddd2683/src/stridedview.jl#L35

As a result, loading this package results in a warning:

WARNING: Method definition (::Type{Strided.StridedView{T, N, A, F} where F<:Union{typeof(Base.adjoint), typeof(Base.conj), typeof(Base.identity), typeof(Base.transpose)} where A<:(DenseArray{T, N} where N where T) where N where T})(Base.PermutedDimsArrays.PermutedDimsArray{T, N, perm, iperm, AA} where AA<:(AbstractArray{T, N} where N where T) where iperm) where {T, N, perm} in module Strided at /home/cossio/.julia/packages/Strided/LvYNZ/src/stridedview.jl:35 overwritten in module Torch at /home/cossio/.julia/packages/Pickle/iHRCQ/src/torch/torch_save.jl:37.

Can we remove this line?