From 5515f9ecc7578ed7e5db256a2f566333209d9145 Mon Sep 17 00:00:00 2001 From: Jack Atkinson Date: Tue, 22 Oct 2024 18:18:20 +0100 Subject: [PATCH] Bugfix: Set return type of torch_tensor_get_sizes to be long long int*. --- src/ctorch.cpp | 2 +- src/ctorch.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ctorch.cpp b/src/ctorch.cpp index 59757c0c..82135ab0 100644 --- a/src/ctorch.cpp +++ b/src/ctorch.cpp @@ -234,7 +234,7 @@ int torch_tensor_get_rank(const torch_tensor_t tensor) return t->sizes().size(); } -const long int* torch_tensor_get_sizes(const torch_tensor_t tensor) +const long long int* torch_tensor_get_sizes(const torch_tensor_t tensor) { auto t = reinterpret_cast(tensor); return t->sizes().data(); diff --git a/src/ctorch.h b/src/ctorch.h index 0b25bcf2..db8e40c0 100644 --- a/src/ctorch.h +++ b/src/ctorch.h @@ -125,7 +125,7 @@ EXPORT_C int torch_tensor_get_rank(const torch_tensor_t tensor); * @param Torch Tensor to determine the rank of * @return pointer to the sizes array of the Torch Tensor */ -EXPORT_C const long int* torch_tensor_get_sizes(const torch_tensor_t tensor); +EXPORT_C const long long int* torch_tensor_get_sizes(const torch_tensor_t tensor); /** * Function to delete a Torch Tensor to clean up