Published
Edited
Aug 15, 2018
1 fork
1 star
Insert cell
Insert cell
Insert cell
{
return tf.ENV.backend.getGPGPUContext().gl
}
Insert cell
Insert cell
{
const mygl = document.createElement('canvas').getContext('webgl2');
const gpgpu = new tf.webgl.GPGPUContext(mygl);
tf.ENV.registerBackend('custom-webgl', () => {
return new tf.webgl.MathBackendWebGL(gpgpu);
});
tf.setBackend('custom-webgl');
// Squaring a tensor with a custom context.
return tf.square(4).get();
}
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more