Socket
Socket
Sign inDemoInstall

@tensorflow/tfjs-data

Package Overview
Dependencies
Maintainers
11
Versions
124
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tensorflow/tfjs-data - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

14

dist/dataset.d.ts

@@ -235,3 +235,3 @@ /**

skip(count: number): Dataset<T>;
static readonly MAX_BUFFER_SIZE: number;
static readonly MAX_BUFFER_SIZE = 10000;
/**

@@ -291,2 +291,14 @@ * Pseudorandomly shuffles the elements of this dataset. This is done in a

toArray(): Promise<T[]>;
/**
* Collect all elements of this dataset into an array with prefetching 100
* elements. This is useful for testing, because the prefetch changes the
* order in which the Promises are resolved along the processing pipeline.
* This may help expose bugs where results are dependent on the order of
* Promise resolution rather than on the logical order of the stream (i.e.,
* due to hidden mutable state).
*
* @returns A Promise for an array of elements, which will resolve
* when a new stream has been obtained and fully consumed.
*/
toArrayForTest(): Promise<T[]>;
}

@@ -293,0 +305,0 @@ /**

@@ -20,5 +20,8 @@ "use strict";

var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -221,3 +224,3 @@ extendStatics(d, b);

else {
// If neither of these two datasets has infinity size and any of these two
// If neither of these two datasets has infinite size and any of these two
// datasets' size is null, the new size is null.

@@ -598,4 +601,8 @@ size = null;

switch (_a.label) {
case 0: return [4 /*yield*/, this.iterator()];
case 1: return [2 /*return*/, (_a.sent()).collect()];
case 0:
if (this.size === Infinity) {
throw new Error('Can not convert infinite data stream to array.');
}
return [4 /*yield*/, this.iterator()];
case 1: return [2 /*return*/, (_a.sent()).toArray()];
}

@@ -605,2 +612,27 @@ });

};
/**
* Collect all elements of this dataset into an array with prefetching 100
* elements. This is useful for testing, because the prefetch changes the
* order in which the Promises are resolved along the processing pipeline.
* This may help expose bugs where results are dependent on the order of
* Promise resolution rather than on the logical order of the stream (i.e.,
* due to hidden mutable state).
*
* @returns A Promise for an array of elements, which will resolve
* when a new stream has been obtained and fully consumed.
*/
Dataset.prototype.toArrayForTest = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
if (this.size === Infinity) {
throw new Error('Can not convert infinite data stream to array.');
}
return [4 /*yield*/, this.iterator()];
case 1: return [2 /*return*/, (_a.sent()).toArrayForTest()];
}
});
});
};
// TODO(soergel): deep sharded shuffle, where supported

@@ -607,0 +639,0 @@ Dataset.MAX_BUFFER_SIZE = 10000;

9

dist/datasets/csv_dataset.js

@@ -20,5 +20,8 @@ "use strict";

var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -25,0 +28,0 @@ extendStatics(d, b);

@@ -20,5 +20,8 @@ "use strict";

var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -25,0 +28,0 @@ extendStatics(d, b);

@@ -20,5 +20,8 @@ "use strict";

var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -25,0 +28,0 @@ extendStatics(d, b);

@@ -20,5 +20,8 @@ "use strict";

var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -25,0 +28,0 @@ extendStatics(d, b);

