From 80d0469be122c53334a6bc8a9313dc9bd2c2c944 Mon Sep 17 00:00:00 2001 From: Jack Atkinson Date: Wed, 4 Dec 2024 12:15:25 +0000 Subject: [PATCH] Break the cpp in ctorch.cpp, shopuld be caught by clang checker. --- src/ctorch.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ctorch.cpp b/src/ctorch.cpp index efdc2f0b..1c4e9409 100644 --- a/src/ctorch.cpp +++ b/src/ctorch.cpp @@ -11,6 +11,7 @@ constexpr auto get_dtype(torch_data_t dtype) { exit(EXIT_FAILURE); case torch_kInt8: return torch::kInt8; + case torch_kInt16: return torch::kInt16; case torch_kInt32: @@ -42,8 +43,7 @@ const auto get_device(torch_device_t device_type, int device_index) { return torch::Device(torch::kCPU); case torch_kCUDA: if (device_index == -1) { - std::cerr << "[WARNING]: device index unset, defaulting to 0" - << std::endl; + std::cerr << "[WARNING]: device index unset, defaulting to 0" << std::endl; device_index = 0; } if (device_index >= 0 && device_index < torch::cuda::device_count()) { @@ -66,9 +66,7 @@ void set_is_training(torch_jit_script_module_t module, auto model = static_cast(module); if (is_training) { model->train(); - } else { - model->eval(); - } + } else {model->eval();} } torch_tensor_t torch_zeros(int ndim, const int64_t *shape, torch_data_t dtype,