-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
290 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -254,7 +254,7 @@ console.log(`1 xor 1 = ${out4[0]} (should be close to 0)`); | |
### Documentation | ||
|
||
The full documentation for Netsaur can be found | ||
[here](https://deno.land/x/[email protected]/mod.ts). | ||
[here](https://deno.land/x/[email protected]-patch/mod.ts). | ||
|
||
### License | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,7 +74,7 @@ | |
" setupBackend,\n", | ||
" SigmoidLayer,\n", | ||
" tensor2D,\n", | ||
"} from \"https://deno.land/x/[email protected]/mod.ts\";\n", | ||
"} from \"https://deno.land/x/[email protected]-patch/mod.ts\";\n", | ||
"\n", | ||
"await setupBackend(AUTO);\n", | ||
"\n", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// deno-lint-ignore-file | ||
// deno-fmt-ignore-file | ||
|
||
export interface InstantiateResult { | ||
instance: WebAssembly.Instance; | ||
exports: { | ||
wasm_backend_create: typeof wasm_backend_create; | ||
wasm_backend_train: typeof wasm_backend_train; | ||
wasm_backend_predict: typeof wasm_backend_predict; | ||
wasm_backend_save: typeof wasm_backend_save; | ||
wasm_backend_load: typeof wasm_backend_load | ||
}; | ||
} | ||
|
||
/** Gets if the Wasm module has been instantiated. */ | ||
export function isInstantiated(): boolean; | ||
|
||
/** Options for instantiating a Wasm instance. */ | ||
export interface InstantiateOptions { | ||
/** Optional url to the Wasm file to instantiate. */ | ||
url?: URL; | ||
/** Callback to decompress the raw Wasm file bytes before instantiating. */ | ||
decompress?: (bytes: Uint8Array) => Uint8Array; | ||
} | ||
|
||
/** Instantiates an instance of the Wasm module returning its functions. | ||
* @remarks It is safe to call this multiple times and once successfully | ||
* loaded it will always return a reference to the same object. */ | ||
export function instantiate(opts?: InstantiateOptions): Promise<InstantiateResult["exports"]>; | ||
|
||
/** Instantiates an instance of the Wasm module along with its exports. | ||
* @remarks It is safe to call this multiple times and once successfully | ||
* loaded it will always return a reference to the same object. */ | ||
export function instantiateWithInstance(opts?: InstantiateOptions): Promise<InstantiateResult>; | ||
|
||
/** | ||
* @param {string} config | ||
* @param {Array<any>} shape | ||
* @returns {number} | ||
*/ | ||
export function wasm_backend_create(config: string, shape: Array<any>): number; | ||
/** | ||
* @param {number} id | ||
* @param {(Float32Array)[]} buffers | ||
* @param {string} options | ||
*/ | ||
export function wasm_backend_train(id: number, buffers: (Float32Array)[], options: string): void; | ||
/** | ||
* @param {number} id | ||
* @param {Float32Array} buffer | ||
* @param {string} options | ||
* @returns {Float32Array} | ||
*/ | ||
export function wasm_backend_predict(id: number, buffer: Float32Array, options: string): Float32Array; | ||
/** | ||
* @param {number} id | ||
* @returns {Uint8Array} | ||
*/ | ||
export function wasm_backend_save(id: number): Uint8Array; | ||
/** | ||
* @param {Uint8Array} buffer | ||
* @param {Array<any>} shape | ||
* @returns {number} | ||
*/ | ||
export function wasm_backend_load(buffer: Uint8Array, shape: Array<any>): number; |
Oops, something went wrong.