@tensorflow/tfjs-data
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -9,2 +9,3 @@ import { LazyIterator } from './iterators/lazy_iterator'; | ||
filter(predicate: (value: T) => boolean): Dataset<T>; | ||
forEachAsync(f: (input: T) => void): Promise<void>; | ||
forEach(f: (input: T) => void): Promise<void>; | ||
@@ -11,0 +12,0 @@ map<O extends DataElement>(transform: (value: T) => O): Dataset<O>; |
@@ -123,3 +123,3 @@ "use strict"; | ||
}; | ||
Dataset.prototype.forEach = function (f) { | ||
Dataset.prototype.forEachAsync = function (f) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -129,3 +129,3 @@ return __generator(this, function (_a) { | ||
case 0: return [4, this.iterator()]; | ||
case 1: return [2, (_a.sent()).forEach(f)]; | ||
case 1: return [2, (_a.sent()).forEachAsync(f)]; | ||
} | ||
@@ -135,2 +135,11 @@ }); | ||
}; | ||
Dataset.prototype.forEach = function (f) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
return __generator(this, function (_a) { | ||
tf.deprecationWarn('dataset.forEach() is deprecated and will be removed. ' + | ||
'Please use dataset.forEachAsync() instead'); | ||
return [2, this.forEachAsync(f)]; | ||
}); | ||
}); | ||
}; | ||
Dataset.prototype.map = function (transform) { | ||
@@ -137,0 +146,0 @@ var _this = this; |
@@ -22,3 +22,3 @@ import { DataElement, IteratorContainer } from '../types'; | ||
flatmap<O>(transform: (value: T) => O[]): LazyIterator<O>; | ||
forEach(f: (value: T) => void): Promise<void>; | ||
forEachAsync(f: (value: T) => void): Promise<void>; | ||
serialForEach(f: (value: T) => Promise<boolean>): Promise<void>; | ||
@@ -25,0 +25,0 @@ rowMajorBatch(batchSize: number, smallLastBatch?: boolean): LazyIterator<T[]>; |
@@ -174,3 +174,3 @@ "use strict"; | ||
}; | ||
LazyIterator.prototype.forEach = function (f) { | ||
LazyIterator.prototype.forEachAsync = function (f) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
@@ -177,0 +177,0 @@ return __generator(this, function (_a) { |
@@ -76,3 +76,3 @@ "use strict"; | ||
result = {}; | ||
return [4, sampleDataset.forEach(function (e) { | ||
return [4, sampleDataset.forEachAsync(function (e) { | ||
for (var _i = 0, _a = Object.keys(e); _i < _a.length; _i++) { | ||
@@ -116,4 +116,4 @@ var key = _a[_i]; | ||
var valueMoment = tf.moments(value); | ||
valueMean = valueMoment.mean.get(); | ||
valueVariance = valueMoment.variance.get(); | ||
valueMean = valueMoment.mean.dataSync()[0]; | ||
valueVariance = valueMoment.variance.dataSync()[0]; | ||
valueLength = value.size; | ||
@@ -125,4 +125,4 @@ } | ||
var valueMoment = tf.moments(value); | ||
valueMean = valueMoment.mean.get(); | ||
valueVariance = valueMoment.variance.get(); | ||
valueMean = valueMoment.mean.dataSync()[0]; | ||
valueVariance = valueMoment.variance.dataSync()[0]; | ||
valueLength = value.length; | ||
@@ -129,0 +129,0 @@ } |
@@ -1,2 +0,2 @@ | ||
declare const version = "0.2.2"; | ||
declare const version = "0.2.3"; | ||
export { version }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var version = '0.2.2'; | ||
var version = '0.2.3'; | ||
exports.version = version; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@tensorflow/tfjs-data", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "TensorFlow Data API in JavaScript", | ||
@@ -14,3 +14,3 @@ "private": false, | ||
"devDependencies": { | ||
"@tensorflow/tfjs-core": "0.15.2", | ||
"@tensorflow/tfjs-core": "0.15.4", | ||
"@types/fetch-mock": "^6.0.1", | ||
@@ -56,3 +56,3 @@ "@types/jasmine": "~2.5.53", | ||
"peerDependencies": { | ||
"@tensorflow/tfjs-core": "0.15.2" | ||
"@tensorflow/tfjs-core": "0.15.4" | ||
}, | ||
@@ -59,0 +59,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1655827
8649