Julia's Array Wrapping Interface

The following functions make it easier to handle array wrappers, such as Adjoint, which can obscure an underlying array's properties under a layer of indirection.

is_forwarding_wrapper(::Type{T}) -> Bool

Returns true if the type T wraps another data type and does not alter any of its standard interface. For example, if T were an array then its size, indices, and elements would all be equivalent to its wrapped data.


Return the buffer data that x points to. Unlike parent(x::AbstractArray), buffer(x) may not return another array type.

Additional Array Wrapping Libraries

If dealing with array wrappers, additionally consider:

  • Adapt.jl: conversions for handling device (GPU) wrappers.