In testing various types for an api, I was unable to create a scalar of half type from CPU
(not a typical case)
e.g.
#include “ATen/ATen.h”
using namespace at;
int main() {
auto x=CPU(kHalf).scalarTensor(0.0);
}
libc++abi.dylib: terminating with uncaught exception of type at::Error
Abort trap: 6
Is there a better way to do this?
something like this seems to work:
x=CPU(kFloat).scalarTensor(0.0).toType(kHalf);
Thanks