The previous implementation did not compile if an application would also use
other archive formats (at least not for me on macOS). Hence, for maximum
flexibility, provide tensor serialization methods for all archive formats
offered by Cereal. For binary archives, we can use an efficient implementation
(the previous one) which avoids extra copies. For other archives, fall back to
serializing a vector instead.
The previous implementation did not compile if an application would also use other archive formats (at least not for me on macOS). Hence, for maximum flexibility, provide tensor serialization methods for all archive formats offered by Cereal. For binary archives, we can use an efficient implementation (the previous one) which avoids extra copies. For other archives, fall back to serializing a vector instead.