Calls to NativeLibrary should not assume explicit paths
- Dominant language
- C#
- Stars
- 1.9k
- Forks
- 228
- PR merge metrics
- No merged PRs in 30d
Description
It seems extremely error-prone to presume to replace the OS-specific library search strategies. It doesn't feel like library developers should assume they have to rewrite how native libraries are found in the system. Application developers should worry about their specific deployments if this doesn't work for them.
This line:
https://github.com/dotnet/TorchSharp/blob/3d01e74707e3058cf82eeca7c6fe99ba13729e2f/src/TorchSharp/Torch.cs#L60
should really just use the [full TryLoad overload](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.nativelibrary.tryload?view=net-8.0#system-runtime-interopservices-nativelibrary-tryload(system-string-system-reflection-assembly-system-nullable((system-runtime-interopservices-dllimportsearchpath))-system-intptr@)).
Contributor guide
Assessment
This issue has not been assessed yet.