@imaduddin/fastbrain 2.0.3 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,6 +20,8 @@ export class residualConnection {
20
20
  this.output.destroy();
21
21
  this.output = await this.gpu?.createBuffer(new Float32Array(a.buffer.size / 4), "storage");
22
22
  }
23
+ if (!this.addShader)
24
+ this.addShader = await this.gpu?.getPiplineShader("add.wgsl");
23
25
  const bindGroup = await this.gpu?.createBindGroup(this.addShader, [a, b, this.output], 0);
24
26
  await this.gpu?.RunPipline(encoder, this.addShader, bindGroup, Math.ceil((a.buffer.size / 4) / 64));
25
27
  await this.gpu?.SumbitEncoder(encoder);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imaduddin/fastbrain",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "Raw-JAVASCRIPT Based Matirx and AI LLM Package called fastBrain.",
5
5
  "keywords": [
6
6
  "ai",
@@ -20,6 +20,7 @@ export class residualConnection{
20
20
  if(this.output) this.output.destroy()
21
21
  this.output = await this.gpu?.createBuffer(new Float32Array(a.buffer.size / 4), "storage")
22
22
  }
23
+ if(!this.addShader) this.addShader = await this.gpu?.getPiplineShader("add.wgsl")
23
24
  const bindGroup = await this.gpu?.createBindGroup(this.addShader!, [a,b,this.output!], 0)
24
25
  await this.gpu?.RunPipline(encoder, this.addShader!, bindGroup!, Math.ceil((a.buffer.size / 4) / 64))
25
26
  await this.gpu?.SumbitEncoder(encoder!)