torch.get_file_path
function get_file_path(): stringReturns the file path for a module or resource.
In PyTorch, this returns the filesystem path where a module is located. This is used for loading external models, data files, or other resources.
File system paths are not applicable in JavaScript. Use ES6 module imports or fetch URLs for loading external resources instead.
Returns
string– Empty string (file paths not applicable in torch.js)Examples
const path = torch.get_file_path();
// torch.js: returns ''See Also
- PyTorch torch.get_file_path()
- torch.load - Load saved models (uses URLs/Blobs)