@mineproness/tensorloop 2.1.57 → 2.1.58

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mineproness/tensorloop",
3
- "version": "2.1.57",
3
+ "version": "2.1.58",
4
4
  "description": "Raw-JAVASCRIPT Based Matirx and AI LLM Package called Tensorloop.",
5
5
  "keywords": [
6
6
  "ai",
@@ -42,7 +42,7 @@ export class OperationManager {
42
42
  return result
43
43
  }
44
44
  getShaderPipline(filename, value = { "embedding": 123 }, entryPoint = "main") {
45
- let readShaderCode = fs.readFileSync(path.join(__dirname, filename), "utf-8");
45
+ let readShaderCode = fs.readFileSync(path.join(__dirname, `../${filename}`), "utf-8");
46
46
  if (value) {
47
47
  for (const a in value) {
48
48
  readShaderCode = readShaderCode.replaceAll(`%${a}%`, value[a])
@@ -67,10 +67,10 @@ export class OperationManager {
67
67
  const pass = encoder.beginComputePass();
68
68
  pass.setPipeline(pipline)
69
69
  pass.setBindGroup(0, binding)
70
- pass.dispatchWorkgroups(dispatchWorkgroups, y , z)
70
+ pass.dispatchWorkgroups(dispatchWorkgroups, y, z)
71
71
  pass.end()
72
72
  }
73
-
73
+
74
74
  async MakeACopyBuffer(encoder, sourceBuffer) {
75
75
  const buffer = this.device.createBuffer({
76
76
  size: sourceBuffer.size,
@@ -79,22 +79,22 @@ export class OperationManager {
79
79
  encoder.copyBufferToBuffer(sourceBuffer, 0, buffer, 0, sourceBuffer.size);
80
80
  return buffer
81
81
  }
82
- CreateEncoder(){
82
+ CreateEncoder() {
83
83
  return this.device.createCommandEncoder()
84
84
  }
85
- createBindGroup(shader,groupNum,ent){
85
+ createBindGroup(shader, groupNum, ent) {
86
86
  return this.device.createBindGroup({
87
87
  layout: shader.getBindGroupLayout(groupNum),
88
- entries: ent.map((e, x)=>{
88
+ entries: ent.map((e, x) => {
89
89
  return {
90
- binding : x,
91
- resource: e
90
+ binding: x,
91
+ resource: e
92
92
  }
93
93
  })
94
94
  })
95
95
  }
96
- async submitQueue(encoder){
97
- this.device.queue.submit([encoder.finish()])
96
+ async submitQueue(encoder) {
97
+ this.device.queue.submit([encoder.finish()])
98
98
  }
99
99
 
100
100
  }