core/tensor/native_lib_download library

Auto-fetch the prebuilt native CUDA library (libmat_mul.so / mat_mul.dll / libmat_mul.dylib).

Users normally don't call this — engine does it implicitly the first time a GPU op runs. Call it manually from a top-level await if you want to control download timing (or bail on an unsupported platform) before the first tensor allocation.

Constants

kDartPytorchVersion → const String
Package version this build was published as. Used to construct the GitHub Releases URL. Bump this together with pubspec.yaml on every release so users pull binaries built from the same source.
kDefaultReleaseUrlBase → const String
Prefix of the GitHub Releases URL the auto-download uses. Set DART_PYTORCH_NATIVE_URL at runtime to point elsewhere (mirror, LAN cache, air-gapped setup).

Functions

ensureNativeLib({String? version, String? urlBase, bool prompt = false, IOSink? log}) Future<String>
Returns the absolute path of the native library on this host, downloading a prebuilt from the kDartPytorchVersion GitHub release into <cwd>/native/lib/ if it is missing.