To fix this, these methods need an API function that computes the output size of a bijector from the input size, defaulting to the same size.
Alternatively, if Bijectors is meant to support non-array types, such as arbitrary Structs, then these size checks make no sense, and it is perhaps better to generalize this code.
As originally noted in https://github.com/TuringLang/Bijectors.jl/pull/263#issuecomment-1577424300, the following lines assume that inputs and outputs of a bijector have the same shape, which is no longer required:
To fix this, these methods need an API function that computes the output size of a bijector from the input size, defaulting to the same size.
Alternatively, if Bijectors is meant to support non-array types, such as arbitrary
Struct
s, then these size checks make no sense, and it is perhaps better to generalize this code.