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.

ArrayInterface.is_forwarding_wrapperFunction
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.

source
ArrayInterface.bufferFunction
buffer(x)

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

source

Additional Array Wrapping Libraries

If dealing with array wrappers, additionally consider:

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