« first day (2707 days earlier)      last day (514 days later) » 

1:47 PM
@AndrasDeak--СлаваУкраїні Just found some funny thing: When I do something like a = np.zeros((100, 100, 100, 100, 10)) not much memory gets used (e.g. in top or your system monitor/taskmanager/whatever), but as soon as you use np.ones, or do an inplace operation a += 0 the displayed memory consumption increases
it seems numpy does somehow keep track of the sparsity somehow and optimizes something - do you have any idea how that works or can you maybe point me to some documentation?
I mean I would have expected something like this from np.empty, but not necessarily form np.zeros
something like stackoverflow.com/q/70055063 I guess
 
 
2 hours later…
3:31 PM
@flawr never heard of that, I'm quite surprised it's a thing.
Ah, yeah, OS trickery
Then it "makes sense".
 
@AndrasDeak--СлаваУкраїні I'm gonna frame that and hang it on my wall:P
@AndrasDeak--СлаваУкраїні but still I find it kinda curious that it happens for np.zeros but not for e.g. np.empty
 
I assume it's calloc but not malloc's deal
 
 
2 hours later…
5:25 PM
@flawr Ander noticed the same thing in MATLAB: stackoverflow.com/q/51987892/7328782 -- This is an OS thing, it should work also with np.empty?
Yes, it works also with np.empty() (on macOS).
 
5:49 PM
"I made a MWE but didn't run it, I just assume it shows the issue I'm facing." stackoverflow.com/questions/74602906/… (now deleted question).
I really thought this was a good question, you don't see many people offer a MRE without having to be prodded for one. Alas!
That user now posted a different question, this time without a MRE. Just dump all the code, "what is wrong?". Nice! :(
 
 
3 hours later…
8:45 PM
@CrisLuengo excellent explanation, thank you!
 
 
1 hour later…

« first day (2707 days earlier)      last day (514 days later) »