I am trying to scale vector of length N into range of 0 to 1. sometimes the allocation is 1 and sometimes allocation becomes 2. I cannot understand why that is happening.
if x is length(1000) 1 allocation happening for output
if x is length 10,000 2 allocation happening.
why? may be that is how vector works?
sample_code:
function scale(X::Vector)::Vector
scale_out = Vector{Float32}(undef, size(X,1))
# Applying formula (x - mean) / std_dev
return scale_out
if I do vector{float64}(undef, size(X,1)) will this be stack allocated or heap allocated??? I have read in cpp that std::array is stack allocated but I can’t find stack allocated array in julia except staticarrays.jl which is suitable only for small arrays(quoted in their github)