Skip to content

Instantly share code, notes, and snippets.

View gabrielgellner's full-sized avatar

Gabriel Gellner gabrielgellner

  • Statistics Canada
  • Ottawa
View GitHub Profile
# So that we ensure that dimensions do not drop (Taken from Matt Bauman, the man the legend)
make_reals_one_vectors(x::Real) = x:x
make_reals_one_vectors(x) = x
@Base.propagate_inbounds fullindex(x, I...) = getindex(x, map(make_reals_one_vectors, I)...)
# This code is just taken from Base, where I replace view -> fullindex
macro nodrop(ex)
if Meta.isexpr(ex, :ref)
ex = Base.replace_ref_end!(ex)
if Meta.isexpr(ex, :ref)