@@ -41,7 +41,7 @@ bridge_tensor_t torch_to_bridge(torch::Tensor &tensor) {
4141 bridge_tensor_t result;
4242 result.created_by_c = true ;
4343 result.dim = tensor.dim ();
44- result.sizes = new int [result.dim ];
44+ result.sizes = new int32_t [result.dim ];
4545 for (int i = 0 ; i < result.dim ; ++i) {
4646 result.sizes [i] = tensor.size (i);
4747 }
@@ -182,9 +182,9 @@ extern "C" bridge_tensor_t matmul(bridge_tensor_t a, bridge_tensor_t b) {
182182 auto t_a = bridge_to_torch (a);
183183 auto t_b = bridge_to_torch (b);
184184
185- std::cout << " Input A shape: " << t_a.sizes () << std::endl;
186- std::cout << " Input B shape: " << t_b.sizes () << std::endl;
187- std::cout.flush ();
185+ // std::cout << "Input A shape: " << t_a.sizes() << std::endl;
186+ // std::cout << "Input B shape: " << t_b.sizes() << std::endl;
187+ // std::cout.flush();
188188
189189 auto output = torch::matmul (t_a, t_b);
190190
@@ -193,12 +193,23 @@ extern "C" bridge_tensor_t matmul(bridge_tensor_t a, bridge_tensor_t b) {
193193 // std::cout << "Input A: " << t_a.sum() << std::endl;
194194 // std::cout << "Input B: " << t_b.sum() << std::endl;
195195 // // std::cout << "Input B: " << t_b << std::endl;
196- std::cout << " Output shape: " << output.sizes () << std::endl;
197- std::cout << " Output sum: " << output.sum () << std::endl;
198- std::cout.flush ();
196+ // std::cout << "Output shape: " << output.sizes() << std::endl;
197+ // std::cout << "Output sum: " << output.sum() << std::endl;
198+ // std::cout.flush();
199199 // printf("Hello from matmul!\n");
200-
201200 return torch_to_bridge (output);
201+
202+ // auto output_copy = output.clone();
203+ // std::cout << "Output copy shape: " << output_copy.sizes() << std::endl;
204+ // std::cout.flush();
205+
206+ // auto bt = torch_to_bridge(output_copy);
207+ // std::cout << "Bridge tensor sizes: " << bt.sizes << std::endl;
208+ // std::cout << "Bridge tensor dim: " << bt.dim << std::endl;
209+
210+ // std::cout.flush();
211+
212+ // return bt;
202213}
203214
204215extern " C" bridge_tensor_t max_pool2d (
0 commit comments