@@ -67,6 +67,8 @@ extern "C" void debug_cpu_only_mode(bool_t mode) {
6767 } else {
6868 best_device = get_best_device ();
6969 }
70+ std::cout << " Debug CPU only mode: " << (debug_cpu_only ? " ON" : " OFF" ) << std::endl;
71+ std::cout.flush ();
7072}
7173
7274extern " C" bool_t accelerator_available () {
@@ -131,20 +133,19 @@ extern "C" void free_bridge_tensor(bridge_tensor_t bt) {
131133at::Tensor bridge_to_torch (bridge_tensor_t &bt) {
132134 std::vector<int64_t > sizes_vec (bt.sizes , bt.sizes + bt.dim );
133135 auto shape = torch::IntArrayRef (sizes_vec);
134- return torch::from_blob (bt.data , shape, torch::kFloat32 );
136+ return torch::from_blob (bt.data , shape, torch::kFloat );
135137}
136138
137139at::Tensor bridge_to_torch (bridge_tensor_t &bt,torch::Device device, bool copy,torch::ScalarType dtype = torch::kFloat32 ) {
138140 std::vector<int64_t > sizes_vec (bt.sizes , bt.sizes + bt.dim );
139141 auto shape = torch::IntArrayRef (sizes_vec);
140- auto t = torch::from_blob (bt.data , shape, torch::kFloat32 );
142+ auto t = torch::from_blob (bt.data , shape, torch::kFloat );
141143 if (device != torch::kCPU )
142144 copy = true ;
143145 if (copy)
144146 return t.to (device, dtype, /* non_blocking=*/ false , /* copy=*/ true );
145147 else
146148 return t.to (device, dtype, /* non_blocking=*/ false , /* copy=*/ false );
147-
148149}
149150
150151extern " C" float32_t * unsafe (const float32_t * arr) {
0 commit comments