import { Context, F } from 'ggml-js/core'
// Create context, two 1D tensors and multiply them
const ctx = Context.init()
const a = ctx.newTensor1D('f32', 1)
const b = ctx.newTensor1D('f32', 1)
const ab = F.mul(a, b)
// Build the computation graph
const graph = ctx.buildForward(ab)
// Set values & compute the graph
a.set(0, 1.5)
b.set(0, 2)
graph.compute()
// Get result
console.log(ab.get(0))
using node.js 20.0.2, tried node 18 too. I am on mac OS 13.4
I am getting
I am running just the sample from the readme:
using node.js 20.0.2, tried node 18 too. I am on mac OS 13.4