tensorgrad 0.0.11 → 0.0.12

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/src/index.ts CHANGED
@@ -1,47 +1,47 @@
1
- // Public surface. Bulb code imports from here.
2
- //
3
- // Phase 1 exports: IR types, op surface, trace driver. Autograd (Phase 2) and
4
- // codegen / compile() (Phase 3+) come later.
5
-
6
- export type { Tensor, Shape, Dtype, OpNode, Graph, CallSite } from './ir.js'
7
- export { ShapeError } from './shape.js'
8
- export { trace, traceInto, paramInput, tensorInput, stateInput } from './trace.js'
9
- export { capture } from './capture.js'
10
- export {
11
- // Element-wise arithmetic. The binops accept Tensor or JS-number for the second arg.
12
- add, sub, mul, div,
13
- // Element-wise unary
14
- sqrt, rsqrt, log, exp, relu,
15
- // Comparisons + select
16
- less, greater, where,
17
- // Reductions over the last axis (other axes via reshape/transpose first)
18
- meanLast, sumLast, sumAll,
19
- // Shape ops
20
- reshape, transpose, swapAxes,
21
- // Linear algebra
22
- matmul, matmulBatched,
23
- // Indexing / casting
24
- oneHot, arange, embedding,
25
- // ML primitives — fused for the transformer
26
- softmaxCausalLast, logSoftmaxLast, whereCausal,
27
- // Slicing
28
- sliceLastRange,
29
- } from './ops.js'
30
-
31
- // Note: addScalar/mulScalar/broadcastTo/sumToShape/constScalar/reluGrad/adam_update_*
32
- // are autograd/optimizer building blocks. They live in ops.ts (so grad.ts and
33
- // adam.ts can import them) but aren't part of the public API — `add`/`mul`
34
- // overload on JS numbers, `where` subsumes the rest.
35
- export { appendGrad, type GradResult } from './grad.js'
36
- export { appendAdam, type AdamConfig, type AdamResult } from './adam.js'
37
- export { planBuffers, type BufferPlan, type BufferSpec, type Writeback, type WritebackDecl } from './buffers.js'
38
- export { emitKernels, type KernelSpec } from './codegen.js'
39
- export { createRuntime, createForwardRuntime, Captures, type CompiledRuntime, type CompiledForward, type RuntimeOpts, type RunOptions, type StepResult, type RunResult } from './runtime.js'
40
- export {
41
- compile, compileToIR, compileModule, compileForward,
42
- type CompiledIR, type CompileModuleOptions, type CompileForwardOptions, type CompileForwardMethodOptions,
43
- type CompiledModule, type CompiledForwardModule,
44
- type InputDecl, type InputDecls, type InputsTensors, type ForwardFn,
45
- } from './compile.js'
46
- export { Module, materializeParams, type InitSpec, type ParamOptions, type MaterializedParams } from './module.js'
47
- export * as nn from './nn.js'
1
+ // Public surface. Bulb code imports from here.
2
+ //
3
+ // Phase 1 exports: IR types, op surface, trace driver. Autograd (Phase 2) and
4
+ // codegen / compile() (Phase 3+) come later.
5
+
6
+ export type { Tensor, Shape, Dtype, OpNode, Graph, CallSite } from './ir.js'
7
+ export { ShapeError } from './shape.js'
8
+ export { trace, traceInto, paramInput, tensorInput, stateInput } from './trace.js'
9
+ export { capture } from './capture.js'
10
+ export {
11
+ // Element-wise arithmetic. The binops accept Tensor or JS-number for the second arg.
12
+ add, sub, mul, div,
13
+ // Element-wise unary
14
+ sqrt, rsqrt, log, exp, relu,
15
+ // Comparisons + select
16
+ less, greater, where,
17
+ // Reductions over the last axis (other axes via reshape/transpose first)
18
+ meanLast, sumLast, sumAll,
19
+ // Shape ops
20
+ reshape, transpose, swapAxes,
21
+ // Linear algebra
22
+ matmul, matmulBatched,
23
+ // Indexing / casting
24
+ oneHot, arange, embedding,
25
+ // ML primitives — fused for the transformer
26
+ softmaxCausalLast, logSoftmaxLast, whereCausal,
27
+ // Slicing
28
+ sliceLastRange,
29
+ } from './ops.js'
30
+
31
+ // Note: addScalar/mulScalar/broadcastTo/sumToShape/constScalar/reluGrad/adam_update_*
32
+ // are autograd/optimizer building blocks. They live in ops.ts (so grad.ts and
33
+ // adam.ts can import them) but aren't part of the public API — `add`/`mul`
34
+ // overload on JS numbers, `where` subsumes the rest.
35
+ export { appendGrad, type GradResult } from './grad.js'
36
+ export { appendAdam, type AdamConfig, type AdamResult } from './adam.js'
37
+ export { planBuffers, type BufferPlan, type BufferSpec, type Writeback, type WritebackDecl } from './buffers.js'
38
+ export { emitKernels, type KernelSpec } from './codegen.js'
39
+ export { createRuntime, createForwardRuntime, Captures, type CompiledRuntime, type CompiledForward, type RuntimeOpts, type RunOptions, type StepResult, type RunResult } from './runtime.js'
40
+ export {
41
+ compile, compileToIR, compileModule, compileForward,
42
+ type CompiledIR, type CompileModuleOptions, type CompileForwardOptions, type CompileForwardMethodOptions,
43
+ type CompiledModule, type CompiledForwardModule,
44
+ type InputDecl, type InputDecls, type InputsTensors, type ForwardFn,
45
+ } from './compile.js'
46
+ export { Module, materializeParams, type InitSpec, type ParamOptions, type MaterializedParams } from './module.js'
47
+ export * as nn from './nn.js'