Hello,
I am experimenting with arraymancer and when compiling with nimble install --gc:arc while using arraymancer I encounters weird behaviour such as :
I am using the devel nim :
Nim Compiler Version 1.1.1 [Linux: amd64] Compiled at 2020-03-05 Copyright (c) 2006-2019 by Andreas Rumpf
I installed arraymancer with nimble install arraymancer@#head
For reference here is the code that reproduce :
import arraymancer
proc doubleMe(data : Tensor[float]): Tensor[float]=
result = data*2
proc squareMe(data : Tensor[float]): Tensor[float]=
result = data*.data
let A : seq[float] = @[0.11, 0.12, 0.13, 0.14]
echo A.type
echo A
var B : Tensor[float] = A.toTensor
echo B
# Blocking
var C = doubleMe(B)
echo C
#Segfault
var D = squareMe(C)
echo D
If I remove the --gc:arc flag it behaves normally.
Is this "normal" behaviour (meaning arraymancer does not support arc) or am I miss something obvious ?
Reported there: https://github.com/mratsim/Arraymancer/issues/423 thanks.
I'm currently significantly changing the Arraymancer internals (backed by raw memory buffers instead of sequences) so this might disappear by itself.
Good to hear !
Also, do you support interpolation and FFT on Tensor in Arraymancer ?
I write some naive fft function use Arraymancer.But I don't have time to improve.(i'm writting web framework now)
https://github.com/xflywind/scim/blob/master/src/scim/fft.nim
As far as I'm aware these two things aren't possible with Arraymancer at the moment. But using normal a seq[T] there's ways to do both:
For interpolation:
And for FFT the only way I'm aware of at the moment is via the C library kiss FFT: https://github.com/m13253/nim-kissfft
I wrote down a couple of notes (mainly for myself and @kaushalmodi) about using kiss FFT from Nim a couple of days ago: https://gist.github.com/Vindaar/fc158afbc75627260aed90264398e473
Interpolation?
For FFT I was sure there was a package but maybe I misremembered.
Edit: there was one https://github.com/mratsim/Arraymancer/issues/394#issue-512574030, forgot to link the forum post though :P
That's seriously awesome, thanks everyone !
@mratsim What I meant was the equivalent of Numpy's interpn / RegularGridInterpolator and interp3 in Matlab / Octave with typically Linear / Nearest Neighbour / Cubic methods.