@@ -121,8 +121,13 @@ /**

*
* @param maxItems the maximum number of items to return. If the stream
* terminates, fewer items will be returned. (default 1000)
* @param prefetch the size of the prefetch buffer to use when collecting
* items. Some amount of prefetch is important to test parallel streams,
* i.e. with multiple Promises outstanding. Without prefetch, this method
* makes purely serial next() calls.
* @returns A Promise for an array of stream elements, which will resolve
* when the stream is exhausted.
*/
toArray(): Promise<T[]>;
/**
* Collect all elements of this dataset into an array with prefetching 100
* elements. This is useful for testing, because the prefetch changes the
* order in which the Promises are resolved along the processing pipeline.
* This may help expose bugs where results are dependent on the order of
* Promise resolution rather than on the logical order of the stream (i.e.,
* due to hidden mutable state).
*

@@ -132,3 +137,3 @@ * @returns A Promise for an array of stream elements, which will resolve

*/
collect(maxItems?: number, prefetch?: number): Promise<T[]>;
toArrayForTest(): Promise<T[]>;
/**

@@ -135,0 +140,0 @@ * Draw items from the stream until it is exhausted.

@@ -20,5 +20,8 @@ "use strict";

var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -187,8 +190,35 @@ extendStatics(d, b);

*
* @param maxItems the maximum number of items to return. If the stream
* terminates, fewer items will be returned. (default 1000)
* @param prefetch the size of the prefetch buffer to use when collecting
* items. Some amount of prefetch is important to test parallel streams,
* i.e. with multiple Promises outstanding. Without prefetch, this method
* makes purely serial next() calls.
* @returns A Promise for an array of stream elements, which will resolve
* when the stream is exhausted.
*/
LazyIterator.prototype.toArray = function () {
return __awaiter(this, void 0, void 0, function () {
var result, x;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
result = [];
return [4 /*yield*/, this.next()];
case 1:
x = _a.sent();
_a.label = 2;
case 2:
if (!!x.done) return [3 /*break*/, 4];
result.push(x.value);
return [4 /*yield*/, this.next()];
case 3:
x = _a.sent();
return [3 /*break*/, 2];
case 4: return [2 /*return*/, result];
}
});
});
};
/**
* Collect all elements of this dataset into an array with prefetching 100
* elements. This is useful for testing, because the prefetch changes the
* order in which the Promises are resolved along the processing pipeline.
* This may help expose bugs where results are dependent on the order of
* Promise resolution rather than on the logical order of the stream (i.e.,
* due to hidden mutable state).
*

@@ -198,13 +228,10 @@ * @returns A Promise for an array of stream elements, which will resolve

*/
LazyIterator.prototype.collect = function (maxItems, prefetch) {
if (maxItems === void 0) { maxItems = 1000; }
if (prefetch === void 0) { prefetch = 100; }
LazyIterator.prototype.toArrayForTest = function () {
return __awaiter(this, void 0, void 0, function () {
var stream, result, count, x;
var stream, result, x;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
stream = prefetch > 0 ? this.prefetch(prefetch) : this;
stream = this.prefetch(100);
result = [];
count = 0;
return [4 /*yield*/, stream.next()];

@@ -217,6 +244,2 @@ case 1:

result.push(x.value);
count++;
if (count >= maxItems) {
return [2 /*return*/, result];
}
return [4 /*yield*/, stream.next()];

@@ -442,5 +465,3 @@ case 3:

if (smallLastBatch === void 0) { smallLastBatch = true; }
if (zipFn === void 0) {
// tslint:disable-next-line:no-any
zipFn = deep_map_1.zipToList; }
if (zipFn === void 0) { zipFn = deep_map_1.zipToList; }
// First collect the desired number of input elements as a row-major batch.

@@ -447,0 +468,0 @@ var rowBatches = this.rowMajorBatch(batchSize, smallLastBatch);

@@ -20,5 +20,8 @@ "use strict";

var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -25,0 +28,0 @@ extendStatics(d, b);

@@ -150,3 +150,3 @@ /**

* }
* const ds = tfd.generator(makeIterator);
* const ds = tf.data.generator(makeIterator);
* ds.forEachAsync(e => console.log(e));

@@ -167,3 +167,3 @@ * ```

*
* const ds = tfd.generator(dataGenerator);
* const ds = tf.data.generator(dataGenerator);
* ds.forEachAsync(e => console.log(e));

@@ -170,0 +170,0 @@ * ```

@@ -199,3 +199,3 @@ "use strict";

* }
* const ds = tfd.generator(makeIterator);
* const ds = tf.data.generator(makeIterator);
* ds.forEachAsync(e => console.log(e));

@@ -216,3 +216,3 @@ * ```

*
* const ds = tfd.generator(dataGenerator);
* const ds = tf.data.generator(dataGenerator);
* ds.forEachAsync(e => console.log(e));

@@ -219,0 +219,0 @@ * ```

@@ -20,5 +20,8 @@ "use strict";

var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -25,0 +28,0 @@ extendStatics(d, b);

@@ -20,5 +20,8 @@ "use strict";

var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -25,0 +28,0 @@ extendStatics(d, b);

@@ -20,5 +20,8 @@ "use strict";

var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {

@@ -25,0 +28,0 @@ extendStatics(d, b);

/** @license See the LICENSE file. */
declare const version = "1.0.0";
declare const version = "1.0.1";
export { version };

@@ -5,4 +5,4 @@ "use strict";

// This code is auto-generated, do not modify this file!
var version = '1.0.0';
var version = '1.0.1';
exports.version = version;
//# sourceMappingURL=version.js.map
{
"name": "@tensorflow/tfjs-data",
"version": "1.0.0",
"version": "1.0.1",
"description": "TensorFlow Data API in JavaScript",

@@ -14,3 +14,3 @@ "private": false,

"devDependencies": {
"@tensorflow/tfjs-core": "1.0.0",
"@tensorflow/tfjs-core": "1.0.1",
"@types/fetch-mock": "^6.0.1",

@@ -41,3 +41,3 @@ "@types/jasmine": "~2.5.53",

"tslint": "~5.11.0",
"typescript": "2.9.2",
"typescript": "3.3.3333",
"yalc": "^1.0.0-pre.23"

@@ -57,3 +57,3 @@ },

"peerDependencies": {
"@tensorflow/tfjs-core": "1.0.0"
"@tensorflow/tfjs-core": "1.0.1"
},

@@ -60,0 +60,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 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 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 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 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 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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc