I think the proper approach would be to use the AutoDefaultDtypeMode RAII in libtorch via:
AutoDefaultDtypeMode dtype_mode(default_dtype);

auto tensor = torch::tensor(1.f); // should be created in the default_dtype

where default_dtype is c10::ScalarType.