This package is pretty neat and helpful!
Can we add some keyword arguments to the following function to reuse preallocated array and control whether to permute dims or not?
|
function _npzreadarray(f, hdr::Header{T}) where {T} |
|
toh = hdr.descr |
|
if hdr.fortran_order |
|
@compat x = map(toh, read!(f, Array{T}(undef, hdr.shape))) |
|
else |
|
@compat x = map(toh, read!(f, Array{T}(undef, reverse(hdr.shape)))) |
|
if ndims(x) > 1 |
|
x = permutedims(x, collect(ndims(x):-1:1)) |
|
end |
|
end |
|
ndims(x) == 0 ? x[1] : x |
|
end |
This package is pretty neat and helpful!
Can we add some keyword arguments to the following function to reuse preallocated array and control whether to permute dims or not?
NPZ.jl/src/NPZ.jl
Lines 229 to 240 in 8834d3c