Right now every function implemented in C++ that gets exposed to the TS requires substantial, often duplicated validation logic for tensors, models, etc. The scope of this issue is to add lightweight macros so that the boilerplate validation code can be minimized.