Rename parameters in native code to be more standardized#1513
Conversation
68a3f22 to
337f6f9
Compare
8906ed4 to
78fe15b
Compare
|
@alinpahontu2912 is this fine to merge? |
a7523e5 to
392e21f
Compare
|
The CI appears to be hit-and-miss. |
392e21f to
83fdf1f
Compare
83fdf1f to
b1c83be
Compare
|
Hey @ds5678, why do we need these changes? |
|
It would make my downstream code generation simpler if these parameter names in the header are changed, which I've done in this pull request. Anywhere there's a deviation from the naming scheme (which is rare), I have to write additional code downstream to rename. |
b1c83be to
96ac9c6
Compare
|
@alinpahontu2912 Can this be merged? |
9bf8c23 to
b40102e
Compare
b40102e to
714368f
Compare
714368f to
146c2da
Compare
This aligns parameter naming for these functions with the rest of the project. See also: https://github.com/AssetRipper/AssetRipper.Bindings.LibTorchSharp/blob/a76753d26df195f667c003f8f10b3085882168a0/AssetRipper.Bindings.LibTorchSharp.SourceGenerator/ParameterNameChanges.cs#L7-L12
146c2da to
02f5905
Compare
There was a problem hiding this comment.
Pull request overview
Standardizes native API parameter names in LibTorchSharp headers/implementations to align with existing project conventions (and downstream bindings/source generation expectations).
Changes:
- Renamed single-result allocator parameters from
allocator1→allocatorfor consistency. - Renamed first allocator parameters in paired-allocation APIs from
allocator→allocator1to match the existingallocator1/allocator2pattern. - Updated corresponding
.cppimplementations to match the updated header declarations.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Native/LibTorchSharp/THSNN.h | Renames THSNN_Module_get_parameters allocator parameter to allocator (single allocator case). |
| src/Native/LibTorchSharp/THSModule.cpp | Updates THSNN_Module_get_parameters implementation signature and call site to use allocator. |
| src/Native/LibTorchSharp/THSJIT.h | Renames first allocator parameters to allocator1 where an allocator2 is also present. |
| src/Native/LibTorchSharp/THSJIT.cpp | Updates implementations to call allocator1 consistently with the header. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This aligns parameter naming for these functions with the rest of the project.
See also: https://github.com/AssetRipper/AssetRipper.Bindings.LibTorchSharp/blob/a76753d26df195f667c003f8f10b3085882168a0/AssetRipper.Bindings.LibTorchSharp.SourceGenerator/ParameterNameChanges.cs#L7-L12