![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Simple Node.js N-API module that wraps few pieces of pytorch C++ library (libtorch) to allow loading and running pytorch-trained models in Node.js.
Node.js non-blocking model is great for scheduling heavy computational tasks such as NN inference. This wrapper provides async methods that do not block event loop, so it's possible to use it in a web-service.
This module was made just for fun, to check if it's easily possible to create image style transfer app with Node.js.
With npm: npm i --save libtorchjs
Module binary is pre-built and published using node-pre-gyp
so it's not required to download libtorch/pytorch
or install build tools.
Currently, Linux & Windows builds are available.
const torch = require('libtorchjs');
const input = torch.randn([1, 3, 224, 224]);
torch.load('model.pt', function(err, model) {
model.forward(input, function(err, result) {
const output = result.toUint8Array();
console.log(output);
});
});
The overall goal is to mirror pytorch API where possible. Currently just a few methods are exposed.
Create tensor of specified shape filled with 1's (autograd is disabled) and return Tensor object.
Create tensor of specified shape (autograd is disabled) filled with random values in (0..1) range.
Load traced model async from file and return resulting ScripModule.
Forward tensor async and return resulting Tensor.
Following resources were extremely useful for creating this module:
FAQs
Node.js N-API wrapper for Libtorch
We found that libtorchjs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.