This is a bug with inconsistent behavior between af_join() and af_join_many()
af_join() will retain the original array if the second array is empty
af_join_many() will throw an error if it receives an empty array.
The docs do currently specify "Requires that all dimensions except the join dimension must be the same for all arrays." however we can handle this special case and behavior should be consistent between functions.
Example code snippet for reproducing:
auto a = af::array(); // empty
auto b = af::randu(9);
auto c = af::join(2, a, b); // works
std::vector<af_array> arrs = {a.get(), b.get()};
af_array out = nullptr;
AF_CHECK(af_join_many(&handle, axis, arrs.size(), arrs.data())); // fails with:
// C++ exception with description "ArrayFire Exception (Invalid input size:203):