Skip to content

Commit 0c8e276

Browse files
committed
Fix THSJIT_TensorType_sizes signature
All the other functions with an allocator use size_t. In addition, the `sz` variable in the implementation is `size_t`, and the p/invoke method in `LibTorchSharp.THSJIT.cs` uses the same delegate as the others.
1 parent 152e884 commit 0c8e276

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Native/LibTorchSharp/THSJIT.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ int8_t THSJIT_TensorType_dtype(const JITTensorType type)
599599
}
600600
}
601601

602-
void THSJIT_TensorType_sizes(const JITTensorType type, int64_t* (*allocator)(int64_t length))
602+
void THSJIT_TensorType_sizes(const JITTensorType type, int64_t* (*allocator)(size_t length))
603603
{
604604
//CATCH(
605605
auto& t = *type;

src/Native/LibTorchSharp/THSJIT.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ EXPORT_API(int8_t) THSJIT_Type_kind(JITType handle);
5757
EXPORT_API(void*) THSJIT_Type_cast(const JITType type);
5858

5959
EXPORT_API(int8_t) THSJIT_TensorType_dtype(const JITTensorType type);
60-
EXPORT_API(void) THSJIT_TensorType_sizes(const JITTensorType type, int64_t* (*allocator)(int64_t length));
60+
EXPORT_API(void) THSJIT_TensorType_sizes(const JITTensorType type, int64_t* (*allocator)(size_t length));
6161

6262
EXPORT_API(void) THSJIT_Type_dispose(const JITType type);
6363
EXPORT_API(void) THSJIT_TensorType_dispose(const JITTensorType type);

0 commit comments

Comments
 (0)