catniff 0.5.2 → 0.5.3
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/README.md +1 -0
- package/dist/nn.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -112,6 +112,7 @@ All available APIs are in [`./src/`](./src/) if you want to dig deeper.
|
|
|
112
112
|
|
|
113
113
|
## Examples
|
|
114
114
|
|
|
115
|
+
* [Shakespeare-style text generator](https://github.com/nguyenphuminh/shakespeare-lm).
|
|
115
116
|
* [Simple neural net for XOR calculation](./examples/xornet.js).
|
|
116
117
|
* [Tensors](./examples/tensors.js).
|
|
117
118
|
* [Optimizer](./examples/optim.js).
|
package/dist/nn.js
CHANGED
|
@@ -193,7 +193,7 @@ const state = {
|
|
|
193
193
|
const value = model[key];
|
|
194
194
|
const fullKey = prefix ? `${prefix}.${key}` : key;
|
|
195
195
|
if (value instanceof core_1.Tensor && stateDict[fullKey]) {
|
|
196
|
-
value.replace(new core_1.Tensor(stateDict[fullKey]));
|
|
196
|
+
value.replace(new core_1.Tensor(stateDict[fullKey], { device: value.device }));
|
|
197
197
|
}
|
|
198
198
|
else if (typeof value === "object" && value !== null) {
|
|
199
199
|
this.loadStateDict(value, stateDict, fullKey, visited);
|