From c4269bbd3aff66b6c87ebce62d1eff6fd3c294d2 Mon Sep 17 00:00:00 2001 From: B Harrell Date: Tue, 25 May 2021 11:04:10 -0500 Subject: [PATCH] Revert "TensorFlow Source" This reverts commit 12d53f218ef555ab1e4a531fe0691740885ec74d. --- .../tfjs-core/src/backends/backend.ts | 34 +- .../tfjs-core/src/backends/einsum_util.ts | 220 - .../@tensorflow/tfjs-core/src/ops/browser.ts | 108 +- .../tfjs-core/src/ops/depthwise_conv2d.ts | 4 +- ...depthwise_conv2d_native_backprop_filter.ts | 4 +- .../depthwise_conv2d_native_backprop_input.ts | 4 +- .../@tensorflow/tfjs-core/src/ops/diag.ts | 2 - .../@tensorflow/tfjs-core/src/ops/einsum.ts | 111 - .../tfjs-core/src/ops/fused_types.ts | 3 +- .../tfjs-core/src/ops/fused_util.ts | 3 - .../tfjs-core/src/ops/image/threshold.ts | 163 - .../tfjs-core/src/ops/image/transform.ts | 93 - .../@tensorflow/tfjs-core/src/ops/meshgrid.ts | 93 - .../@tensorflow/tfjs-core/src/ops/ops.ts | 17 +- .../@tensorflow/tfjs-core/src/ops/rand.ts | 2 - .../tfjs-core/src/ops/signal/stft.ts | 9 +- .../src/ops/sparse/sparse_fill_empty_rows.ts | 126 - .../src/ops/sparse/sparse_reshape.ts | 91 - .../@tensorflow/tfjs-core/src/ops/where.ts | 24 +- .../src/optimizers/adadelta_optimizer.ts | 150 - .../src/optimizers/adagrad_optimizer.ts | 116 - .../src/optimizers/adam_optimizer.ts | 180 - .../src/optimizers/adamax_optimizer.ts | 158 - .../src/optimizers/momentum_optimizer.ts | 128 - .../tfjs-core/src/optimizers/optimizer.ts | 173 - .../src/optimizers/optimizer_constructors.ts | 189 - .../src/optimizers/rmsprop_optimizer.ts | 210 - .../tfjs-core/src/optimizers/sgd_optimizer.ts | 96 - .../tfjs-core/src/platforms/platform.ts | 49 - .../src/platforms/platform_browser.ts | 71 - .../tfjs-core/src/platforms/platform_node.ts | 87 - .../tfjs-core/src/public/chained_ops/abs.ts | 32 - .../tfjs-core/src/public/chained_ops/acos.ts | 32 - .../tfjs-core/src/public/chained_ops/acosh.ts | 32 - .../tfjs-core/src/public/chained_ops/add.ts | 32 - .../tfjs-core/src/public/chained_ops/all.ts | 32 - .../tfjs-core/src/public/chained_ops/any.ts | 32 - .../src/public/chained_ops/arg_max.ts | 31 - .../src/public/chained_ops/arg_min.ts | 31 - .../tfjs-core/src/public/chained_ops/as1d.ts | 35 - .../tfjs-core/src/public/chained_ops/as2d.ts | 39 - .../tfjs-core/src/public/chained_ops/as3d.ts | 41 - .../tfjs-core/src/public/chained_ops/as4d.ts | 42 - .../tfjs-core/src/public/chained_ops/as5d.ts | 46 - .../src/public/chained_ops/as_scalar.ts | 38 - .../src/public/chained_ops/as_type.ts | 40 - .../tfjs-core/src/public/chained_ops/asin.ts | 32 - .../tfjs-core/src/public/chained_ops/asinh.ts | 33 - .../tfjs-core/src/public/chained_ops/atan.ts | 32 - .../tfjs-core/src/public/chained_ops/atan2.ts | 31 - .../tfjs-core/src/public/chained_ops/atanh.ts | 33 - .../src/public/chained_ops/avg_pool.ts | 37 - .../public/chained_ops/batch_to_space_nd.ts | 32 - .../src/public/chained_ops/batchnorm.ts | 40 - .../src/public/chained_ops/broadcast_to.ts | 32 - .../tfjs-core/src/public/chained_ops/cast.ts | 33 - .../tfjs-core/src/public/chained_ops/ceil.ts | 32 - .../src/public/chained_ops/clip_by_value.ts | 33 - .../src/public/chained_ops/concat.ts | 34 - .../src/public/chained_ops/conv1d.ts | 39 - .../src/public/chained_ops/conv2d.ts | 40 - .../public/chained_ops/conv2d_transpose.ts | 40 - .../tfjs-core/src/public/chained_ops/cos.ts | 32 - .../tfjs-core/src/public/chained_ops/cosh.ts | 32 - .../src/public/chained_ops/cumsum.ts | 32 - .../src/public/chained_ops/depth_to_space.ts | 32 - .../public/chained_ops/depthwise_conv2d.ts | 41 - .../src/public/chained_ops/dilation2d.ts | 37 - .../tfjs-core/src/public/chained_ops/div.ts | 32 - .../src/public/chained_ops/div_no_nan.ts | 32 - .../tfjs-core/src/public/chained_ops/dot.ts | 31 - .../tfjs-core/src/public/chained_ops/elu.ts | 30 - .../tfjs-core/src/public/chained_ops/equal.ts | 31 - .../tfjs-core/src/public/chained_ops/erf.ts | 32 - .../tfjs-core/src/public/chained_ops/exp.ts | 32 - .../src/public/chained_ops/expand_dims.ts | 31 - .../tfjs-core/src/public/chained_ops/expm1.ts | 33 - .../tfjs-core/src/public/chained_ops/fft.ts | 33 - .../src/public/chained_ops/flatten.ts | 35 - .../tfjs-core/src/public/chained_ops/floor.ts | 33 - .../src/public/chained_ops/floorDiv.ts | 31 - .../src/public/chained_ops/gather.ts | 33 - .../src/public/chained_ops/greater.ts | 31 - .../src/public/chained_ops/greater_equal.ts | 31 - .../tfjs-core/src/public/chained_ops/ifft.ts | 33 - .../tfjs-core/src/public/chained_ops/irfft.ts | 33 - .../src/public/chained_ops/is_finite.ts | 33 - .../src/public/chained_ops/is_inf.ts | 33 - .../src/public/chained_ops/is_nan.ts | 33 - .../src/public/chained_ops/leaky_relu.ts | 31 - .../tfjs-core/src/public/chained_ops/less.ts | 31 - .../src/public/chained_ops/less_equal.ts | 31 - .../local_response_normalization.ts | 33 - .../tfjs-core/src/public/chained_ops/log.ts | 32 - .../tfjs-core/src/public/chained_ops/log1p.ts | 33 - .../src/public/chained_ops/log_sigmoid.ts | 33 - .../src/public/chained_ops/log_softmax.ts | 33 - .../src/public/chained_ops/log_sum_exp.ts | 32 - .../src/public/chained_ops/logical_and.ts | 31 - .../src/public/chained_ops/logical_not.ts | 30 - .../src/public/chained_ops/logical_or.ts | 31 - .../src/public/chained_ops/logical_xor.ts | 31 - .../src/public/chained_ops/mat_mul.ts | 34 - .../tfjs-core/src/public/chained_ops/max.ts | 32 - .../src/public/chained_ops/max_pool.ts | 37 - .../src/public/chained_ops/maximum.ts | 31 - .../tfjs-core/src/public/chained_ops/mean.ts | 31 - .../tfjs-core/src/public/chained_ops/min.ts | 32 - .../src/public/chained_ops/minimum.ts | 31 - .../src/public/chained_ops/mirror_pad.ts | 34 - .../tfjs-core/src/public/chained_ops/mod.ts | 31 - .../tfjs-core/src/public/chained_ops/mul.ts | 31 - .../tfjs-core/src/public/chained_ops/neg.ts | 32 - .../tfjs-core/src/public/chained_ops/norm.ts | 36 - .../src/public/chained_ops/not_equal.ts | 31 - .../src/public/chained_ops/one_hot.ts | 32 - .../src/public/chained_ops/ones_like.ts | 33 - .../tfjs-core/src/public/chained_ops/pad.ts | 33 - .../tfjs-core/src/public/chained_ops/pool.ts | 36 - .../tfjs-core/src/public/chained_ops/pow.ts | 31 - .../tfjs-core/src/public/chained_ops/prelu.ts | 31 - .../tfjs-core/src/public/chained_ops/prod.ts | 32 - .../src/public/chained_ops/reciprocal.ts | 33 - .../chained_ops/register_all_chained_ops.ts | 152 - .../tfjs-core/src/public/chained_ops/relu.ts | 30 - .../tfjs-core/src/public/chained_ops/relu6.ts | 31 - .../src/public/chained_ops/reshape.ts | 31 - .../src/public/chained_ops/reshape_as.ts | 39 - .../src/public/chained_ops/resize_bilinear.ts | 35 - .../chained_ops/resize_nearest_neighbor.ts | 36 - .../src/public/chained_ops/reverse.ts | 31 - .../tfjs-core/src/public/chained_ops/rfft.ts | 33 - .../tfjs-core/src/public/chained_ops/round.ts | 33 - .../tfjs-core/src/public/chained_ops/rsqrt.ts | 33 - .../tfjs-core/src/public/chained_ops/selu.ts | 30 - .../public/chained_ops/separable_conv2d.ts | 41 - .../src/public/chained_ops/sigmoid.ts | 33 - .../tfjs-core/src/public/chained_ops/sign.ts | 32 - .../tfjs-core/src/public/chained_ops/sin.ts | 32 - .../tfjs-core/src/public/chained_ops/sinh.ts | 32 - .../tfjs-core/src/public/chained_ops/slice.ts | 34 - .../src/public/chained_ops/softmax.ts | 33 - .../src/public/chained_ops/softplus.ts | 33 - .../public/chained_ops/space_to_batch_nd.ts | 32 - .../tfjs-core/src/public/chained_ops/split.ts | 32 - .../tfjs-core/src/public/chained_ops/sqrt.ts | 32 - .../src/public/chained_ops/square.ts | 33 - .../public/chained_ops/squared_difference.ts | 32 - .../src/public/chained_ops/squeeze.ts | 31 - .../tfjs-core/src/public/chained_ops/stack.ts | 32 - .../tfjs-core/src/public/chained_ops/step.ts | 33 - .../src/public/chained_ops/strided_slice.ts | 40 - .../tfjs-core/src/public/chained_ops/sub.ts | 31 - .../tfjs-core/src/public/chained_ops/sum.ts | 31 - .../tfjs-core/src/public/chained_ops/tan.ts | 32 - .../tfjs-core/src/public/chained_ops/tanh.ts | 32 - .../tfjs-core/src/public/chained_ops/tile.ts | 32 - .../src/public/chained_ops/to_bool.ts | 38 - .../src/public/chained_ops/to_float.ts | 38 - .../src/public/chained_ops/to_int.ts | 38 - .../tfjs-core/src/public/chained_ops/topk.ts | 33 - .../src/public/chained_ops/transpose.ts | 32 - .../src/public/chained_ops/unique.ts | 32 - .../chained_ops/unsorted_segment_sum.ts | 34 - .../src/public/chained_ops/unstack.ts | 31 - .../tfjs-core/src/public/chained_ops/where.ts | 33 - .../src/public/chained_ops/zeros_like.ts | 33 - .../node_modules/@tensorflow/tfjs-data/.nycrc | 19 - .../@tensorflow/tfjs-data/README.md | 89 - .../@tensorflow/tfjs-data/ROADMAP.md | 18 - .../@tensorflow/tfjs-data/dist/dataset.d.ts | 394 -- .../@tensorflow/tfjs-data/dist/dataset.js | 659 -- .../@tensorflow/tfjs-data/dist/dataset.js.map | 1 - .../tfjs-data/dist/dataset_test.js.map | 1 - .../tfjs-data/dist/datasource.d.ts | 34 - .../@tensorflow/tfjs-data/dist/datasource.js | 30 - .../tfjs-data/dist/datasource.js.map | 1 - .../@tensorflow/tfjs-data/dist/index.d.ts | 24 - .../@tensorflow/tfjs-data/dist/index.js | 24 - .../@tensorflow/tfjs-data/dist/index.js.map | 1 - .../@tensorflow/tfjs-data/dist/readers.d.ts | 254 - .../@tensorflow/tfjs-data/dist/readers.js | 269 - .../@tensorflow/tfjs-data/dist/readers.js.map | 1 - .../tfjs-data/dist/readers_test.js.map | 1 - .../tfjs-data/dist/statistics.d.ts | 69 - .../@tensorflow/tfjs-data/dist/statistics.js | 163 - .../tfjs-data/dist/statistics.js.map | 1 - .../tfjs-data/dist/statistics_test.js.map | 1 - .../@tensorflow/tfjs-data/dist/test_node.d.ts | 17 - .../tfjs-data/dist/test_node.js.map | 1 - .../tfjs-data/dist/tf-data.es2017.js | 4668 ------------- .../tfjs-data/dist/tf-data.es2017.js.map | 1 - .../tfjs-data/dist/tf-data.es2017.min.js | 18 - .../tfjs-data/dist/tf-data.es2017.min.js.html | 3229 --------- .../tfjs-data/dist/tf-data.es2017.min.js.map | 1 - .../tfjs-data/dist/tf-data.fesm.js | 4648 ------------- .../tfjs-data/dist/tf-data.fesm.js.map | 1 - .../tfjs-data/dist/tf-data.fesm.min.js | 18 - .../tfjs-data/dist/tf-data.fesm.min.js.html | 3229 --------- .../tfjs-data/dist/tf-data.fesm.min.js.map | 1 - .../@tensorflow/tfjs-data/dist/tf-data.js | 5415 --------------- .../@tensorflow/tfjs-data/dist/tf-data.js.map | 1 - .../@tensorflow/tfjs-data/dist/tf-data.min.js | 18 - .../tfjs-data/dist/tf-data.min.js.html | 3229 --------- .../tfjs-data/dist/tf-data.min.js.map | 1 - .../tfjs-data/dist/tf-data.node.js | 5411 --------------- .../tfjs-data/dist/tf-data.node.js.map | 1 - .../tfjs-data/dist/tsconfig.tsbuildinfo | 6041 ----------------- .../@tensorflow/tfjs-data/dist/types.d.ts | 161 - .../@tensorflow/tfjs-data/dist/types.js | 18 - .../@tensorflow/tfjs-data/dist/types.js.map | 1 - .../@tensorflow/tfjs-data/dist/version.d.ts | 3 - .../@tensorflow/tfjs-data/package.json | 114 - .../@tensorflow/tfjs-data/tsconfig.json | 12 - .../@tensorflow/tfjs-data/tsconfig.test.json | 12 - 215 files changed, 51 insertions(+), 45638 deletions(-) delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/backends/einsum_util.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/einsum.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/image/threshold.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/image/transform.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/meshgrid.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/sparse/sparse_fill_empty_rows.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/sparse/sparse_reshape.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/adadelta_optimizer.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/adagrad_optimizer.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/adam_optimizer.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/adamax_optimizer.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/momentum_optimizer.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/optimizer.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/optimizer_constructors.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/rmsprop_optimizer.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/sgd_optimizer.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/platforms/platform.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/platforms/platform_browser.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/platforms/platform_node.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/abs.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/acos.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/acosh.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/add.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/all.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/any.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/arg_max.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/arg_min.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as1d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as2d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as3d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as4d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as5d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as_scalar.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as_type.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/asin.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/asinh.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atan.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atan2.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atanh.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/avg_pool.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/batch_to_space_nd.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/batchnorm.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/broadcast_to.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cast.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ceil.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/clip_by_value.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/concat.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv1d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv2d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv2d_transpose.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cos.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cosh.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cumsum.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/depth_to_space.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/depthwise_conv2d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/dilation2d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/div.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/div_no_nan.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/dot.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/elu.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/equal.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/erf.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/exp.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/expand_dims.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/expm1.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/fft.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/flatten.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/floor.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/floorDiv.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/gather.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/greater.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/greater_equal.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ifft.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/irfft.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_finite.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_inf.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_nan.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/leaky_relu.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/less.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/less_equal.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/local_response_normalization.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log1p.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_sigmoid.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_softmax.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_sum_exp.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_and.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_not.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_or.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_xor.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mat_mul.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/max.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/max_pool.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/maximum.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mean.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/min.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/minimum.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mirror_pad.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mod.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mul.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/neg.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/norm.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/not_equal.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/one_hot.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ones_like.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pad.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pool.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pow.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/prelu.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/prod.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reciprocal.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/register_all_chained_ops.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/relu.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/relu6.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reshape.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reshape_as.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/resize_bilinear.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/resize_nearest_neighbor.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reverse.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/rfft.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/round.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/rsqrt.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/selu.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/separable_conv2d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sigmoid.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sign.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sin.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sinh.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/slice.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/softmax.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/softplus.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/space_to_batch_nd.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/split.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sqrt.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/square.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/squared_difference.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/squeeze.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/stack.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/step.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/strided_slice.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sub.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sum.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tan.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tanh.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tile.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_bool.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_float.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_int.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/topk.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/transpose.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unique.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unsorted_segment_sum.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unstack.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/where.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/zeros_like.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/.nycrc delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/README.md delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/ROADMAP.md delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/dataset.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/dataset.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/dataset.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/dataset_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasource.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasource.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasource.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/index.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/index.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/index.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/readers.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/readers.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/readers.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/readers_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/statistics.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/statistics.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/statistics.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/statistics_test.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/test_node.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/test_node.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.es2017.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.es2017.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.es2017.min.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.es2017.min.js.html delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.es2017.min.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.fesm.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.fesm.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.fesm.min.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.fesm.min.js.html delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.fesm.min.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.min.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.min.js.html delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.min.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.node.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.node.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tsconfig.tsbuildinfo delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/types.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/types.js delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/types.js.map delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/version.d.ts delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/package.json delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/tsconfig.json delete mode 100644 Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/tsconfig.test.json diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/backends/backend.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/backends/backend.ts index a6f31c61b..7d0395dc1 100644 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/backends/backend.ts +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/backends/backend.ts @@ -31,15 +31,13 @@ export interface BackendTimingInfo { export interface TensorStorage { read(dataId: DataId): Promise; readSync(dataId: DataId): BackendValues; - disposeData(dataId: DataId, force?: boolean): boolean; + disposeData(dataId: DataId): void; write(values: BackendValues, shape: number[], dtype: DataType): DataId; - move( - dataId: DataId, values: BackendValues, shape: number[], dtype: DataType, - refCount: number): void; + move(dataId: DataId, values: BackendValues, shape: number[], dtype: DataType): + void; memory(): {unreliable: boolean;}; // Backend-specific information. /** Returns number of data ids currently in the storage. */ numDataIds(): number; - refCount(dataId: DataId): number; } /** Convenient class for storing tensor-related data. */ @@ -85,8 +83,6 @@ export interface DataMover { } export interface BackendTimer { - // check if backend timer is available - timerAvailable(): boolean; time(f: () => void): Promise; } @@ -97,14 +93,15 @@ export interface BackendTimer { * methods). */ export class KernelBackend implements TensorStorage, Backend, BackendTimer { - refCount(dataId: DataId): number { - return notYetImplemented('refCount'); - } - incRef(dataId: DataId): void { - return notYetImplemented('incRef'); - } - timerAvailable(): boolean { - return true; + /** + * Decrease the complex ref count for the dataId, this is useful for WebGL + * backend to keep the real and imag components of the complex tensor in sync + * with the engine. WASM and node do not have internal ref count, they will + * use on the default implementation. + * @param dataId + */ + decComplexRef(dataId: DataId): void { + return; } time(f: () => void): Promise { return notYetImplemented('time'); @@ -118,15 +115,14 @@ export class KernelBackend implements TensorStorage, Backend, BackendTimer { numDataIds(): number { return notYetImplemented('numDataIds'); } - disposeData(dataId: object, force?: boolean): boolean { + disposeData(dataId: object): void { return notYetImplemented('disposeData'); } write(values: BackendValues, shape: number[], dtype: DataType): DataId { return notYetImplemented('write'); } - move( - dataId: DataId, values: BackendValues, shape: number[], dtype: DataType, - refCount: number): void { + move(dataId: DataId, values: BackendValues, shape: number[], dtype: DataType): + void { return notYetImplemented('move'); } memory(): {unreliable: boolean; reasons?: string[]} { diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/backends/einsum_util.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/backends/einsum_util.ts deleted file mode 100644 index aef34779f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/backends/einsum_util.ts +++ /dev/null @@ -1,220 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -/** - * Utility functions for computing einsum (tensor contraction and summation - * based on Einstein summation.) - */ - -import {Tensor} from '../tensor'; -import {assert} from '../util_base'; - -const ARROW = '->'; -const ARROW_REGEX = /->/g; -const COMMA = ','; -const ELLIPSIS = '...'; - -/** - * Parse an equation for einsum. - * - * @param equation The einsum equation (e.g., "ij,jk->ik"). - * @param numTensors Number of tensors provided along with `equation`. Used to - * check matching number of input tensors. - * @returns An object consisting of the following fields: - * - allDims: all dimension names as strings. - * - summedDims: a list of all dimensions being summed over, as indices to - * the elements of `allDims`. - * - idDims: indices of the dimensions in each input tensor, as indices to - * the elements of `allDims. - */ -export function decodeEinsumEquation(equation: string, numTensors: number): { - allDims: string[], - summedDims: number[], - idDims: number[][], -} { - equation = equation.replace(/\s/g, ''); // Remove witespace in equation. - const numArrows = - (equation.length - equation.replace(ARROW_REGEX, '').length) / - ARROW.length; - if (numArrows < 1) { - throw new Error('Equations without an arrow are not supported.'); - } else if (numArrows > 1) { - throw new Error(`Equation must contain exactly one arrow ("${ARROW}").`); - } - const [inputString, outputString] = equation.split(ARROW); - assert( - inputString.indexOf(ELLIPSIS) === -1, - () => `The ellipsis notation ("${ELLIPSIS}") is not supported yet.`); - const inputTerms = inputString.split(COMMA); - const numInputs = inputTerms.length; - if (numTensors !== numInputs) { - throw new Error( - `Expected ${numInputs} input tensors, received ${numTensors}`); - } - if (numInputs > 2) { - throw new Error( - 'Support for more than 2 input tensors is not implemented yet.'); - } - - const allDims: string[] = []; - for (let i = 0; i < outputString.length; ++i) { - const dimName = outputString[i]; - if (!inputTerms.some(inputTerm => inputTerm.indexOf(dimName) !== -1)) { - throw new Error( - `Output subscripts contain the label ${dimName} ` + - `not present in the input subscripts.`); - } - if (allDims.indexOf(dimName) === -1) { - allDims.push(dimName); - } - } - for (let i = 0; i < inputString.length; ++i) { - const dimName = inputString[i]; - if (allDims.indexOf(dimName) === -1 && dimName !== COMMA) { - allDims.push(dimName); - } - } - - const idDims: number[][] = new Array(inputTerms.length); - for (let i = 0; i < numInputs; ++i) { - if (new Set(inputTerms[i].split('')).size !== inputTerms[i].length) { - throw new Error( - `Found duplicate axes in input component ${inputTerms[i]}. ` + - `Support for duplicate axes in input is not implemented yet.`); - } - idDims[i] = []; - for (let j = 0; j < inputTerms[i].length; ++j) { - idDims[i].push(allDims.indexOf(inputTerms[i][j])); - } - } - - const numDims = allDims.length; // Number of unique dimensions. - const numOutDims = outputString.length; // Number of output dimensions. - const summedDims: number[] = []; // Dimensions being summed over. - for (let i = numOutDims; i < numDims; ++i) { - summedDims.push(i); - } - return {allDims, summedDims, idDims}; -} - -/** - * Get the permutation for a given input tensor. - * - * @param nDims Total number of dimension of all tensors involved in the einsum - * operation. - * @param idDims Dimension indices involve in the tensor in question. - * @returns An object consisting of the following fields: - * - permutationIndices: Indices to permute the axes of the tensor with. - * - expandDims: Indices to the dimension that need to be expanded from the - * tensor after permutation. - */ -export function getEinsumPermutation(nDims: number, idDims: number[]): - {permutationIndices: number[], expandDims: number[]} { - let permutationIndices: number[] = new Array(nDims); - permutationIndices.fill(-1); - for (let i = 0; i < idDims.length; ++i) { - permutationIndices[idDims[i]] = i; - } - const expandDims: number[] = []; - for (let i = 0; i < nDims; ++i) { - if (permutationIndices[i] === -1) { - expandDims.push(i); - } - } - permutationIndices = permutationIndices.filter(d => d !== -1); - return {permutationIndices, expandDims}; -} - -/** - * Checks that the dimension sizes from different input tensors match the - * equation. - */ -export function checkEinsumDimSizes( - nDims: number, idDims: number[][], tensors: Tensor[]) { - const dimSizes: number[] = new Array(nDims); - for (let i = 0; i < tensors.length; ++i) { - const shape: number[] = tensors[i].shape; - for (let j = 0; j < idDims[i].length; ++j) { - if (dimSizes[idDims[i][j]] === undefined) { - dimSizes[idDims[i][j]] = shape[j]; - } else { - assert( - dimSizes[idDims[i][j]] === shape[j], - () => `Expected dimension ${dimSizes[idDims[i][j]]} at axis ${j} ` + - `of input shaped ${JSON.stringify(shape)}, ` + - `but got dimension ${shape[j]}`); - } - } - } -} - -/** - * Gets path of computation for einsum. - * - * @param summedDims indices to the dimensions being summed over. - * @param idDims A look up table for the dimensions present in each input - * tensor. Each consituent array contains indices for the dimensions in the - * corresponding input tensor. - * - * @return A map with two fields: - * - path: The path of computation, with each element indicating the dimension - * being summed over after the element-wise multiplication in that step. - * - steps: With the same length as `path`. Each element contains the indices - * to the input tensors being used for element-wise multiplication in the - * corresponding step. - */ -export function getEinsumComputePath(summedDims: number[], idDims: number[][]): - {path: number[], steps: number[][]} { - const path: number[] = summedDims; - const steps: number[][] = []; - let nSteps = 0; - if (summedDims.length === 0) { - // Einsum that involes no summing: e.g., transpose and outer product. - path.push(-1); - } - nSteps = summedDims.length + 1; - for (let i = 0; i < nSteps; ++i) { - steps.push([]); - } - const computedTermIndices: number[] = []; - for (let i = 0; i < path.length; ++i) { - const summedDim = path[i]; - const termIndices = findTermsWithDim(idDims, summedDim); - for (const termIndex of termIndices) { - if (computedTermIndices.indexOf(termIndex) === -1) { - steps[i].push(termIndex); - computedTermIndices.push(termIndex); - } - } - } - return {path, steps}; -} - -/** Determines if an axes permutation is the identity permutation. */ -export function isIdentityPermutation(perm: number[]): boolean { - return perm.every((dim: number, index: number) => dim === index); -} - -function findTermsWithDim(idDims: number[][], dim: number): number[] { - const termIndices: number[] = []; - for (let i = 0; i < idDims.length; ++i) { - if (idDims[i].length === 0 || idDims[i].indexOf(dim) !== -1 || dim === -1) { - termIndices.push(i); - } - } - return termIndices; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/browser.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/browser.ts index 56094a693..58ffb8a23 100644 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/browser.ts +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/browser.ts @@ -16,7 +16,6 @@ */ import {ENGINE} from '../engine'; -import {env} from '../environment'; import {FromPixels, FromPixelsAttrs, FromPixelsInputs} from '../kernel_names'; import {getKernel, NamedAttrMap} from '../kernel_registry'; import {Tensor, Tensor2D, Tensor3D} from '../tensor'; @@ -51,8 +50,6 @@ let fromPixels2DContext: CanvasRenderingContext2D; * numChannels value less than 4 allows you to ignore channels. Defaults to * 3 (ignores alpha channel of input image). * - * @returns A Tensor3D with the shape `[height, width, numChannels]`. - * * @doc {heading: 'Browser', namespace: 'browser', ignoreCI: true} */ function fromPixels_( @@ -90,7 +87,8 @@ function fromPixels_( } else if ((pixels as any).getContext != null) { isCanvasLike = true; } else if ( - typeof (ImageBitmap) !== 'undefined' && pixels instanceof ImageBitmap) { + typeof (ImageBitmap) !== 'undefined' && + pixels instanceof ImageBitmap) { isImageBitmap = true; } else { throw new Error( @@ -161,103 +159,6 @@ function fromPixels_( return tensor3d(values, outShape, 'int32'); } -// Helper functions for |fromPixelsAsync| to check whether the input can -// be wrapped into imageBitmap. -function isPixelData(pixels: PixelData|ImageData|HTMLImageElement| - HTMLCanvasElement|HTMLVideoElement| - ImageBitmap): pixels is PixelData { - return (pixels != null) && ((pixels as PixelData).data instanceof Uint8Array); -} - -function isImageBitmapFullySupported() { - return typeof window !== 'undefined' && - typeof (ImageBitmap) !== 'undefined' && - window.hasOwnProperty('createImageBitmap'); -} - -function isNonEmptyPixels(pixels: PixelData|ImageData|HTMLImageElement| - HTMLCanvasElement|HTMLVideoElement|ImageBitmap) { - return pixels != null && pixels.width !== 0 && pixels.height !== 0; -} - -function canWrapPixelsToImageBitmap(pixels: PixelData|ImageData| - HTMLImageElement|HTMLCanvasElement| - HTMLVideoElement|ImageBitmap) { - return isImageBitmapFullySupported() && !(pixels instanceof ImageBitmap) && - isNonEmptyPixels(pixels) && !isPixelData(pixels); -} - -/** - * Creates a `tf.Tensor` from an image in async way. - * - * ```js - * const image = new ImageData(1, 1); - * image.data[0] = 100; - * image.data[1] = 150; - * image.data[2] = 200; - * image.data[3] = 255; - * - * (await tf.browser.fromPixelsAsync(image)).print(); - * ``` - * This API is the async version of fromPixels. The API will first - * check |WRAP_TO_IMAGEBITMAP| flag, and try to wrap the input to - * imageBitmap if the flag is set to true. - * - * @param pixels The input image to construct the tensor from. The - * supported image types are all 4-channel. You can also pass in an image - * object with following attributes: - * `{data: Uint8Array; width: number; height: number}` - * @param numChannels The number of channels of the output tensor. A - * numChannels value less than 4 allows you to ignore channels. Defaults to - * 3 (ignores alpha channel of input image). - * - * @doc {heading: 'Browser', namespace: 'browser', ignoreCI: true} - */ -export async function fromPixelsAsync( - pixels: PixelData|ImageData|HTMLImageElement|HTMLCanvasElement| - HTMLVideoElement|ImageBitmap, - numChannels = 3) { - let inputs: PixelData|ImageData|HTMLImageElement|HTMLCanvasElement| - HTMLVideoElement|ImageBitmap = null; - - // Check whether the backend needs to wrap |pixels| to imageBitmap and - // whether |pixels| can be wrapped to imageBitmap. - if (env().getBool('WRAP_TO_IMAGEBITMAP') && - canWrapPixelsToImageBitmap(pixels)) { - // Force the imageBitmap creation to not do any premultiply alpha - // ops. - let imageBitmap; - - try { - // wrap in try-catch block, because createImageBitmap may not work - // properly in some browsers, e.g. - // https://bugzilla.mozilla.org/show_bug.cgi?id=1335594 - // tslint:disable-next-line: no-any - imageBitmap = await (createImageBitmap as any)( - pixels as ImageBitmapSource, {premultiplyAlpha: 'none'}); - } catch (e) { - imageBitmap = null; - } - - // createImageBitmap will clip the source size. - // In some cases, the input will have larger size than its content. - // E.g. new Image(10, 10) but with 1 x 1 content. Using - // createImageBitmap will clip the size from 10 x 10 to 1 x 1, which - // is not correct. We should avoid wrapping such resouce to - // imageBitmap. - if (imageBitmap != null && imageBitmap.width === pixels.width && - imageBitmap.height === pixels.height) { - inputs = imageBitmap; - } else { - inputs = pixels; - } - } else { - inputs = pixels; - } - - return fromPixels_(inputs, numChannels); -} - /** * Draws a `tf.Tensor` of pixel values to a byte array or optionally a * canvas. @@ -268,9 +169,8 @@ export async function fromPixelsAsync( * * Returns a promise that resolves when the canvas has been drawn to. * - * @param img A rank-2 tensor with shape `[height, width]`, or a rank-3 tensor - * of shape `[height, width, numChannels]`. If rank-2, draws grayscale. If - * rank-3, must have depth of 1, 3 or 4. When depth of 1, draws + * @param img A rank-2 or rank-3 tensor. If rank-2, draws grayscale. If + * rank-3, must have depth of 1, 3 or 4. When depth of 1, draws * grayscale. When depth of 3, we draw with the first three components of * the depth dimension corresponding to r, g, b and alpha = 1. When depth of * 4, all four components of the depth dimension correspond to r, g, b, a. diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d.ts index cae69ad35..1580b60f6 100644 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d.ts +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d.ts @@ -23,7 +23,6 @@ import {convertToTensor} from '../tensor_util_env'; import {TensorLike} from '../types'; import * as util from '../util'; -import {ExplicitPadding} from './conv_util'; import {op} from './operation'; import {reshape} from './reshape'; @@ -74,8 +73,7 @@ import {reshape} from './reshape'; */ function depthwiseConv2d_( x: T|TensorLike, filter: Tensor4D|TensorLike, - strides: [number, number]|number, - pad: 'valid'|'same'|number|ExplicitPadding, + strides: [number, number]|number, pad: 'valid'|'same'|number, dataFormat: 'NHWC'|'NCHW' = 'NHWC', dilations: [number, number]|number = [1, 1], dimRoundingMode?: 'floor'|'round'|'ceil'): T { diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d_native_backprop_filter.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d_native_backprop_filter.ts index 3a76d65ff..b669c3c3f 100644 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d_native_backprop_filter.ts +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d_native_backprop_filter.ts @@ -20,14 +20,12 @@ import {NamedAttrMap} from '../kernel_registry'; import {Tensor3D, Tensor4D} from '../tensor'; import {NamedTensorMap} from '../tensor_types'; -import {ExplicitPadding} from './conv_util'; import {op} from './operation'; import {reshape} from './reshape'; function depthwiseConv2dNativeBackpropFilter_( x: T, dy: T, filterShape: [number, number, number, number], - strides: [number, number]|number, - pad: 'valid'|'same'|number|ExplicitPadding, + strides: [number, number]|number, pad: 'valid'|'same'|number, dilations: [number, number]|number = [1, 1], dimRoundingMode?: 'floor'|'round'|'ceil'): Tensor4D { let x4D = x as Tensor4D; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d_native_backprop_input.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d_native_backprop_input.ts index 566d83af3..e7934c236 100644 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d_native_backprop_input.ts +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/depthwise_conv2d_native_backprop_input.ts @@ -20,14 +20,12 @@ import {NamedAttrMap} from '../kernel_registry'; import {Tensor3D, Tensor4D} from '../tensor'; import {NamedTensorMap} from '../tensor_types'; -import {ExplicitPadding} from './conv_util'; import {op} from './operation'; import {reshape} from './reshape'; function depthwiseConv2dNativeBackpropInput_( xShape: [number, number, number, number], dy: T, filter: Tensor4D, - strides: [number, number]|number, - pad: 'valid'|'same'|number|ExplicitPadding, + strides: [number, number]|number, pad: 'valid'|'same'|number, dilations: [number, number]|number = [1, 1], dimRoundingMode?: 'floor'|'round'|'ceil'): T { let dy4D = dy as Tensor4D; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/diag.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/diag.ts index 06ff49cdd..5cc118cf6 100644 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/diag.ts +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/diag.ts @@ -43,8 +43,6 @@ import {op} from './operation'; * tf.diag(x).print() * ``` * @param x The input tensor. - * - * @doc {heading: 'Tensors', subheading: 'Creation'} */ function diag_(x: Tensor): Tensor { const $x = convertToTensor(x, 'x', 'diag'); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/einsum.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/einsum.ts deleted file mode 100644 index 3a0318008..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/einsum.ts +++ /dev/null @@ -1,111 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {ENGINE} from '../engine'; -import {Einsum, EinsumAttrs} from '../kernel_names'; -import {NamedAttrMap} from '../kernel_registry'; -import {Tensor} from '../tensor'; -import {NamedTensorMap} from '../tensor_types'; -import {convertToTensor} from '../tensor_util_env'; - -import {op} from './operation'; - -/** - * Tensor contraction over specified indices and outer product. - * - * `einsum` allows defining Tensors by defining their element-wise computation. - * This computation is based on - * [Einstein summation](https://en.wikipedia.org/wiki/Einstein_notation). - * - * Some special cases include: - * - * Matrix multiplication: - * ```js - * const x = tf.tensor2d([[1, 2, 3], [4, 5, 6]]); - * const y = tf.tensor2d([[0, 1], [2, 3], [4, 5]]); - * x.print(); - * y.print(); - * tf.einsum('ij,jk->ik', x, y).print(); - * ``` - * - * Dot product: - * ```js - * const x = tf.tensor1d([1, 2, 3]); - * const y = tf.tensor1d([0, 1, 2]); - * x.print(); - * y.print(); - * tf.einsum('i,i->', x, y).print(); - * ``` - * - * Batch dot product: - * ```js - * const x = tf.tensor2d([[1, 2, 3], [4, 5, 6]]); - * const y = tf.tensor2d([[0, 1, 2], [3, 4, 5]]); - * x.print(); - * y.print(); - * tf.einsum('bi,bi->b', x, y).print(); - * ``` - * - * Outer prouduct: - * ```js - * const x = tf.tensor1d([1, 3, 5]); - * const y = tf.tensor1d([2, 4, 6]); - * x.print(); - * y.print(); - * tf.einsum('i,j->ij', x, y).print(); - * ``` - * - * Matrix transpose: - * ```js - * const x = tf.tensor2d([[1, 2], [3, 4]]); - * x.print(); - * tf.einsum('ij->ji', x).print(); - * ``` - * - * Batch matrix transpose: - * ```js - * const x = tf.tensor3d([[[1, 2], [3, 4]], [[-1, -2], [-3, -4]]]); - * x.print(); - * tf.einsum('bij->bji', x).print(); - * ``` - * - * Limitations: - * - * This implementation of einsum has the following limitations: - * - * - Does not support >2 input tensors. - * - Does not support duplicate axes for any given input tensor. E.g., equation - * 'ii->' is not suppoted. - * - The `...` notation is not supported. - * - * @param equation a string describing the contraction, in the same format as - * [numpy.einsum](https://numpy.org/doc/stable/reference/generated/numpy.einsum.html). - * @param tensors the input(s) to contract (each one a Tensor), whose shapes - * should be consistent with equation. - * @returns The output tensor. - * - * @doc {heading: 'Tensors', subheading: 'Matrices'} - */ -export function einsum_(equation: string, ...tensors: Tensor[]): Tensor { - const $tensors = - tensors.map((t, i) => convertToTensor(t, `tensors${i}`, 'einsum')); - const attrs: EinsumAttrs = {equation}; - return ENGINE.runKernel( - Einsum, $tensors as {} as NamedTensorMap, attrs as {} as NamedAttrMap); -} - -export const einsum = op({einsum_}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/fused_types.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/fused_types.ts index 086e26d0c..878b6d0f5 100644 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/fused_types.ts +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/fused_types.ts @@ -39,5 +39,4 @@ export type FusedBatchMatMulConfig = { leakyreluAlpha?: number }; -export type Activation = - 'linear'|'relu'|'prelu'|'elu'|'relu6'|'leakyrelu'|'sigmoid'; +export type Activation = 'linear'|'relu'|'prelu'|'elu'|'relu6'|'leakyrelu'; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/fused_util.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/fused_util.ts index 5afa311c5..84ca739ad 100644 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/fused_util.ts +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/fused_util.ts @@ -26,7 +26,6 @@ import {prelu} from './prelu'; import {relu} from './relu'; import {relu6} from './relu6'; import {reshape} from './reshape'; -import {sigmoid} from './sigmoid'; import {step} from './step'; import {sum} from './sum'; @@ -70,8 +69,6 @@ export function applyActivation( return prelu(x, preluActivationWeights); } else if (activation === 'leakyrelu') { return leakyRelu(x, leakyreluAlpha); - } else if (activation === 'sigmoid') { - return sigmoid(x); } throw new Error(`Unknown fused activation ${activation}.`); } diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/image/threshold.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/image/threshold.ts deleted file mode 100644 index 0db80e2b3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/image/threshold.ts +++ /dev/null @@ -1,163 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import { Tensor1D, Tensor3D } from '../../tensor'; -import { tensor1d } from '../tensor1d'; -import { TensorLike } from '../../types'; -import { op } from '../operation'; -import { cast } from '../cast'; -import { split } from '../split'; -import { bincount } from '../bincount'; -import { lessEqual } from '../less_equal'; -import { greater } from '../greater'; -import { sum } from '../sum'; -import { add } from '../add'; -import { mul } from '../mul'; -import { div } from '../div'; -import { sub } from '../sub'; -import { round } from '../round'; -import { where } from '../where'; -import { fill } from '../fill'; -import {slice} from '../slice'; -import { range } from '../range'; -import { tensor } from '../tensor'; -import * as util from '../../util'; -import { convertToTensor } from '../../tensor_util_env'; - -/** - * Performs image binarization with corresponding threshold - * (depends on the method)value, which creates a binary image from a grayscale. - * @param image 3d tensor of shape [imageHeight,imageWidth, depth], - * where imageHeight and imageWidth must be positive.The image color - * range should be [0, 255]. - * @param method Optional string from `'binary' | 'otsu'` - * which specifies the method for thresholding. Defaults to 'binary'. - * @param inverted Optional boolean whichspecifies - * if colours should be inverted. Defaults to false. - * @param threshValue Optional number which defines threshold value from 0 to 1. - * Defaults to 0.5. - * @return A 3d tensor of shape [imageHeight,imageWidth, depth], which - * contains binarized image. - */ - -function threshold_( - image: Tensor3D | TensorLike, - method = 'binary', - inverted = false, - threshValue = 0.5 -): Tensor3D { - const $image = convertToTensor(image, 'image', 'threshold'); - - /* 0.2989, 0.5870, 0.1140 are represent luma coefficients in CCIR601. - Reference for converting between RGB and grayscale: https://en.wikipedia.org/wiki/Luma_%28video%29 */ - - const RED_INTENCITY_COEF = 0.2989; - const GREEN_INTENCITY_COEF = 0.5870; - const BLUE_INTENCITY_COEF = 0.1140; - const totalPixelsInImage = $image.shape[0] * $image.shape[1]; - - let $threshold = mul(tensor1d([threshValue]), 255); - let r, g, b, grayscale; - - util.assert( - $image.rank === 3, - () => 'Error in threshold: image must be rank 3,' + - `but got rank ${$image.rank}.`); - - util.assert( - $image.shape[2] === 3 || $image.shape[2]=== 1, - () => 'Error in threshold: ' + - 'image color channel must be equal to 3 or 1' + - `but got ${$image.shape[2]}.`); - - util.assert( - $image.dtype === 'int32' || $image.dtype === 'float32', - () => 'Error in dtype: image dtype must be int32 or float32,' + - `but got dtype ${$image.dtype}.`); - - util.assert( - method === 'otsu' || method === 'binary', - () => `Method must be binary or otsu, but was ${method}`); - - if ($image.shape[2] === 3) { - [r, g, b] = split($image, [1, 1, 1], -1); - const $r = mul(r,RED_INTENCITY_COEF); - const $g = mul(g,GREEN_INTENCITY_COEF); - const $b = mul(b,BLUE_INTENCITY_COEF); - grayscale = add(add($r, $g), $b); - } else { - grayscale = image; - } - - if (method === 'otsu') { - const $histogram = bincount(cast(round(grayscale), 'int32') as Tensor1D, - tensor([]), - 256); - $threshold = otsu($histogram, totalPixelsInImage); - } - - const invCondition = inverted ? - lessEqual(grayscale, $threshold) : greater(grayscale, $threshold); - - const result = cast(mul(invCondition,255), 'int32'); - - return result as Tensor3D; -} - -function otsu(histogram: Tensor1D, total: number):Tensor1D { - - let bestThresh = tensor1d([-1]); - let bestInBetVar = tensor1d([0]); - let cInBetVar = tensor1d([0]); - let classFirst, classSecond, meanFirst, - meanSec, weightForeground, weightBack; - - for (let index = 0; index < histogram.size-1; index++) { - - classFirst = slice(histogram, 0, index + 1); - - classSecond = slice(histogram,index + 1); - - weightForeground = div(sum(classFirst),total); - - weightBack = div(sum(classSecond),total); - - const meanFirstDivA = sum(mul(classFirst, range(0, classFirst.size))); - - meanFirst = div(meanFirstDivA, sum(classFirst) ); - - const meanSecFill = fill(classSecond.shape, classFirst.size); - const meanSecAdd = add(range(0,classSecond.size),meanSecFill); - const meanSecMul = mul(classSecond, (meanSecAdd)); - meanSec = div(sum(meanSecMul), sum(classSecond)); - - const cInBetVarSubA = sub(meanFirst, meanSec); - const cInBetVarSubB = sub(meanFirst, meanSec); - const cInBetVarMul = mul(weightForeground, weightBack); - cInBetVar = mul(mul(cInBetVarMul,cInBetVarSubA), cInBetVarSubB); - - const condition = greater(cInBetVar, bestInBetVar); - - bestInBetVar = where(condition, cInBetVar, bestInBetVar); - - bestThresh = where(condition, tensor1d([index]), bestThresh); - - } - return bestThresh; -} - -export const threshold = op({ threshold_ }); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/image/transform.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/image/transform.ts deleted file mode 100644 index 519f92a5c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/image/transform.ts +++ /dev/null @@ -1,93 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {ENGINE} from '../../engine'; -import {Transform, TransformAttrs, TransformInputs} from '../../kernel_names'; -import {NamedAttrMap} from '../../kernel_registry'; -import {Tensor2D, Tensor4D} from '../../tensor'; -import {NamedTensorMap} from '../../tensor_types'; -import {convertToTensor} from '../../tensor_util_env'; -import {TensorLike} from '../../types'; -import * as util from '../../util'; - -import {op} from '../operation'; - -/** - * Applies the given transform(s) to the image(s). - * - * @param image 4d tensor of shape `[batch, imageHeight, imageWidth, depth]`. - * @param transforms Projective transform matrix/matrices. A tensor1d of length - * 8 or tensor of size N x 8. If one row of transforms is [a0, a1, a2, b0 - * b1, b2, c0, c1], then it maps the output point (x, y) to a transformed - * input point (x', y') = ((a0 x + a1 y + a2) / k, (b0 x + b1 y + b2) / k), - * where k = c0 x + c1 y + 1. The transforms are inverted compared to the - * transform mapping input points to output points. - * @param interpolation Interpolation mode. - * Supported values: 'nearest', 'bilinear'. Default to 'nearest'. - * @param fillMode Points outside the boundaries of the input are filled - * according to the given mode, one of 'constant', 'reflect', 'wrap', - * 'nearest'. Default to 'constant'. - * 'reflect': (d c b a | a b c d | d c b a ) The input is extended by - * reflecting about the edge of the last pixel. - * 'constant': (k k k k | a b c d | k k k k) The input is extended by - * filling all values beyond the edge with the same constant value k. - * 'wrap': (a b c d | a b c d | a b c d) The input is extended by - * wrapping around to the opposite edge. - * 'nearest': (a a a a | a b c d | d d d d) The input is extended by - * the nearest pixel. - * @param fillValue A float represents the value to be filled outside the - * boundaries when fillMode is 'constant'. - * @param Output dimension after the transform, [height, width]. If undefined, - * output is the same size as input image. - * - * @doc {heading: 'Operations', subheading: 'Images', namespace: 'image'} - */ -function transform_( - image: Tensor4D|TensorLike, transforms: Tensor2D|TensorLike, - interpolation: 'nearest'|'bilinear' = 'nearest', - fillMode: 'constant'|'reflect'|'wrap'|'nearest' = 'constant', fillValue = 0, - outputShape?: [number, number]): Tensor4D { - const $image = convertToTensor(image, 'image', 'transform', 'float32'); - const $transforms = - convertToTensor(transforms, 'transforms', 'transform', 'float32'); - - util.assert( - $image.rank === 4, - () => 'Error in transform: image must be rank 4,' + - `but got rank ${$image.rank}.`); - - util.assert( - $transforms.rank === 2 && - ($transforms.shape[0] === $image.shape[0] || - $transforms.shape[0] === 1) && - $transforms.shape[1] === 8, - () => `Error in transform: Input transform should be batch x 8 or 1 x 8`); - - util.assert( - outputShape == null || outputShape.length === 2, - () => - 'Error in transform: outputShape must be [height, width] or null, ' + - `but got ${outputShape}.`); - - const inputs: TransformInputs = {image: $image, transforms: $transforms}; - const attrs: - TransformAttrs = {interpolation, fillMode, fillValue, outputShape}; - - return ENGINE.runKernel( - Transform, inputs as {} as NamedTensorMap, attrs as {} as NamedAttrMap); -} - -export const transform = op({transform_}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/meshgrid.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/meshgrid.ts deleted file mode 100644 index 4603527b4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/meshgrid.ts +++ /dev/null @@ -1,93 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {matMul} from './mat_mul'; -import {ones} from './ones'; -import {reshape} from './reshape'; -import {Tensor} from '../tensor'; -import {convertToTensor} from '../tensor_util_env'; -import {TensorLike} from '../types'; -import {sizeFromShape} from '../util_base'; - -/** - * Broadcasts parameters for evaluation on an N-D grid. - * - * Given N one-dimensional coordinate arrays `*args`, returns a list `outputs` - * of N-D coordinate arrays for evaluating expressions on an N-D grid. - * - * Notes: - * `meshgrid` supports cartesian ('xy') and matrix ('ij') indexing conventions. - * When the `indexing` argument is set to 'xy' (the default), the broadcasting - * instructions for the first two dimensions are swapped. - * Examples: - * Calling `const [X, Y] = meshgrid(x, y)` with the tensors - * - * ```javascript - * const x = [1, 2, 3]; - * const y = [4, 5, 6]; - * const [X, Y] = tf.meshgrid(x, y); - * // X = [[1, 2, 3], - * // [1, 2, 3], - * // [1, 2, 3]] - * // Y = [[4, 4, 4], - * // [5, 5, 5], - * // [6, 6, 6]] - * ``` - * - * @param x Tensor with rank geq 1. - * @param y Tensor with rank geq 1. - * @param indexing - * - * @doc {heading: 'Operations', subheading: 'Slicing and Joining'} - */ -export function meshgrid( - x?: T|TensorLike, y?: T|TensorLike, {indexing = 'xy'} = {}): T[] { - if (indexing !== 'xy' && indexing !== 'ij') { - throw new TypeError( - `${indexing} is not a valid third argument to meshgrid`); - } - if (x === undefined) { - return []; - } - let $x = convertToTensor( - x, 'x', 'meshgrid', x instanceof Tensor ? x.dtype : 'float32'); - - if (y === undefined) { - return [$x]; - } - let $y = convertToTensor( - y, 'y', 'meshgrid', y instanceof Tensor ? y.dtype : 'float32'); - - const w = sizeFromShape($x.shape); - const h = sizeFromShape($y.shape); - - if (indexing === 'xy') { - $x = reshape($x, [1, -1]) as T; - $y = reshape($y, [-1, 1]) as T; - return [ - matMul(ones([h, 1], $x.dtype), $x), - matMul($y, ones([1, w], $y.dtype)), - ]; - } - - $x = reshape($x, [-1, 1]) as T; - $y = reshape($y, [1, -1]) as T; - return [ - matMul($x, ones([1, h], $x.dtype)), - matMul(ones([w, 1], $y.dtype), $y), - ]; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/ops.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/ops.ts index 851a1232a..b6d8cf59c 100644 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/ops.ts +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/ops.ts @@ -67,7 +67,6 @@ export {dilation2d} from './dilation2d'; export {div} from './div'; export {divNoNan} from './div_no_nan'; export {dot} from './dot'; -export {einsum} from './einsum'; export {elu} from './elu'; export {equal} from './equal'; export {erf} from './erf'; @@ -106,7 +105,6 @@ export {maxPool3d} from './max_pool_3d'; export {maxPoolWithArgmax} from './max_pool_with_argmax'; export {maximum} from './maximum'; export {mean} from './mean'; -export {meshgrid} from './meshgrid'; export {min} from './min'; export {minimum} from './minimum'; export {mirrorPad} from './mirror_pad'; @@ -248,8 +246,6 @@ import {nonMaxSuppressionPadded} from './image/non_max_suppression_padded'; import {nonMaxSuppressionPaddedAsync} from './image/non_max_suppression_padded_async'; import {resizeBilinear} from './image/resize_bilinear'; import {resizeNearestNeighbor} from './image/resize_nearest_neighbor'; -import {threshold} from './image/threshold'; -import {transform} from './image/transform'; const image = { flipLeftRight, resizeNearestNeighbor, @@ -261,9 +257,7 @@ const image = { nonMaxSuppressionWithScore, nonMaxSuppressionWithScoreAsync, nonMaxSuppressionPadded, - nonMaxSuppressionPaddedAsync, - threshold, - transform + nonMaxSuppressionPaddedAsync }; // linalg namespace @@ -298,12 +292,5 @@ const losses = { softmaxCrossEntropy }; -import {sparseFillEmptyRows} from './sparse/sparse_fill_empty_rows'; -import {sparseReshape} from './sparse/sparse_reshape'; -const sparse = { - sparseFillEmptyRows, - sparseReshape -}; - // Second level exports. -export {image, linalg, losses, spectral, fused, signal, sparse}; +export {image, linalg, losses, spectral, fused, signal}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/rand.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/rand.ts index 8d2db13ba..21e70b900 100644 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/rand.ts +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/rand.ts @@ -30,8 +30,6 @@ import {op} from './operation'; * @param randFunction A random number generator function which is called * for each element in the output tensor. * @param dtype The data type of the output tensor. Defaults to 'float32'. - * - * @doc {heading: 'Tensors', subheading: 'Random'} */ function rand_( shape: ShapeMap[R], randFunction: () => number, diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/signal/stft.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/signal/stft.ts index 23c99b2ea..bc4aa6651 100644 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/signal/stft.ts +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/signal/stft.ts @@ -16,9 +16,11 @@ */ import {Tensor, Tensor1D} from '../../tensor'; +import {concat} from '../concat'; import {mul} from '../mul'; import {op} from '../operation'; import {enclosingPowerOfTwo} from '../signal_ops_util'; +import {slice} from '../slice'; import {rfft} from '../spectral/rfft'; import {frame} from './frame'; @@ -49,6 +51,11 @@ function stft_( } const framedSignal = frame(signal, frameLength, frameStep); const windowedSignal = mul(framedSignal, windowFn(frameLength)); - return rfft(windowedSignal, fftLength); + const output: Tensor[] = []; + for (let i = 0; i < framedSignal.shape[0]; i++) { + output.push( + rfft(slice(windowedSignal, [i, 0], [1, frameLength]), fftLength)); + } + return concat(output); } export const stft = op({stft_}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/sparse/sparse_fill_empty_rows.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/sparse/sparse_fill_empty_rows.ts deleted file mode 100644 index dd14223ab..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/sparse/sparse_fill_empty_rows.ts +++ /dev/null @@ -1,126 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {ENGINE} from '../../engine'; -import {SparseFillEmptyRows, SparseFillEmptyRowsInputs} from '../../kernel_names'; -import {Scalar, Tensor, Tensor1D, Tensor2D} from '../../tensor'; -import {NamedTensorMap} from '../../tensor_types'; -import {convertToTensor} from '../../tensor_util_env'; -import {ScalarLike, TensorLike} from '../../types'; -import {op} from '../operation'; - -/** - * The input SparseTensor is represented via the map of inputs {`indices`, - * `values`, `denseShape`}. The output SparseTensor has the same `denseShape` - * but with indices `outputIndices` and values `outputValues`. This op inserts a - * single entry for every row that doesn't have any values. The index is created - * as `[row, 0, ..., 0]` and the inserted value is `defaultValue`. - * - * For example, suppose `spInput` has shape [5, 6] and non-empty values: - * [0, 1]: a - * [0, 3]: b - * [2, 0]: c - * [3, 1]: d - * - * Rows 1 and 4 are empty, so the output will be of shape [5, 6] with values: - * [0, 1]: a - * [0, 3]: b - * [1, 0]: `defaultValue` - * [2, 0]: c - * [3, 1]: d - * [4, 0]: `defaultValue` - * - * The output SparseTensor will be in row-major order and will have the same - * shape as the input. - * - * This op also returns an indicator vector shaped [dense_shape[0]] such that - * emptyRowIndicator[i] = True iff row i was an empty row. - * - * And a reverse index map vector shaped [indices.shape[0]] that is used during - * backpropagation, reverseIndexMap[i] = outi s.t. indices[i, j] == - * outputIndices[outi, j] for all j - * - * ```js - * const result = tf.sparse.sparseFillEmptyRows( - * [[0, 0], [1, 0], [1, 3], [1, 4], [3, 2], [3, 3]], - * [0, 10, 13, 14, 32, 33], [5, 6], -1); - * console.log(result); - * result['outputIndices'].print(); // [[0, 0], [1, 0], [1, 3], [1, 4], - * // [2, 0], [3, 2], [3, 3], [4, 0]] - * result['outputValues'].print(); // [0, 10, 13, 14,-1, 32, 33, -1] - * result['emptyRowIndicator'].print(); // [0, 0, 1, 0, 1] - * result['reverseIndexMap'].print(); // [0, 1, 2, 3, 5, 6] - * ``` - * @param indices: 2-D. the indices of the sparse tensor. - * @param values: 1-D. the values of the sparse tensor. - * @param denseShape: 1-D. the shape of the sparse tensor. - * @param defaultValue: 0-D. default value to insert into location [row, 0, ..., - * 0] for rows missing from the input sparse tensor. - * @return A map with the following properties: - * - outputIndices - * - outputValues: 1-D. the values of the filled sparse tensor. - * - emptyRowIndicator: 1-D. whether the dense row was missing in the input - * sparse tensor. - * - reverseIndexMap: 1-D. a map from the input indices to the output - * indices. - * @doc {heading: 'Operations', subheading: 'Sparse'} - */ -function sparseFillEmptyRows_( - indices: Tensor2D|TensorLike, values: Tensor1D|TensorLike, - denseShape: Tensor1D|TensorLike, - defaultValue: Scalar|ScalarLike): NamedTensorMap { - const $indices = convertToTensor(indices, 'indices', 'sparseFillEmptyRows'); - const $values = convertToTensor(values, 'values', 'sparseFillEmptyRows'); - const $denseShape = - convertToTensor(denseShape, 'denseShape', 'sparseFillEmptyRows'); - const $defaultValue = convertToTensor( - defaultValue, 'defaultValue', 'sparseFillEmptyRows', $values.dtype); - - if ($indices.rank !== 2) { - throw new Error(`Indices should be Tensor2D but received shape - ${$indices.shape}`); - } - if ($values.rank !== 1) { - throw new Error( - `Values should be Tensor1D but received shape ${$values.shape}`); - } - if ($denseShape.rank !== 1) { - throw new Error(`Dense shape should be Tensor1D but received shape ${ - $denseShape.shape}`); - } - if ($defaultValue.rank !== 0) { - throw new Error(`Default value should be a scalar but received shape ${ - $defaultValue.shape}`); - } - - const inputs: SparseFillEmptyRowsInputs = { - indices: $indices, - values: $values, - denseShape: $denseShape, - defaultValue: $defaultValue - }; - - const result: Tensor[] = ENGINE.runKernel(SparseFillEmptyRows, inputs as {}); - return { - outputIndices: result[0], - outputValues: result[1], - emptyRowIndicator: result[2], - reverseIndexMap: result[3] - }; -} - -export const sparseFillEmptyRows = op({sparseFillEmptyRows_}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/sparse/sparse_reshape.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/sparse/sparse_reshape.ts deleted file mode 100644 index 9b6b3b181..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/sparse/sparse_reshape.ts +++ /dev/null @@ -1,91 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {ENGINE} from '../../engine'; -import {SparseReshape, SparseReshapeInputs} from '../../kernel_names'; -import {Tensor, Tensor1D, Tensor2D} from '../../tensor'; -import {NamedTensorMap} from '../../tensor_types'; -import {convertToTensor} from '../../tensor_util_env'; -import {TensorLike} from '../../types'; -import {op} from '../operation'; - -/** - * This operation has the same semantics as reshape on the represented dense - * tensor. The `inputIndices` are recomputed based on the requested `newShape`. - * If one component of `newShape` is the special value -1, the size of that - * dimension is computed so that the total dense size remains constant. At most - * one component of `newShape` can be -1. The number of dense elements implied - * by `newShape` must be the same as the number of dense elements originally - * implied by `inputShape`. Reshaping does not affect the order of values in the - * SparseTensor. If the input tensor has rank R_in and N non-empty values, and - * `newShape` has length R_out, then `inputIndices` has shape [N, R_in], - * `inputShape` has length R_in, `outputIndices` has shape [N, R_out], and - * `outputShape` has length R_out. - * - * ```js - * const result = tf.sparse.sparseReshape( - * [[0, 0, 0], [0, 0, 1], [0, 1, 0], [1, 0, 0], [1, 2, 3]], - * [2, 3, 6], [9, -1]); - * console.log(result); - * result['outputIndices'].print(); //[[0, 0], [0, 1], [1, 2], [4, 2], [8, 1]] - * result['outputShape'].print(); // [9, 4] - * ``` - * @param inputIndices: 2-D. N x R_in matrix with the indices of non-empty - * values in a SparseTensor. - * @param inputShape: 1-D. R_in Tensor1D with the input SparseTensor's dense - * shape. - * @param newShape: 1-D. R_out Tensor1D with the requested new dense shape. - * @return A map with the following properties: - * - outputIndices: 2-D. N x R_out matrix with the updated indices of - * non-empty values in the output SparseTensor. - * - outputShape: 1-D. R_out vector with the full dense shape of the output - * SparseTensor. This is the same as newShape but with any -1 dimensions - * filled in. - * @doc {heading: 'Operations', subheading: 'Sparse'} - */ -function sparseReshape_( - inputIndices: Tensor2D|TensorLike, inputShape: Tensor1D|TensorLike, - newShape: Tensor1D|TensorLike): NamedTensorMap { - const $inputIndices = - convertToTensor(inputIndices, 'inputIndices', 'sparseReshape'); - const $inputShape = - convertToTensor(inputShape, 'inputShape', 'sparseReshape'); - const $newShape = convertToTensor(newShape, 'newShape', 'sparseReshape'); - - if ($inputIndices.rank !== 2) { - throw new Error(`Input indices should be Tensor2D but received shape - ${$inputIndices.shape}`); - } - if ($inputShape.rank !== 1) { - throw new Error(`Input shape should be Tensor1D but received shape ${ - $inputShape.shape}`); - } - if ($newShape.rank !== 1) { - throw new Error( - `New shape should be Tensor1D but received shape ${$newShape.shape}`); - } - - const inputs: SparseReshapeInputs = { - inputIndices: $inputIndices, - inputShape: $inputShape, - newShape: $newShape - }; - const result: Tensor[] = ENGINE.runKernel(SparseReshape, inputs as {}); - return {outputIndices: result[0], outputShape: result[1]}; -} - -export const sparseReshape = op({sparseReshape_}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/where.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/where.ts index fd11aa25b..bf7c78fdf 100644 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/where.ts +++ b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/ops/where.ts @@ -21,6 +21,7 @@ import {Tensor} from '../tensor'; import {NamedTensorMap} from '../tensor_types'; import {convertToTensor} from '../tensor_util_env'; import {TensorLike} from '../types'; +import {assert, assertShapesMatch} from '../util'; import {broadcastTo} from './broadcast_to'; import {assertAndGetBroadcastShape} from './broadcast_util'; @@ -56,19 +57,30 @@ function where_( const $condition = convertToTensor(condition, 'condition', 'where', 'bool'); // TODO: move this logic to forward function when the broadcastTo op is // implemented in WASM. - // Find the broadcastable shape for $condition, $a, and $b. - const broadcastShape = assertAndGetBroadcastShape( - assertAndGetBroadcastShape($condition.shape, $a.shape), $b.shape); - const $broadcastedCondition = broadcastTo($condition, broadcastShape); + // Find the broadcastable shape for $a and $b. + const broadcastShape = assertAndGetBroadcastShape($a.shape, $b.shape); const $broadcastedA = broadcastTo($a, broadcastShape); const $broadcastedB = broadcastTo($b, broadcastShape); + if ($condition.rank === 1) { + // If condition rank is 1, then the first dimension must match the size of + // condition. + assert( + $condition.shape[0] === $a.shape[0], + () => 'The first dimension of `a` must match the size of `condition`.'); + } + + if ($condition.rank !== 1) { + // A must have the same shape as condition. + assertShapesMatch( + $condition.shape, $broadcastedB.shape, 'Error in where: '); + } const inputs: SelectInputs = { - condition: $broadcastedCondition, + condition: $condition, t: $broadcastedA, e: $broadcastedB }; - return ENGINE.runKernel(Select, inputs as {} as NamedTensorMap); + return ENGINE.runKernel(Select, inputs as unknown as NamedTensorMap); } export const where = op({where_}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/adadelta_optimizer.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/adadelta_optimizer.ts deleted file mode 100644 index 013e87e61..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/adadelta_optimizer.ts +++ /dev/null @@ -1,150 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {ENGINE} from '../engine'; -import {dispose, tidy} from '../globals'; -import {add} from '../ops/add'; -import {div} from '../ops/div'; -import {mul} from '../ops/mul'; -import {sqrt} from '../ops/ops'; -import {square} from '../ops/square'; -import {zerosLike} from '../ops/zeros_like'; -import {ConfigDict, registerClass, Serializable, SerializableConstructor} from '../serialization'; -import {NamedTensor, NamedVariableMap} from '../tensor_types'; - -import {Optimizer, OptimizerVariable} from './optimizer'; - -/** @doclink Optimizer */ -export class AdadeltaOptimizer extends Optimizer { - /** @nocollapse */ - static className = 'Adadelta'; // Name matters for Python compatibility. - private accumulatedGrads: OptimizerVariable[] = []; - private accumulatedUpdates: OptimizerVariable[] = []; - - constructor( - protected learningRate: number, protected rho: number, - protected epsilon: number = null) { - super(); - - if (epsilon == null) { - this.epsilon = ENGINE.backend.epsilon(); - } - } - - applyGradients(variableGradients: NamedVariableMap|NamedTensor[]) { - const variableNames = Array.isArray(variableGradients) ? - variableGradients.map(item => item.name) : - Object.keys(variableGradients); - - variableNames.forEach((name, i) => { - const value = ENGINE.registeredVariables[name]; - const trainable = false; - if (this.accumulatedGrads[i] == null) { - this.accumulatedGrads[i] = { - originalName: `${name}/accum_grad`, - variable: tidy(() => zerosLike(value).variable(trainable)) - }; - } - if (this.accumulatedUpdates[i] == null) { - this.accumulatedUpdates[i] = { - originalName: `${name}/accum_var`, - variable: tidy(() => zerosLike(value).variable(trainable)) - }; - } - - const gradient = Array.isArray(variableGradients) ? - variableGradients[i].tensor : - variableGradients[name]; - if (gradient == null) { - return; - } - - const accumulatedGrad = this.accumulatedGrads[i].variable; - const accumulatedUpdate = this.accumulatedUpdates[i].variable; - - tidy(() => { - const newAccumulatedGrad = - add(mul(accumulatedGrad, this.rho), - mul(square(gradient), 1 - this.rho)); - - const updates = - mul(div(sqrt(add(accumulatedUpdate, this.epsilon)), - sqrt(add(accumulatedGrad, this.epsilon))), - gradient); - - const newAccumulatedUpdate = - add(mul(accumulatedUpdate, this.rho), - mul(square(updates), 1 - this.rho)); - - accumulatedGrad.assign(newAccumulatedGrad); - accumulatedUpdate.assign(newAccumulatedUpdate); - - const newValue = add(mul(updates, -this.learningRate), value); - value.assign(newValue); - }); - }); - this.incrementIterations(); - } - - dispose(): void { - if (this.accumulatedUpdates != null) { - dispose(this.accumulatedGrads.map(v => v.variable)); - dispose(this.accumulatedUpdates.map(v => v.variable)); - } - } - - async getWeights(): Promise { - // Order matters for Python compatibility. - const variables: OptimizerVariable[] = - [...this.accumulatedGrads, ...this.accumulatedUpdates]; - return [await this.saveIterations()].concat( - variables.map(v => ({name: v.originalName, tensor: v.variable}))); - } - - async setWeights(weightValues: NamedTensor[]): Promise { - weightValues = await this.extractIterations(weightValues); - const variableCount = weightValues.length / 2; - const trainable = false; - this.accumulatedGrads = - weightValues.slice(0, variableCount).map(v => ({ - originalName: v.name, - variable: v.tensor.variable( - trainable) - })); - this.accumulatedUpdates = - weightValues.slice(variableCount, variableCount * 2) - .map(v => ({ - originalName: v.name, - variable: v.tensor.variable(trainable) - })); - } - - getConfig(): ConfigDict { - return { - 'learningRate': this.learningRate, - 'rho': this.rho, - 'epsilon': this.epsilon - }; - } - - /** @nocollapse */ - static fromConfig( - cls: SerializableConstructor, config: ConfigDict): T { - return new cls(config['learningRate'], config['rho'], config['epsilon']); - } -} -registerClass(AdadeltaOptimizer); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/adagrad_optimizer.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/adagrad_optimizer.ts deleted file mode 100644 index af0cae4f9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/adagrad_optimizer.ts +++ /dev/null @@ -1,116 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {ENGINE} from '../engine'; -import {dispose, tidy} from '../globals'; -import {add} from '../ops/add'; -import {div} from '../ops/div'; -import {fill} from '../ops/fill'; -import {mul} from '../ops/mul'; -import {sqrt} from '../ops/sqrt'; -import {square} from '../ops/square'; -import {ConfigDict, registerClass, Serializable, SerializableConstructor} from '../serialization'; -import {NamedTensor, NamedVariableMap} from '../tensor_types'; - -import {Optimizer, OptimizerVariable} from './optimizer'; - -/** @doclink Optimizer */ -export class AdagradOptimizer extends Optimizer { - /** @nocollapse */ - static className = 'Adagrad'; // Note: Name matters for Python compatibility. - - private accumulatedGrads: OptimizerVariable[] = []; - - constructor( - protected learningRate: number, private initialAccumulatorValue = 0.1) { - super(); - } - - applyGradients(variableGradients: NamedVariableMap|NamedTensor[]) { - const variableNames = Array.isArray(variableGradients) ? - variableGradients.map(item => item.name) : - Object.keys(variableGradients); - - variableNames.forEach((name, i) => { - const value = ENGINE.registeredVariables[name]; - if (this.accumulatedGrads[i] == null) { - const trainable = false; - this.accumulatedGrads[i] = { - originalName: `${name}/accumulator`, - variable: tidy( - () => fill(value.shape, this.initialAccumulatorValue) - .variable(trainable)) - }; - } - - const gradient = Array.isArray(variableGradients) ? - variableGradients[i].tensor : - variableGradients[name]; - if (gradient == null) { - return; - } - - const accumulatedGrad = this.accumulatedGrads[i].variable; - - tidy(() => { - const newAccumulatedGrad = add(accumulatedGrad, square(gradient)); - accumulatedGrad.assign(newAccumulatedGrad); - - const newValue = add( - mul(div(gradient, - sqrt(add(newAccumulatedGrad, ENGINE.backend.epsilon()))), - -this.learningRate), - value); - value.assign(newValue); - }); - }); - this.incrementIterations(); - } - - dispose(): void { - if (this.accumulatedGrads != null) { - dispose(this.accumulatedGrads.map(v => v.variable)); - } - } - - async getWeights(): Promise { - // Order matters for Python compatibility. - return [await this.saveIterations()].concat(this.accumulatedGrads.map( - v => ({name: v.originalName, tensor: v.variable}))); - } - - async setWeights(weightValues: NamedTensor[]): Promise { - weightValues = await this.extractIterations(weightValues); - const trainable = false; - this.accumulatedGrads = weightValues.map( - v => ({originalName: v.name, variable: v.tensor.variable(trainable)})); - } - - getConfig(): ConfigDict { - return { - 'learningRate': this.learningRate, - 'initialAccumulatorValue': this.initialAccumulatorValue, - }; - } - - /** @nocollapse */ - static fromConfig( - cls: SerializableConstructor, config: ConfigDict): T { - return new cls(config['learningRate'], config['initialAccumulatorValue']); - } -} -registerClass(AdagradOptimizer); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/adam_optimizer.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/adam_optimizer.ts deleted file mode 100644 index f958210dd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/adam_optimizer.ts +++ /dev/null @@ -1,180 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {ENGINE} from '../engine'; -import {dispose, tidy} from '../globals'; -import {add} from '../ops/add'; -import {div} from '../ops/div'; -import {mul} from '../ops/mul'; -import {pow} from '../ops/pow'; -import {scalar} from '../ops/scalar'; -import {sqrt} from '../ops/sqrt'; -import {square} from '../ops/square'; -import {sub} from '../ops/sub'; -import {zerosLike} from '../ops/zeros_like'; -import {ConfigDict, registerClass, Serializable, SerializableConstructor} from '../serialization'; -import {Variable} from '../tensor'; -import {NamedTensor, NamedVariableMap} from '../tensor_types'; - -import {Optimizer, OptimizerVariable} from './optimizer'; - -export class AdamOptimizer extends Optimizer { - /** @nocollapse */ - static className = 'Adam'; // Note: Name matters for Python compatibility. - private accBeta1: Variable; - private accBeta2: Variable; - - private accumulatedFirstMoment: OptimizerVariable[] = []; - private accumulatedSecondMoment: OptimizerVariable[] = []; - - constructor( - protected learningRate: number, protected beta1: number, - protected beta2: number, protected epsilon: number = null) { - super(); - tidy(() => { - // accB* will be updated by batch. - this.accBeta1 = scalar(beta1).variable(); - this.accBeta2 = scalar(beta2).variable(); - }); - - if (epsilon == null) { - this.epsilon = ENGINE.backend.epsilon(); - } - } - - applyGradients(variableGradients: NamedVariableMap|NamedTensor[]) { - const varNames = Array.isArray(variableGradients) ? - variableGradients.map(v => v.name) : - Object.keys(variableGradients); - tidy(() => { - const oneMinusAccBeta1 = sub(1, this.accBeta1); - const oneMinusAccBeta2 = sub(1, this.accBeta2); - - varNames.forEach((name, i) => { - const value = ENGINE.registeredVariables[name]; - const trainable = false; - if (this.accumulatedFirstMoment[i] == null) { - this.accumulatedFirstMoment[i] = { - originalName: `${name}/m`, - variable: tidy(() => zerosLike(value).variable(trainable)) - }; - } - if (this.accumulatedSecondMoment[i] == null) { - this.accumulatedSecondMoment[i] = { - originalName: `${name}/v`, - variable: tidy(() => zerosLike(value).variable(trainable)) - }; - } - - const gradient = Array.isArray(variableGradients) ? - variableGradients[i].tensor : - variableGradients[name]; - if (gradient == null) { - return; - } - - const firstMoment = this.accumulatedFirstMoment[i].variable; - const secondMoment = this.accumulatedSecondMoment[i].variable; - - const newFirstMoment = - add(mul(firstMoment, this.beta1), mul(gradient, 1 - this.beta1)); - const newSecondMoment = - add(mul(secondMoment, this.beta2), - mul(square(gradient), 1 - this.beta2)); - - const biasCorrectedFirstMoment = div(newFirstMoment, oneMinusAccBeta1); - const biasCorrectedSecondMoment = - div(newSecondMoment, oneMinusAccBeta2); - - firstMoment.assign(newFirstMoment); - secondMoment.assign(newSecondMoment); - - const newValue = - add(mul(div(biasCorrectedFirstMoment, - add(sqrt(biasCorrectedSecondMoment), this.epsilon)), - -this.learningRate), - value); - value.assign(newValue); - }); - - this.accBeta1.assign(mul(this.accBeta1, this.beta1)); - this.accBeta2.assign(mul(this.accBeta2, this.beta2)); - }); - this.incrementIterations(); - } - - dispose(): void { - this.accBeta1.dispose(); - this.accBeta2.dispose(); - - if (this.accumulatedFirstMoment != null) { - dispose(this.accumulatedFirstMoment.map(v => v.variable)); - } - if (this.accumulatedSecondMoment != null) { - dispose(this.accumulatedSecondMoment.map(v => v.variable)); - } - } - - async getWeights(): Promise { - // Order matters for Python compatibility. - const variables: OptimizerVariable[] = - [...this.accumulatedFirstMoment, ...this.accumulatedSecondMoment]; - return [await this.saveIterations()].concat( - variables.map(v => ({name: v.originalName, tensor: v.variable}))); - } - - async setWeights(weightValues: NamedTensor[]): Promise { - weightValues = await this.extractIterations(weightValues); - tidy(() => { - this.accBeta1.assign(pow(this.beta1, this.iterations_ + 1)); - this.accBeta2.assign(pow(this.beta2, this.iterations_ + 1)); - }); - - const variableCount = weightValues.length / 2; - const trainable = false; - this.accumulatedFirstMoment = - weightValues.slice(0, variableCount).map(v => ({ - originalName: v.name, - variable: v.tensor.variable( - trainable) - })); - this.accumulatedSecondMoment = - weightValues.slice(variableCount, variableCount * 2) - .map(v => ({ - originalName: v.name, - variable: v.tensor.variable(trainable) - })); - } - - getConfig(): ConfigDict { - return { - 'learningRate': this.learningRate, - 'beta1': this.beta1, - 'beta2': this.beta2, - 'epsilon': this.epsilon, - }; - } - - /** @nocollapse */ - static fromConfig( - cls: SerializableConstructor, config: ConfigDict): T { - return new cls( - config['learningRate'], config['beta1'], config['beta2'], - config['epsilon']); - } -} -registerClass(AdamOptimizer); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/adamax_optimizer.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/adamax_optimizer.ts deleted file mode 100644 index 8418c4afc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/adamax_optimizer.ts +++ /dev/null @@ -1,158 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {ENGINE} from '../engine'; -import {dispose, tidy} from '../globals'; -import {abs} from '../ops/abs'; -import {add} from '../ops/add'; -import {div} from '../ops/div'; -import {maximum} from '../ops/maximum'; -import {mul} from '../ops/mul'; -import {scalar} from '../ops/scalar'; -import {sub} from '../ops/sub'; -import {zerosLike} from '../ops/zeros_like'; -import {ConfigDict, registerClass, Serializable, SerializableConstructor} from '../serialization'; -import {Variable} from '../tensor'; -import {NamedTensor, NamedVariableMap} from '../tensor_types'; - -import {Optimizer, OptimizerVariable} from './optimizer'; - -export class AdamaxOptimizer extends Optimizer { - /** @nocollapse */ - static className = 'Adamax'; // Note: Name matters for Python compatbility. - private accBeta1: Variable; - private iteration: Variable; - - private accumulatedFirstMoment: OptimizerVariable[] = []; - private accumulatedWeightedInfNorm: OptimizerVariable[] = []; - - constructor( - protected learningRate: number, protected beta1: number, - protected beta2: number, protected epsilon: number = null, - protected decay = 0.0) { - super(); - - tidy(() => { - this.iteration = scalar(0).variable(); - this.accBeta1 = scalar(beta1).variable(); - }); - - if (epsilon == null) { - this.epsilon = ENGINE.backend.epsilon(); - } - } - - applyGradients(variableGradients: NamedVariableMap|NamedTensor[]) { - const variableNames = Array.isArray(variableGradients) ? - variableGradients.map(item => item.name) : - Object.keys(variableGradients); - - tidy(() => { - const oneMinusAccBeta1 = sub(1, this.accBeta1); - const lr = - div(-this.learningRate, add(mul(this.iteration, this.decay), 1)); - - variableNames.forEach((name, i) => { - const value = ENGINE.registeredVariables[name]; - const trainable = false; - if (this.accumulatedFirstMoment[i] == null) { - this.accumulatedFirstMoment[i] = { - originalName: `${name}/m`, - variable: zerosLike(value).variable(trainable) - }; - } - if (this.accumulatedWeightedInfNorm[i] == null) { - this.accumulatedWeightedInfNorm[i] = { - originalName: `${name}/v`, - variable: zerosLike(value).variable(trainable) - }; - } - - const gradient = Array.isArray(variableGradients) ? - variableGradients[i].tensor : - variableGradients[name]; - if (gradient == null) { - return; - } - - const firstMoment = this.accumulatedFirstMoment[i].variable; - const weightedInfNorm = this.accumulatedWeightedInfNorm[i].variable; - - const newFirstMoment = - add(mul(firstMoment, this.beta1), mul(gradient, 1 - this.beta1)); - - const ut0 = mul(weightedInfNorm, this.beta2); - const ut1 = abs(gradient); - - const newWeightedInfNorm = maximum(ut0, ut1); - - firstMoment.assign(newFirstMoment); - weightedInfNorm.assign(newWeightedInfNorm); - - const newValue = - add(mul(div(lr, oneMinusAccBeta1), - div(newFirstMoment, add(newWeightedInfNorm, this.epsilon))), - value); - - value.assign(newValue); - }); - - this.iteration.assign(add(this.iteration, 1)); - this.accBeta1.assign(mul(this.accBeta1, this.beta1)); - }); - this.incrementIterations(); - } - - dispose(): void { - this.accBeta1.dispose(); - this.iteration.dispose(); - - if (this.accumulatedFirstMoment != null) { - dispose(this.accumulatedFirstMoment.map(v => v.variable)); - } - if (this.accumulatedWeightedInfNorm != null) { - dispose(this.accumulatedWeightedInfNorm.map(v => v.variable)); - } - } - - async getWeights(): Promise { - throw new Error('getWeights() is not implemented for Adamax yet.'); - } - - async setWeights(weightValues: NamedTensor[]): Promise { - throw new Error('setWeights() is not implemented for Adamax yet.'); - } - - getConfig(): ConfigDict { - return { - 'learningRate': this.learningRate, - 'beta1': this.beta1, - 'beta2': this.beta2, - 'epsilon': this.epsilon, - 'decay': this.decay - }; - } - - /** @nocollapse */ - static fromConfig( - cls: SerializableConstructor, config: ConfigDict): T { - return new cls( - config['learningRate'], config['beta1'], config['beta2'], - config['epsilon'], config['decay']); - } -} -registerClass(AdamaxOptimizer); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/momentum_optimizer.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/momentum_optimizer.ts deleted file mode 100644 index bbf0ba1fd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/momentum_optimizer.ts +++ /dev/null @@ -1,128 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {ENGINE} from '../engine'; -import {dispose, tidy} from '../globals'; -import {add} from '../ops/add'; -import {mul} from '../ops/mul'; -import {scalar} from '../ops/scalar'; -import {zerosLike} from '../ops/zeros_like'; -import {ConfigDict, registerClass, Serializable, SerializableConstructor} from '../serialization'; -import {Scalar, Tensor} from '../tensor'; -import {NamedTensor, NamedVariableMap} from '../tensor_types'; - -import {OptimizerVariable} from './optimizer'; -import {SGDOptimizer} from './sgd_optimizer'; - -/** @doclink Optimizer */ -export class MomentumOptimizer extends SGDOptimizer { - /** @nocollapse */ - static className = 'Momentum'; // Name matters for Python compatibility. - private m: Scalar; - private accumulations: OptimizerVariable[] = []; - - constructor( - protected learningRate: number, private momentum: number, - private useNesterov = false) { - super(learningRate); - this.m = scalar(this.momentum); - } - - applyGradients(variableGradients: NamedVariableMap|NamedTensor[]) { - const variableNames = Array.isArray(variableGradients) ? - variableGradients.map(item => item.name) : - Object.keys(variableGradients); - - variableNames.forEach((name, i) => { - const value = ENGINE.registeredVariables[name]; - if (this.accumulations[i] == null) { - const trainable = false; - this.accumulations[i] = { - originalName: `${name}/momentum`, - variable: tidy(() => zerosLike(value).variable(trainable)) - }; - } - - const accumulation = this.accumulations[i].variable; - const gradient = Array.isArray(variableGradients) ? - variableGradients[i].tensor : - variableGradients[name]; - if (gradient == null) { - return; - } - - tidy(() => { - let newValue: Tensor; - const newAccumulation = add(mul(this.m, accumulation), gradient); - if (this.useNesterov) { - newValue = add( - mul(this.c, add(gradient, mul(newAccumulation, this.m))), value); - } else { - newValue = add(mul(this.c, newAccumulation), value); - } - accumulation.assign(newAccumulation); - value.assign(newValue); - }); - }); - this.incrementIterations(); - } - - dispose(): void { - this.m.dispose(); - if (this.accumulations != null) { - dispose(this.accumulations.map(v => v.variable)); - } - } - - /** - * Sets the momentum of the optimizer. - * - * @param momentum - */ - setMomentum(momentum: number) { - this.momentum = momentum; - } - - async getWeights(): Promise { - // Order matters for Python compatibility. - return [await this.saveIterations()].concat(this.accumulations.map( - v => ({name: v.originalName, tensor: v.variable}))); - } - - async setWeights(weightValues: NamedTensor[]): Promise { - weightValues = await this.extractIterations(weightValues); - const trainable = false; - this.accumulations = weightValues.map( - v => ({originalName: v.name, variable: v.tensor.variable(trainable)})); - } - - getConfig(): ConfigDict { - return { - 'learningRate': this.learningRate, - 'momentum': this.momentum, - 'useNesterov': this.useNesterov - }; - } - - /** @nocollapse */ - static fromConfig( - cls: SerializableConstructor, config: ConfigDict): T { - return new cls( - config['learningRate'], config['momentum'], config['useNesterov']); - } -} -registerClass(MomentumOptimizer); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/optimizer.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/optimizer.ts deleted file mode 100644 index dca3e1380..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/optimizer.ts +++ /dev/null @@ -1,173 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {dispose} from '../globals'; -import {variableGrads} from '../gradients'; -import {scalar} from '../ops/ops'; -import {Serializable} from '../serialization'; -import {Scalar, Variable} from '../tensor'; -import {NamedTensor, NamedTensorMap} from '../tensor_types'; - -/** - * A variable that belongs to an optimizer. - * - * The `originalName` field is required for keeping track of the canonical - * name of the variable, which is usually the name of the model weight that - * the variable is related to plus a suffix, e.g., 'dense1/kernel/momentum'. - * The name of the `Variable` object itself cannot be used directly due to - * possible deduplication: Every `Variable` must have a unique name but more - * than one optimizer objects of the same type may be created for the same model - * or the same `Variable`. - */ -export interface OptimizerVariable { - originalName: string; - variable: Variable; -} - -/** @doc {heading: 'Training', subheading: 'Classes', namespace: 'train'} */ -export abstract class Optimizer extends Serializable { - protected iterations_: number; - - /** - * Executes `f()` and minimizes the scalar output of `f()` by computing - * gradients of y with respect to the list of trainable variables provided by - * `varList`. If no list is provided, it defaults to all trainable variables. - * - * @param f The function to execute and whose output to minimize. - * @param returnCost Whether to return the scalar cost value produced by - * executing `f()`. - * @param varList An optional list of variables to update. If specified, only - * the trainable variables in varList will be updated by minimize. Defaults to - * all trainable variables. - * - * @doc {heading: 'Training', subheading: 'Optimizers'} - */ - minimize(f: () => Scalar, returnCost = false, varList?: Variable[]): Scalar - |null { - const {value, grads} = this.computeGradients(f, varList); - - if (varList != null) { - const gradArray: NamedTensor[] = - varList.map(v => ({name: v.name, tensor: grads[v.name]})); - this.applyGradients(gradArray); - } else { - this.applyGradients(grads); - } - - // Dispose gradients. - dispose(grads); - - if (returnCost) { - return value; - } else { - value.dispose(); - return null; - } - } - - /** - * The number of iterations that this optimizer instance has been invoked for. - */ - get iterations(): number { - if (this.iterations_ == null) { - this.iterations_ = 0; - } - return this.iterations_; - } - - protected incrementIterations() { - this.iterations_ = this.iterations + 1; - } - - /** - * Executes f() and computes the gradient of the scalar output of f() with - * respect to the list of trainable variables provided by `varList`. If no - * list is provided, it defaults to all trainable variables. - * - * @param f The function to execute and whose output to use for computing - * gradients with respect to variables. - * @param varList An optional list of variables to compute gradients with - * respect to. If specified, only the trainable variables in varList will have - * gradients computed with respect to. Defaults to all trainable variables. - * - * @doc {heading: 'Training', subheading: 'Optimizers'} - */ - computeGradients(f: () => Scalar, varList?: Variable[]): - {value: Scalar, grads: NamedTensorMap} { - return variableGrads(f, varList); - } - - /** - * Updates variables by using the computed gradients. - * - * @param variableGradients A mapping of variable name to its gradient value. - * - * @doc {heading: 'Training', subheading: 'Optimizers'} - */ - abstract applyGradients(variableGradients: NamedTensorMap| - NamedTensor[]): void; - - /** - * Dispose the variables (if any) owned by this optimizer instance. - */ - dispose(): void { - if (this.iterations_ != null) { - dispose(this.iterations_); - } - } - - async saveIterations(): Promise { - if (this.iterations_ == null) { - this.iterations_ = 0; - } - return { - name: 'iter', // Named for Python compatibility. - // TODO(cais): Use 'int64' type when available. - tensor: scalar(this.iterations_, 'int32') - }; - } - - async getWeights(): Promise { - throw new Error('getWeights() is not implemented for this optimizer yet.'); - } - - async setWeights(weightValues: NamedTensor[]): Promise { - throw new Error( - `setWeights() is not implemented for this optimizer class ` + - `${this.getClassName()}`); - } - - /** - * Extract the first element of the weight values and set it - * as the iterations counter variable of this instance of optimizer. - * - * @param weightValues - * @returns Weight values with the first element consumed and excluded. - */ - protected async extractIterations(weightValues: NamedTensor[]): - Promise { - this.iterations_ = (await weightValues[0].tensor.data())[0]; - return weightValues.slice(1); - } -} - -Object.defineProperty(Optimizer, Symbol.hasInstance, { - value: (instance: Optimizer) => { - return instance.minimize != null && instance.computeGradients != null && - instance.applyGradients != null; - } -}); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/optimizer_constructors.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/optimizer_constructors.ts deleted file mode 100644 index 66966329a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/optimizer_constructors.ts +++ /dev/null @@ -1,189 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {AdadeltaOptimizer} from './adadelta_optimizer'; -import {AdagradOptimizer} from './adagrad_optimizer'; -import {AdamOptimizer} from './adam_optimizer'; -import {AdamaxOptimizer} from './adamax_optimizer'; -import {MomentumOptimizer} from './momentum_optimizer'; -import {RMSPropOptimizer} from './rmsprop_optimizer'; -import {SGDOptimizer} from './sgd_optimizer'; - -export class OptimizerConstructors { - /** - * Constructs a `tf.SGDOptimizer` that uses stochastic gradient descent. - * - * ```js - * // Fit a quadratic function by learning the coefficients a, b, c. - * const xs = tf.tensor1d([0, 1, 2, 3]); - * const ys = tf.tensor1d([1.1, 5.9, 16.8, 33.9]); - * - * const a = tf.scalar(Math.random()).variable(); - * const b = tf.scalar(Math.random()).variable(); - * const c = tf.scalar(Math.random()).variable(); - * - * // y = a * x^2 + b * x + c. - * const f = x => a.mul(x.square()).add(b.mul(x)).add(c); - * const loss = (pred, label) => pred.sub(label).square().mean(); - * - * const learningRate = 0.01; - * const optimizer = tf.train.sgd(learningRate); - * - * // Train the model. - * for (let i = 0; i < 10; i++) { - * optimizer.minimize(() => loss(f(xs), ys)); - * } - * - * // Make predictions. - * console.log( - * `a: ${a.dataSync()}, b: ${b.dataSync()}, c: ${c.dataSync()}`); - * const preds = f(xs).dataSync(); - * preds.forEach((pred, i) => { - * console.log(`x: ${i}, pred: ${pred}`); - * }); - * ``` - * - * @param learningRate The learning rate to use for the SGD algorithm. - * - * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'} - */ - static sgd(learningRate: number): SGDOptimizer { - return new SGDOptimizer(learningRate); - } - - /** - * Constructs a `tf.MomentumOptimizer` that uses momentum gradient - * descent. - * - * See - * [http://proceedings.mlr.press/v28/sutskever13.pdf]( - * http://proceedings.mlr.press/v28/sutskever13.pdf) - * - * @param learningRate The learning rate to use for the Momentum gradient - * descent algorithm. - * @param momentum The momentum to use for the momentum gradient descent - * algorithm. - * - * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'} - */ - static momentum(learningRate: number, momentum: number, useNesterov = false): - MomentumOptimizer { - return new MomentumOptimizer(learningRate, momentum, useNesterov); - } - - /** - * Constructs a `tf.RMSPropOptimizer` that uses RMSProp gradient - * descent. This implementation uses plain momentum and is not centered - * version of RMSProp. - * - * See - * [http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf]( - * http://www.cs.toronto.edu/~tijmen/csc321/slides/lecture_slides_lec6.pdf) - * - * @param learningRate The learning rate to use for the RMSProp gradient - * descent algorithm. - * @param decay The discounting factor for the history/coming gradient. - * @param momentum The momentum to use for the RMSProp gradient descent - * algorithm. - * @param epsilon Small value to avoid zero denominator. - * @param centered If true, gradients are normalized by the estimated - * variance of the gradient. - * - * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'} - */ - static rmsprop( - learningRate: number, decay = .9, momentum = 0.0, epsilon: number = null, - centered = false): RMSPropOptimizer { - return new RMSPropOptimizer( - learningRate, decay, momentum, epsilon, centered); - } - - /** - * Constructs a `tf.AdamOptimizer` that uses the Adam algorithm. - * See [https://arxiv.org/abs/1412.6980](https://arxiv.org/abs/1412.6980) - * - * @param learningRate The learning rate to use for the Adam gradient - * descent algorithm. - * @param beta1 The exponential decay rate for the 1st moment estimates. - * @param beta2 The exponential decay rate for the 2nd moment estimates. - * @param epsilon A small constant for numerical stability. - * - * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'} - */ - static adam( - learningRate = 0.001, beta1 = 0.9, beta2 = 0.999, - epsilon: number = null): AdamOptimizer { - return new AdamOptimizer(learningRate, beta1, beta2, epsilon); - } - - /** - * Constructs a `tf.AdadeltaOptimizer` that uses the Adadelta algorithm. - * See [https://arxiv.org/abs/1212.5701](https://arxiv.org/abs/1212.5701) - * - * @param learningRate The learning rate to use for the Adadelta gradient - * descent algorithm. - * @param rho The learning rate decay over each update. - * @param epsilon A constant epsilon used to better condition the grad - * update. - * - * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'} - */ - static adadelta(learningRate = .001, rho = .95, epsilon: number = null): - AdadeltaOptimizer { - return new AdadeltaOptimizer(learningRate, rho, epsilon); - } - - /** - * Constructs a `tf.AdamaxOptimizer` that uses the Adamax algorithm. - * See [https://arxiv.org/abs/1412.6980](https://arxiv.org/abs/1412.6980) - * - * @param learningRate The learning rate to use for the Adamax gradient - * descent algorithm. - * @param beta1 The exponential decay rate for the 1st moment estimates. - * @param beta2 The exponential decay rate for the 2nd moment estimates. - * @param epsilon A small constant for numerical stability. - * @param decay The learning rate decay over each update. - * - * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'} - */ - static adamax( - learningRate = 0.002, beta1 = 0.9, beta2 = 0.999, epsilon: number = null, - decay = 0.0): AdamaxOptimizer { - return new AdamaxOptimizer(learningRate, beta1, beta2, epsilon, decay); - } - - /** - * Constructs a `tf.AdagradOptimizer` that uses the Adagrad algorithm. - * See - * [http://www.jmlr.org/papers/volume12/duchi11a/duchi11a.pdf]( - * http://www.jmlr.org/papers/volume12/duchi11a/duchi11a.pdf) - * or - * [http://ruder.io/optimizing-gradient-descent/index.html#adagrad]( - * http://ruder.io/optimizing-gradient-descent/index.html#adagrad) - * - * @param learningRate The learning rate to use for the Adagrad gradient - * descent algorithm. - * @param initialAccumulatorValue Starting value for the accumulators, must be - * positive. - * - * @doc {heading: 'Training', subheading: 'Optimizers', namespace: 'train'} - */ - static adagrad(learningRate: number, initialAccumulatorValue = 0.1): - AdagradOptimizer { - return new AdagradOptimizer(learningRate, initialAccumulatorValue); - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/rmsprop_optimizer.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/rmsprop_optimizer.ts deleted file mode 100644 index 888f8ca50..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/rmsprop_optimizer.ts +++ /dev/null @@ -1,210 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {ENGINE} from '../engine'; -import {dispose, tidy} from '../globals'; -import {add} from '../ops/add'; -import {div} from '../ops/div'; -import {mul} from '../ops/mul'; -import {sqrt} from '../ops/sqrt'; -import {square} from '../ops/square'; -import {sub} from '../ops/sub'; -import {zerosLike} from '../ops/zeros_like'; -import {ConfigDict, registerClass, Serializable, SerializableConstructor} from '../serialization'; -import {NamedTensor, NamedTensorMap} from '../tensor_types'; - -import {Optimizer, OptimizerVariable} from './optimizer'; - -/** @doclink Optimizer */ -export class RMSPropOptimizer extends Optimizer { - /** @nocollapse */ - static className = 'RMSProp'; // Note: Name matters for Python compatibility. - private centered: boolean; - - private accumulatedMeanSquares: OptimizerVariable[] = []; - private accumulatedMoments: OptimizerVariable[] = []; - private accumulatedMeanGrads: OptimizerVariable[] = []; - - constructor( - protected learningRate: number, protected decay = 0.9, - protected momentum = 0.0, protected epsilon: number = null, - centered = false) { - super(); - - this.centered = centered; - - if (epsilon == null) { - this.epsilon = ENGINE.backend.epsilon(); - } - if (learningRate == null) { - throw new Error(`learningRate for RMSPropOptimizer must be defined.`); - } - } - - applyGradients(variableGradients: NamedTensorMap|NamedTensor[]) { - const variableNames = Array.isArray(variableGradients) ? - variableGradients.map(item => item.name) : - Object.keys(variableGradients); - - variableNames.forEach((name, i) => { - const value = ENGINE.registeredVariables[name]; - const trainable = false; - if (this.accumulatedMeanSquares[i] == null) { - this.accumulatedMeanSquares[i] = { - originalName: `${name}/rms`, - variable: tidy(() => zerosLike(value).variable(trainable)) - }; - } - if (this.accumulatedMoments[i] == null) { - this.accumulatedMoments[i] = { - originalName: `${name}/momentum`, - variable: tidy(() => zerosLike(value).variable(trainable)) - }; - } - if (this.accumulatedMeanGrads[i] == null && this.centered) { - this.accumulatedMeanGrads[i] = { - originalName: `${name}/mg`, - variable: tidy(() => zerosLike(value).variable(trainable)) - }; - } - - const gradient = Array.isArray(variableGradients) ? - variableGradients[i].tensor : - variableGradients[name]; - if (gradient == null) { - return; - } - - const accumulatedMeanSquare = this.accumulatedMeanSquares[i].variable; - const accumulatedMoments = this.accumulatedMoments[i].variable; - tidy(() => { - const newAccumulatedMeanSquare = - add(mul(accumulatedMeanSquare, this.decay), - mul(square(gradient), 1 - this.decay)); - - if (this.centered) { - const accumulatedMeanGrad = this.accumulatedMeanGrads[i].variable; - // Centered gradient - const newAccumulatedMeanGrad = - add(mul(accumulatedMeanGrad, this.decay), - mul(gradient, 1 - this.decay)); - - const gradContribution = - div(mul(gradient, this.learningRate), - sqrt( - sub(newAccumulatedMeanSquare, - add(square(newAccumulatedMeanGrad), this.epsilon)))); - const newAccumulatedMoments = - add(mul(accumulatedMoments, this.momentum), gradContribution); - - accumulatedMeanSquare.assign(newAccumulatedMeanSquare); - accumulatedMeanGrad.assign(newAccumulatedMeanGrad); - accumulatedMoments.assign(newAccumulatedMoments); - - const newValue = sub(value, newAccumulatedMoments); - value.assign(newValue); - } else { - // Plain gradient - const newAccumulatedMeanSquare = - add(mul(accumulatedMeanSquare, this.decay), - mul(square(gradient), 1 - this.decay)); - - const newAccumulatedMoments = - add(mul(accumulatedMoments, this.momentum), - div(mul(gradient, this.learningRate), - sqrt(add(newAccumulatedMeanSquare, this.epsilon)))); - - accumulatedMeanSquare.assign(newAccumulatedMeanSquare); - accumulatedMoments.assign(newAccumulatedMoments); - - const newValue = sub(value, newAccumulatedMoments); - value.assign(newValue); - } - }); - }); - this.incrementIterations(); - } - - dispose(): void { - if (this.accumulatedMeanSquares != null) { - dispose(this.accumulatedMeanSquares.map(v => v.variable)); - } - if (this.accumulatedMeanGrads != null && this.centered) { - dispose(this.accumulatedMeanGrads.map(v => v.variable)); - } - if (this.accumulatedMoments != null) { - dispose(this.accumulatedMoments.map(v => v.variable)); - } - } - - async getWeights(): Promise { - // Order matters for Python compatibility. - const variables: OptimizerVariable[] = - [...this.accumulatedMeanSquares, ...this.accumulatedMoments]; - if (this.centered) { - variables.push(...this.accumulatedMeanGrads); - } - return [await this.saveIterations()].concat( - variables.map(v => ({name: v.originalName, tensor: v.variable}))); - } - - async setWeights(weightValues: NamedTensor[]): Promise { - weightValues = await this.extractIterations(weightValues); - const variableCount = - this.centered ? weightValues.length / 3 : weightValues.length / 2; - const trainable = false; - this.accumulatedMeanSquares = - weightValues.slice(0, variableCount).map(v => ({ - originalName: v.name, - variable: v.tensor.variable( - trainable) - })); - this.accumulatedMoments = - weightValues.slice(variableCount, variableCount * 2) - .map(v => ({ - originalName: v.name, - variable: v.tensor.variable(trainable) - })); - if (this.centered) { - this.accumulatedMeanGrads = - weightValues.slice(variableCount * 2, variableCount * 3) - .map(v => ({ - originalName: v.name, - variable: v.tensor.variable(trainable) - })); - } - } - - getConfig(): ConfigDict { - return { - 'learningRate': this.learningRate, - 'decay': this.decay, - 'momentum': this.momentum, - 'epsilon': this.epsilon, - 'centered': this.centered - }; - } - - /** @nocollapse */ - static fromConfig( - cls: SerializableConstructor, config: ConfigDict): T { - return new cls( - config['learningRate'], config['decay'], config['momentum'], - config['epsilon'], config['centered']); - } -} -registerClass(RMSPropOptimizer); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/sgd_optimizer.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/sgd_optimizer.ts deleted file mode 100644 index fd0b1fce6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/optimizers/sgd_optimizer.ts +++ /dev/null @@ -1,96 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {ENGINE} from '../engine'; -import {keep, tidy} from '../globals'; -import {add} from '../ops/add'; -import {mul} from '../ops/mul'; -import {scalar} from '../ops/scalar'; -import {ConfigDict, registerClass, Serializable, SerializableConstructor} from '../serialization'; -import {Scalar} from '../tensor'; -import {NamedTensor, NamedTensorMap} from '../tensor_types'; - -import {Optimizer} from './optimizer'; - -/** @doclink Optimizer */ -export class SGDOptimizer extends Optimizer { - /** @nocollapse */ - static className = 'SGD'; // Note: Name matters for Python compatibility. - protected c: Scalar; - - constructor(protected learningRate: number) { - super(); - this.setLearningRate(learningRate); - } - - applyGradients(variableGradients: NamedTensorMap|NamedTensor[]) { - const varNames = Array.isArray(variableGradients) ? - variableGradients.map(v => v.name) : - Object.keys(variableGradients); - varNames.forEach((name, i) => { - const gradient = Array.isArray(variableGradients) ? - variableGradients[i].tensor : - variableGradients[name]; - if (gradient == null) { - return; - } - const value = ENGINE.registeredVariables[name]; - tidy(() => { - const newValue = add(mul(this.c, gradient), value); - value.assign(newValue); - }); - }); - this.incrementIterations(); - } - - /** - * Sets the learning rate of the optimizer. - */ - setLearningRate(learningRate: number) { - this.learningRate = learningRate; - if (this.c != null) { - this.c.dispose(); - } - this.c = keep(scalar(-learningRate)); - } - - dispose() { - this.c.dispose(); - } - - async getWeights(): Promise { - return [await this.saveIterations()]; - } - - async setWeights(weightValues: NamedTensor[]): Promise { - weightValues = await this.extractIterations(weightValues); - if (weightValues.length !== 0) { - throw new Error('SGD optimizer does not have settable weights.'); - } - } - - getConfig(): ConfigDict { - return {'learningRate': this.learningRate}; - } - - /** @nocollapse */ - static fromConfig( - cls: SerializableConstructor, config: ConfigDict): T { - return new cls(config['learningRate']); - } -} -registerClass(SGDOptimizer); diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/platforms/platform.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/platforms/platform.ts deleted file mode 100644 index 7a6a5979e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/platforms/platform.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {RequestDetails} from '../io/types'; - -/** - * At any given time a single platform is active and represents and - * implementation of this interface. In practice, a platform is an environment - * where TensorFlow.js can be executed, e.g. the browser or Node.js. - */ -export interface Platform { - /** - * Makes an HTTP request. - * @param path The URL path to make a request to - * @param init The request init. See init here: - * https://developer.mozilla.org/en-US/docs/Web/API/Request/Request - */ - fetch(path: string, requestInits?: RequestInit, options?: RequestDetails): - Promise; - - /** - * Returns the current high-resolution time in milliseconds relative to an - * arbitrary time in the past. It works across different platforms (node.js, - * browsers). - */ - now(): number; - - /** - * Encode the provided string into an array of bytes using the provided - * encoding. - */ - encode(text: string, encoding: string): Uint8Array; - /** Decode the provided bytes into a string using the provided encoding. */ - decode(bytes: Uint8Array, encoding: string): string; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/platforms/platform_browser.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/platforms/platform_browser.ts deleted file mode 100644 index ee4cd61b2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/platforms/platform_browser.ts +++ /dev/null @@ -1,71 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import '../flags'; - -import {env} from '../environment'; -import {BrowserIndexedDB, BrowserIndexedDBManager} from '../io/indexed_db'; -import {BrowserLocalStorage, BrowserLocalStorageManager} from '../io/local_storage'; -import {ModelStoreManagerRegistry} from '../io/model_management'; - -import {Platform} from './platform'; - -export class PlatformBrowser implements Platform { - // According to the spec, the built-in encoder can do only UTF-8 encoding. - // https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/TextEncoder - private textEncoder: TextEncoder; - - fetch(path: string, init?: RequestInit): Promise { - return fetch(path, init); - } - - now(): number { - return performance.now(); - } - - encode(text: string, encoding: string): Uint8Array { - if (encoding !== 'utf-8' && encoding !== 'utf8') { - throw new Error( - `Browser's encoder only supports utf-8, but got ${encoding}`); - } - if (this.textEncoder == null) { - this.textEncoder = new TextEncoder(); - } - return this.textEncoder.encode(text); - } - decode(bytes: Uint8Array, encoding: string): string { - return new TextDecoder(encoding).decode(bytes); - } -} - -if (env().get('IS_BROWSER')) { - env().setPlatform('browser', new PlatformBrowser()); - - // Register LocalStorage IOHandler - try { - ModelStoreManagerRegistry.registerManager( - BrowserLocalStorage.URL_SCHEME, new BrowserLocalStorageManager()); - } catch (err) { - } - - // Register IndexedDB IOHandler - try { - ModelStoreManagerRegistry.registerManager( - BrowserIndexedDB.URL_SCHEME, new BrowserIndexedDBManager()); - } catch (err) { - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/platforms/platform_node.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/platforms/platform_node.ts deleted file mode 100644 index 8581af80a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/platforms/platform_node.ts +++ /dev/null @@ -1,87 +0,0 @@ -/** - * @license - * Copyright 2019 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {env} from '../environment'; - -import {Platform} from './platform'; - -// We are wrapping this within an object so it can be stubbed by Jasmine. -export const getNodeFetch = { - // tslint:disable-next-line:no-require-imports - importFetch: () => require('node-fetch') -}; - -type FetchFn = (url: string, init?: RequestInit) => Promise; -let systemFetch: FetchFn; -// These getters and setters are for testing so we don't export a mutable -// variable. -export function resetSystemFetch() { - systemFetch = null; -} -export function setSystemFetch(fetchFn: FetchFn) { - systemFetch = fetchFn; -} -export function getSystemFetch(): FetchFn { - return systemFetch; -} - -export class PlatformNode implements Platform { - private textEncoder: TextEncoder; - // tslint:disable-next-line:no-any - util: any; - - constructor() { - // tslint:disable-next-line:no-require-imports - this.util = require('util'); - // According to the spec, the built-in encoder can do only UTF-8 encoding. - // https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder/TextEncoder - this.textEncoder = new this.util.TextEncoder(); - } - - fetch(path: string, requestInits?: RequestInit): Promise { - if (env().global.fetch != null) { - return env().global.fetch(path, requestInits); - } - - if (systemFetch == null) { - systemFetch = getNodeFetch.importFetch(); - } - return systemFetch(path, requestInits); - } - - now(): number { - const time = process.hrtime(); - return time[0] * 1000 + time[1] / 1000000; - } - - encode(text: string, encoding: string): Uint8Array { - if (encoding !== 'utf-8' && encoding !== 'utf8') { - throw new Error( - `Node built-in encoder only supports utf-8, but got ${encoding}`); - } - return this.textEncoder.encode(text); - } - decode(bytes: Uint8Array, encoding: string): string { - if (bytes.length === 0) { - return ''; - } - return new this.util.TextDecoder(encoding).decode(bytes); - } -} - -if (env().get('IS_NODE')) { - env().setPlatform('node', new PlatformNode()); -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/abs.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/abs.ts deleted file mode 100644 index 0fcdeb5ea..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/abs.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {abs} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - abs(this: T): T; - } -} - -getGlobalTensorClass().prototype.abs = function(this: T) { - this.throwIfDisposed(); - return abs(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/acos.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/acos.ts deleted file mode 100644 index 85df1a43a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/acos.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {acos} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - acos(this: T): T; - } -} - -getGlobalTensorClass().prototype.acos = function(this: T) { - this.throwIfDisposed(); - return acos(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/acosh.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/acosh.ts deleted file mode 100644 index 7d11985fa..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/acosh.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {acosh} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - acosh(this: T): T; - } -} - -getGlobalTensorClass().prototype.acosh = function(this: T) { - this.throwIfDisposed(); - return acosh(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/add.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/add.ts deleted file mode 100644 index 71b14e459..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/add.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {add} from '../../ops/add'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - add(b: Tensor|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.add = function( - b: Tensor|TensorLike): T { - this.throwIfDisposed(); - return add(this, b); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/all.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/all.ts deleted file mode 100644 index 946a7a244..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/all.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {all} from '../../ops/all'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - all(this: T, axis?: number|number[], keepDims?: boolean): - T; - } -} - -getGlobalTensorClass().prototype.all = function( - this: T, axis?: number|number[], keepDims?: boolean): T { - this.throwIfDisposed(); - return all(this, axis, keepDims); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/any.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/any.ts deleted file mode 100644 index 52b54c0a9..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/any.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {any} from '../../ops/any'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - any(this: T, axis?: number|number[], keepDims?: boolean): - T; - } -} - -getGlobalTensorClass().prototype.any = function( - this: T, axis?: number|number[], keepDims?: boolean): T { - this.throwIfDisposed(); - return any(this, axis, keepDims); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/arg_max.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/arg_max.ts deleted file mode 100644 index 71140c0fd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/arg_max.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {argMax} from '../../ops/arg_max'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - argMax(axis?: number): T; - } -} - -getGlobalTensorClass().prototype.argMax = function( - axis?: number): T { - this.throwIfDisposed(); - return argMax(this, axis); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/arg_min.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/arg_min.ts deleted file mode 100644 index ef8c6c75d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/arg_min.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {argMin} from '../../ops/arg_min'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - argMin(axis?: number): T; - } -} - -getGlobalTensorClass().prototype.argMin = function( - axis: number): T { - this.throwIfDisposed(); - return argMin(this, axis); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as1d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as1d.ts deleted file mode 100644 index a8fdca330..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as1d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {reshape} from '../../ops/reshape'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - as1D(): Tensor1D; - } -} - -/** - * Converts a `tf.Tensor` to a `tf.Tensor1D`. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.as1D = function(): T { - this.throwIfDisposed(); - return reshape(this, [this.size]) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as2d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as2d.ts deleted file mode 100644 index 2ad763b92..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as2d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {reshape} from '../../ops/reshape'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - as2D(rows: number, columns: number): Tensor2D; - } -} - -/** - * Converts a `tf.Tensor` to a `tf.Tensor2D`. - * - * @param rows Number of rows in `tf.Tensor2D`. - * @param columns Number of columns in `tf.Tensor2D`. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.as2D = function( - rows: number, columns: number): T { - this.throwIfDisposed(); - return reshape(this, [rows, columns]) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as3d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as3d.ts deleted file mode 100644 index 8193f81bf..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as3d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {reshape} from '../../ops/reshape'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - as3D(rows: number, columns: number, depth: number): - Tensor3D; - } -} - -/** - * Converts a `tf.Tensor` to a `tf.Tensor3D`. - * - * @param rows Number of rows in `tf.Tensor3D`. - * @param columns Number of columns in `tf.Tensor3D`. - * @param depth Depth of `tf.Tensor3D`. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.as3D = function( - rows: number, columns: number, depth: number): T { - this.throwIfDisposed(); - return reshape(this, [rows, columns, depth]) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as4d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as4d.ts deleted file mode 100644 index 877902eca..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as4d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {reshape} from '../../ops/reshape'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - as4D( - rows: number, columns: number, depth: number, depth2: number): Tensor4D; - } -} - -/** - * Converts a `tf.Tensor` to a `tf.Tensor4D`. - * - * @param rows Number of rows in `tf.Tensor4D`. - * @param columns Number of columns in `tf.Tensor4D`. - * @param depth Depth of `tf.Tensor4D`. - * @param depth2 4th dimension of `tf.Tensor4D`. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.as4D = function( - rows: number, columns: number, depth: number, depth2: number): T { - this.throwIfDisposed(); - return reshape(this, [rows, columns, depth, depth2]) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as5d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as5d.ts deleted file mode 100644 index 0ba0bd2f1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as5d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {reshape} from '../../ops/reshape'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - as5D( - rows: number, columns: number, depth: number, depth2: number, - depth3: number): Tensor5D; - } -} - -/** - * Converts a `tf.Tensor` to a `tf.Tensor5D`. - * - * @param rows Number of rows in `tf.Tensor5D`. - * @param columns Number of columns in `tf.Tensor5D`. - * @param depth Depth of `tf.Tensor5D`. - * @param depth2 4th dimension of `tf.Tensor5D`. - * @param depth3 5th dimension of 'tf.Tensor5D' - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.as5D = function( - rows: number, columns: number, depth: number, depth2: number, - depth3: number): T { - this.throwIfDisposed(); - return reshape(this, [rows, columns, depth, depth2, depth3]) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as_scalar.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as_scalar.ts deleted file mode 100644 index 1786cb3f2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as_scalar.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {reshape} from '../../ops/reshape'; -import {getGlobalTensorClass, Scalar, Tensor} from '../../tensor'; -import {Rank} from '../../types'; -import {assert} from '../../util'; - -declare module '../../tensor' { - interface Tensor { - asScalar(): Scalar; - } -} - -/** - * Converts a size-1 `tf.Tensor` to a `tf.Scalar`. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.asScalar = function(this: T): - Scalar { - this.throwIfDisposed(); - assert(this.size === 1, () => 'The array must have only 1 element.'); - return reshape(this, []); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as_type.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as_type.ts deleted file mode 100644 index 0de1b04e1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/as_type.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {cast} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {DataType, Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - asType(this: T, dtype: DataType): T; - } -} - -/** - * Casts a `tf.Tensor` to a specified dtype. - * - * @param dtype Data-type to cast the tensor to. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.asType = function( - this: T, dtype: DataType): T { - this.throwIfDisposed(); - return cast(this, dtype); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/asin.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/asin.ts deleted file mode 100644 index 5e46de55f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/asin.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {asin} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - asin(this: T): T; - } -} - -getGlobalTensorClass().prototype.asin = function(this: T): T { - this.throwIfDisposed(); - return asin(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/asinh.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/asinh.ts deleted file mode 100644 index 962b442fc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/asinh.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {asinh} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - asinh(this: T): T; - } -} - -getGlobalTensorClass().prototype.asinh = function(this: T): - T { - this.throwIfDisposed(); - return asinh(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atan.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atan.ts deleted file mode 100644 index bbe4ac6a5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atan.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {atan} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - atan(this: T): T; - } -} - -getGlobalTensorClass().prototype.atan = function(this: T): T { - this.throwIfDisposed(); - return atan(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atan2.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atan2.ts deleted file mode 100644 index a979a9f2e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atan2.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {atan2} from '../../ops/atan2'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - atan2(b: Tensor|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.atan2 = function( - b: Tensor|TensorLike): T { - this.throwIfDisposed(); - return atan2(this, b); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atanh.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atanh.ts deleted file mode 100644 index a52cf0d1f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/atanh.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {atanh} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - atanh(this: T): T; - } -} - -getGlobalTensorClass().prototype.atanh = function(this: T): - T { - this.throwIfDisposed(); - return atanh(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/avg_pool.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/avg_pool.ts deleted file mode 100644 index bba7cddd7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/avg_pool.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {avgPool} from '../../ops/avg_pool'; -import {getGlobalTensorClass, Tensor3D, Tensor4D} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - avgPool( - filterSize: [number, number]|number, strides: [number, number]|number, - pad: 'valid'|'same'|number, - dimRoundingMode?: 'floor'|'round'|'ceil'): T; - } -} - -getGlobalTensorClass().prototype.avgPool = - function( - this: T, filterSize: [number, number]|number, - strides: [number, number]|number, pad: 'valid'|'same'|number, - dimRoundingMode?: 'floor'|'round'|'ceil'): T { - this.throwIfDisposed(); - return avgPool(this, filterSize, strides, pad, dimRoundingMode); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/batch_to_space_nd.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/batch_to_space_nd.ts deleted file mode 100644 index b23460a06..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/batch_to_space_nd.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {batchToSpaceND} from '../../ops/batch_to_space_nd'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - batchToSpaceND(blockShape: number[], crops: number[][]): - Tensor; - } -} - -getGlobalTensorClass().prototype.batchToSpaceND = function( - blockShape: number[], crops: number[][]): Tensor { - this.throwIfDisposed(); - return batchToSpaceND(this, blockShape, crops); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/batchnorm.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/batchnorm.ts deleted file mode 100644 index 0a006632f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/batchnorm.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {batchNorm} from '../../ops/batchnorm'; -import {getGlobalTensorClass, Tensor, Tensor1D} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - batchNorm( - mean: Tensor|Tensor1D|TensorLike, - variance: Tensor|Tensor1D|TensorLike, - offset?: Tensor|Tensor1D|TensorLike, - scale?: Tensor|Tensor1D|TensorLike, - varianceEpsilon?: number): Tensor; - } -} - -getGlobalTensorClass().prototype.batchNorm = function( - mean: Tensor|Tensor1D|TensorLike, - variance: Tensor|Tensor1D|TensorLike, - offset?: Tensor|Tensor1D|TensorLike, - scale?: Tensor|Tensor1D|TensorLike, - varianceEpsilon?: number): Tensor { - this.throwIfDisposed(); - return batchNorm(this, mean, variance, offset, scale, varianceEpsilon); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/broadcast_to.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/broadcast_to.ts deleted file mode 100644 index 90afc691b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/broadcast_to.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {broadcastTo} from '../../ops/broadcast_to'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, ShapeMap} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - broadcastTo(shape: ShapeMap[R]): Tensor; - } -} - -getGlobalTensorClass().prototype.broadcastTo = function( - shape: ShapeMap[R]): Tensor { - this.throwIfDisposed(); - return broadcastTo(this, shape); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cast.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cast.ts deleted file mode 100644 index 1b9988384..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cast.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {cast} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {DataType, Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - cast(dtype: DataType): T; - } -} - -getGlobalTensorClass().prototype.cast = function( - dtype: DataType): T { - this.throwIfDisposed(); - return cast(this, dtype) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ceil.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ceil.ts deleted file mode 100644 index 80e3feed5..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ceil.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {ceil} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - ceil(this: T): T; - } -} - -getGlobalTensorClass().prototype.ceil = function(this: T): T { - this.throwIfDisposed(); - return ceil(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/clip_by_value.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/clip_by_value.ts deleted file mode 100644 index e51fb4ba1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/clip_by_value.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {clipByValue} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - clipByValue(min: number, max: number): Tensor; - } -} - -getGlobalTensorClass().prototype.clipByValue = function( - min: number, max: number): T { - this.throwIfDisposed(); - return clipByValue(this, min, max) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/concat.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/concat.ts deleted file mode 100644 index 7975053ad..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/concat.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {concat} from '../../ops/concat'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - concat(tensors: T|Array, axis?: number): T; - } -} - -getGlobalTensorClass().prototype.concat = function( - x: T|Array, axis?: number): T { - this.throwIfDisposed(); - if (x instanceof Tensor) { - x = [x]; - } - return concat([this, ...x], axis) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv1d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv1d.ts deleted file mode 100644 index 09755748a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv1d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {conv1d} from '../../ops/conv1d'; -import {ExplicitPadding} from '../../ops/conv_util'; -import {getGlobalTensorClass, Tensor2D, Tensor3D} from '../../tensor'; -import {Rank, TensorLike3D} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - conv1d( - filter: Tensor3D|TensorLike3D, stride: number, - pad: 'valid'|'same'|number|ExplicitPadding, dataFormat?: 'NWC'|'NCW', - dilation?: number, dimRoundingMode?: 'floor'|'round'|'ceil'): T; - } -} - -getGlobalTensorClass().prototype.conv1d = function( - filter: Tensor3D|TensorLike3D, stride: number, - pad: 'valid'|'same'|number|ExplicitPadding, dataFormat?: 'NWC'|'NCW', - dilation?: number, dimRoundingMode?: 'floor'|'round'|'ceil'): T { - this.throwIfDisposed(); - return conv1d( - this, filter, stride, pad, dataFormat, dilation, - dimRoundingMode) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv2d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv2d.ts deleted file mode 100644 index 6e3aa1b65..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv2d.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {conv2d} from '../../ops/conv2d'; -import {getGlobalTensorClass, Tensor3D, Tensor4D} from '../../tensor'; -import {Rank, TensorLike4D} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - conv2d( - filter: Tensor4D|TensorLike4D, strides: [number, number]|number, - pad: 'valid'|'same'|number, dataFormat?: 'NHWC'|'NCHW', - dilations?: [number, number]|number, - dimRoundingMode?: 'floor'|'round'|'ceil'): T; - } -} - -getGlobalTensorClass().prototype.conv2d = function( - filter: Tensor4D|TensorLike4D, strides: [number, number]|number, - pad: 'valid'|'same'|number, dataFormat?: 'NHWC'|'NCHW', - dilations?: [number, number]|number, - dimRoundingMode?: 'floor'|'round'|'ceil'): T { - this.throwIfDisposed(); - return conv2d( - this, filter, strides, pad, dataFormat, dilations, - dimRoundingMode) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv2d_transpose.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv2d_transpose.ts deleted file mode 100644 index 92a994002..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/conv2d_transpose.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {conv2dTranspose} from '../../ops/conv2d_transpose'; -import {getGlobalTensorClass, Tensor3D, Tensor4D} from '../../tensor'; -import {Rank, TensorLike4D} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - conv2dTranspose( - filter: Tensor4D|TensorLike4D, - outputShape: [number, number, number, number]|[number, number, number], - strides: [number, number]|number, pad: 'valid'|'same'|number, - dimRoundingMode?: 'floor'|'round'|'ceil'): T; - } -} - -getGlobalTensorClass().prototype.conv2dTranspose = - function( - filter: Tensor4D|TensorLike4D, - outputShape: [number, number, number, number]|[number, number, number], - strides: [number, number]|number, pad: 'valid'|'same'|number, - dimRoundingMode?: 'floor'|'round'|'ceil'): T { - this.throwIfDisposed(); - return conv2dTranspose( - this, filter, outputShape, strides, pad, dimRoundingMode) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cos.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cos.ts deleted file mode 100644 index cfaf703ab..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cos.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {cos} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - cos(this: T): T; - } -} - -getGlobalTensorClass().prototype.cos = function(this: T): T { - this.throwIfDisposed(); - return cos(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cosh.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cosh.ts deleted file mode 100644 index f625051f4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cosh.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {cosh} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - cosh(this: T): T; - } -} - -getGlobalTensorClass().prototype.cosh = function(this: T): T { - this.throwIfDisposed(); - return cosh(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cumsum.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cumsum.ts deleted file mode 100644 index ae61f2db1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/cumsum.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {cumsum} from '../../ops/cumsum'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - cumsum( - axis?: number, exclusive?: boolean, reverse?: boolean): Tensor; - } -} - -getGlobalTensorClass().prototype.cumsum = function( - axis?: number, exclusive?: boolean, reverse?: boolean): Tensor { - this.throwIfDisposed(); - return cumsum(this, axis, exclusive, reverse); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/depth_to_space.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/depth_to_space.ts deleted file mode 100644 index 5d7c07bda..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/depth_to_space.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {depthToSpace} from '../../ops/depth_to_space'; -import {getGlobalTensorClass, Tensor4D} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - depthToSpace( - blockSize: number, dataFormat: 'NHWC'|'NCHW'): T; - } -} - -getGlobalTensorClass().prototype.depthToSpace = function( - blockSize: number, dataFormat: 'NHWC'|'NCHW'): T { - this.throwIfDisposed(); - return depthToSpace(this, blockSize, dataFormat) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/depthwise_conv2d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/depthwise_conv2d.ts deleted file mode 100644 index 1fbfa161c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/depthwise_conv2d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {depthwiseConv2d} from '../../ops/depthwise_conv2d'; -import {getGlobalTensorClass, Tensor3D, Tensor4D} from '../../tensor'; -import {Rank, TensorLike4D} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - depthwiseConv2d( - filter: Tensor4D|TensorLike4D, strides: [number, number]|number, - pad: 'valid'|'same'|number, dataFormat?: 'NHWC'|'NCHW', - dilations?: [number, number]|number, - dimRoundingMode?: 'floor'|'round'|'ceil'): T; - } -} - -getGlobalTensorClass().prototype.depthwiseConv2d = - function( - filter: Tensor4D|TensorLike4D, strides: [number, number]|number, - pad: 'valid'|'same'|number, dataFormat?: 'NHWC'|'NCHW', - dilations?: [number, number]|number, - dimRoundingMode?: 'floor'|'round'|'ceil'): T { - this.throwIfDisposed(); - return depthwiseConv2d( - this, filter, strides, pad, dataFormat, dilations, - dimRoundingMode) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/dilation2d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/dilation2d.ts deleted file mode 100644 index cdac3522e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/dilation2d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {dilation2d} from '../../ops/dilation2d'; -import {getGlobalTensorClass, Tensor3D, Tensor4D} from '../../tensor'; -import {Rank, TensorLike3D} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - dilation2d( - filter: Tensor3D|TensorLike3D, strides: [number, number]|number, - pad: 'valid'|'same', dilations?: [number, number]|number, - dataFormat?: 'NHWC'): T; - } -} - -getGlobalTensorClass().prototype.dilation2d = - function( - filter: Tensor3D|TensorLike3D, strides: [number, number]|number, - pad: 'valid'|'same', dilations?: [number, number]|number, - dataFormat?: 'NHWC'): T { - this.throwIfDisposed(); - return dilation2d(this, filter, strides, pad, dilations, dataFormat) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/div.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/div.ts deleted file mode 100644 index c4d6b595a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/div.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {div} from '../../ops/div'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - div(b: Tensor|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.div = function( - b: Tensor|TensorLike): T { - this.throwIfDisposed(); - return div(this, b); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/div_no_nan.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/div_no_nan.ts deleted file mode 100644 index 2bfb3b71c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/div_no_nan.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {divNoNan} from '../../ops/div_no_nan'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - divNoNan(b: Tensor|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.divNoNan = function( - b: Tensor|TensorLike): T { - this.throwIfDisposed(); - return divNoNan(this, b); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/dot.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/dot.ts deleted file mode 100644 index 869f9a7d8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/dot.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {dot} from '../../ops/dot'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - dot(b: Tensor|TensorLike): Tensor; - } -} - -getGlobalTensorClass().prototype.dot = function( - b: T|TensorLike): Tensor { - this.throwIfDisposed(); - return dot(this, b); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/elu.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/elu.ts deleted file mode 100644 index 244070334..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/elu.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {elu} from '../../ops/elu'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - elu(): T; - } -} - -getGlobalTensorClass().prototype.elu = function(this: T): T { - this.throwIfDisposed(); - return elu(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/equal.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/equal.ts deleted file mode 100644 index c2cc13e94..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/equal.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {equal} from '../../ops/equal'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - equal(b: Tensor|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.equal = function( - b: Tensor|TensorLike): T { - this.throwIfDisposed(); - return equal(this, b); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/erf.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/erf.ts deleted file mode 100644 index ac7ad5e97..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/erf.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {erf} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - erf(this: T): T; - } -} - -getGlobalTensorClass().prototype.erf = function(this: T): T { - this.throwIfDisposed(); - return erf(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/exp.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/exp.ts deleted file mode 100644 index aa2e04cf4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/exp.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {exp} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - exp(this: T): T; - } -} - -getGlobalTensorClass().prototype.exp = function(this: T): T { - this.throwIfDisposed(); - return exp(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/expand_dims.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/expand_dims.ts deleted file mode 100644 index 2f31f9d03..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/expand_dims.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {expandDims} from '../../ops/expand_dims'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - expandDims(axis?: number): T; - } -} - -getGlobalTensorClass().prototype.expandDims = function( - axis?: number): T { - this.throwIfDisposed(); - return expandDims(this, axis); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/expm1.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/expm1.ts deleted file mode 100644 index 59827b452..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/expm1.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {expm1} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - expm1(this: T): T; - } -} - -getGlobalTensorClass().prototype.expm1 = function(this: T): - T { - this.throwIfDisposed(); - return expm1(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/fft.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/fft.ts deleted file mode 100644 index 643d68123..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/fft.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {fft} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - fft(this: Tensor): Tensor; - } -} - -getGlobalTensorClass().prototype.fft = function(this: Tensor): - T { - this.throwIfDisposed(); - return fft(this) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/flatten.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/flatten.ts deleted file mode 100644 index d5c9c447a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/flatten.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {reshape} from '../../ops/reshape'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - flatten(): Tensor1D; - } -} - -/** - * Flatten a Tensor to a 1D array. - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.flatten = function(): T { - this.throwIfDisposed(); - return reshape(this, [this.size]) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/floor.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/floor.ts deleted file mode 100644 index 7f2d63a26..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/floor.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {floor} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - floor(this: T): T; - } -} - -getGlobalTensorClass().prototype.floor = function(this: T): - T { - this.throwIfDisposed(); - return floor(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/floorDiv.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/floorDiv.ts deleted file mode 100644 index a003560dc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/floorDiv.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {floorDiv} from '../../ops/floorDiv'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - floorDiv(b: Tensor|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.floorDiv = function( - b: Tensor|TensorLike): T { - this.throwIfDisposed(); - return floorDiv(this, b); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/gather.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/gather.ts deleted file mode 100644 index 8064fb054..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/gather.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {gather} from '../../ops/gather'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - gather( - this: T, indices: Tensor|TensorLike, axis?: number): T; - } -} - -getGlobalTensorClass().prototype.gather = function( - this: T, indices: Tensor|TensorLike, axis?: number): T { - this.throwIfDisposed(); - return gather(this, indices, axis); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/greater.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/greater.ts deleted file mode 100644 index 05a901d20..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/greater.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {greater} from '../../ops/greater'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - greater(b: Tensor|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.greater = function( - b: Tensor|TensorLike): T { - this.throwIfDisposed(); - return greater(this, b); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/greater_equal.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/greater_equal.ts deleted file mode 100644 index c225b03bf..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/greater_equal.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {greaterEqual} from '../../ops/greater_equal'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - greaterEqual(b: Tensor|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.greaterEqual = function( - b: Tensor|TensorLike): T { - this.throwIfDisposed(); - return greaterEqual(this, b); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ifft.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ifft.ts deleted file mode 100644 index 7f737c8fc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ifft.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {ifft} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - ifft(this: Tensor): Tensor; - } -} - -getGlobalTensorClass().prototype.ifft = function( - this: Tensor): T { - this.throwIfDisposed(); - return ifft(this) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/irfft.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/irfft.ts deleted file mode 100644 index 951ba1ae4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/irfft.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {irfft} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - irfft(this: Tensor): Tensor; - } -} - -getGlobalTensorClass().prototype.irfft = function( - this: Tensor): T { - this.throwIfDisposed(); - return irfft(this) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_finite.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_finite.ts deleted file mode 100644 index 6c02751f3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_finite.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {isFinite} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - isFinite(this: T): T; - } -} - -getGlobalTensorClass().prototype.isFinite = function(this: T): - T { - this.throwIfDisposed(); - return isFinite(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_inf.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_inf.ts deleted file mode 100644 index cc9ef249f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_inf.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {isInf} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - isInf(this: T): T; - } -} - -getGlobalTensorClass().prototype.isInf = function(this: T): - T { - this.throwIfDisposed(); - return isInf(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_nan.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_nan.ts deleted file mode 100644 index 094f3c428..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/is_nan.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {isNaN} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - isNaN(this: T): T; - } -} - -getGlobalTensorClass().prototype.isNaN = function(this: T): - T { - this.throwIfDisposed(); - return isNaN(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/leaky_relu.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/leaky_relu.ts deleted file mode 100644 index 4d7f42650..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/leaky_relu.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {leakyRelu} from '../../ops/leaky_relu'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - leakyRelu(alpha: number): T; - } -} - -getGlobalTensorClass().prototype.leakyRelu = function( - this: T, alpha: number): T { - this.throwIfDisposed(); - return leakyRelu(this, alpha); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/less.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/less.ts deleted file mode 100644 index 76859d9fd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/less.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {less} from '../../ops/less'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - less(b: Tensor|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.less = function( - b: Tensor|TensorLike): T { - this.throwIfDisposed(); - return less(this, b); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/less_equal.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/less_equal.ts deleted file mode 100644 index b03276541..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/less_equal.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {lessEqual} from '../../ops/less_equal'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - lessEqual(b: Tensor|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.lessEqual = function( - b: Tensor|TensorLike): T { - this.throwIfDisposed(); - return lessEqual(this, b); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/local_response_normalization.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/local_response_normalization.ts deleted file mode 100644 index d641c6f13..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/local_response_normalization.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {localResponseNormalization} from '../../ops/local_response_normalization'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - localResponseNormalization( - depthRadius?: number, bias?: number, alpha?: number, beta?: number): T; - } -} - -getGlobalTensorClass().prototype.localResponseNormalization = - function( - depthRadius?: number, bias?: number, alpha?: number, beta?: number): T { - this.throwIfDisposed(); - return localResponseNormalization(this, depthRadius, bias, alpha, beta) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log.ts deleted file mode 100644 index 4fef252d8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {log} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - log(this: T): T; - } -} - -getGlobalTensorClass().prototype.log = function(this: T): T { - this.throwIfDisposed(); - return log(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log1p.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log1p.ts deleted file mode 100644 index 73e47e808..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log1p.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {log1p} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - log1p(this: T): T; - } -} - -getGlobalTensorClass().prototype.log1p = function(this: T): - T { - this.throwIfDisposed(); - return log1p(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_sigmoid.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_sigmoid.ts deleted file mode 100644 index 820c67378..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_sigmoid.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {logSigmoid} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - logSigmoid(this: T): T; - } -} - -getGlobalTensorClass().prototype.logSigmoid = function( - this: T): T { - this.throwIfDisposed(); - return logSigmoid(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_softmax.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_softmax.ts deleted file mode 100644 index 5d33e04ce..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_softmax.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {logSoftmax} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - logSoftmax(this: T, axis?: number): T; - } -} - -getGlobalTensorClass().prototype.logSoftmax = function( - this: T, axis?: number): T { - this.throwIfDisposed(); - return logSoftmax(this, axis); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_sum_exp.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_sum_exp.ts deleted file mode 100644 index 765c8358d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/log_sum_exp.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {logSumExp} from '../../ops/log_sum_exp'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - logSumExp( - this: T, axis?: number|number[], keepDims?: boolean): T; - } -} - -getGlobalTensorClass().prototype.logSumExp = function( - this: T, axis?: number|number[], keepDims?: boolean): T { - this.throwIfDisposed(); - return logSumExp(this, axis, keepDims); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_and.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_and.ts deleted file mode 100644 index da3c15121..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_and.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {logicalAnd} from '../../ops/logical_and'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - logicalAnd(b: Tensor|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.logicalAnd = function( - b: Tensor|TensorLike): T { - this.throwIfDisposed(); - return logicalAnd(this, b); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_not.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_not.ts deleted file mode 100644 index 3cd14a810..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_not.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {logicalNot} from '../../ops/logical_not'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - logicalNot(): T; - } -} - -getGlobalTensorClass().prototype.logicalNot = function(): T { - this.throwIfDisposed(); - return logicalNot(this) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_or.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_or.ts deleted file mode 100644 index 66374ae74..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_or.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {logicalOr} from '../../ops/logical_or'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - logicalOr(b: Tensor|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.logicalOr = function( - b: Tensor|TensorLike): T { - this.throwIfDisposed(); - return logicalOr(this, b); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_xor.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_xor.ts deleted file mode 100644 index c20bc54df..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/logical_xor.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {logicalXor} from '../../ops/logical_xor'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - logicalXor(b: Tensor|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.logicalXor = function( - b: Tensor|TensorLike): T { - this.throwIfDisposed(); - return logicalXor(this, b); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mat_mul.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mat_mul.ts deleted file mode 100644 index a56257fd0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mat_mul.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {matMul} from '../../ops/mat_mul'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - matMul( - b: Tensor|TensorLike, transposeA?: boolean, - transposeB?: boolean): Tensor; - } -} - -getGlobalTensorClass().prototype.matMul = function( - this: T, b: Tensor|TensorLike, transposeA?: boolean, - transposeB?: boolean): Tensor { - this.throwIfDisposed(); - return matMul(this, b, transposeA, transposeB); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/max.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/max.ts deleted file mode 100644 index 0d530ca56..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/max.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {max} from '../../ops/max'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - max(axis?: number|number[], keepDims?: boolean): T; - } -} - -getGlobalTensorClass().prototype.max = function( - axis?: number|number[], keepDims?: boolean): T { - this.throwIfDisposed(); - return max(this, axis, keepDims); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/max_pool.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/max_pool.ts deleted file mode 100644 index 954a66c1e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/max_pool.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {maxPool} from '../../ops/max_pool'; -import {getGlobalTensorClass, Tensor3D, Tensor4D} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - maxPool( - filterSize: [number, number]|number, strides: [number, number]|number, - pad: 'valid'|'same'|number, - dimRoundingMode?: 'floor'|'round'|'ceil'): T; - } -} - -getGlobalTensorClass().prototype.maxPool = - function( - this: T, filterSize: [number, number]|number, - strides: [number, number]|number, pad: 'valid'|'same'|number, - dimRoundingMode?: 'floor'|'round'|'ceil'): T { - this.throwIfDisposed(); - return maxPool(this, filterSize, strides, pad, dimRoundingMode); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/maximum.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/maximum.ts deleted file mode 100644 index e397003db..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/maximum.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {maximum} from '../../ops/maximum'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - maximum(b: Tensor|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.maximum = function( - b: Tensor|TensorLike): T { - this.throwIfDisposed(); - return maximum(this, b); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mean.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mean.ts deleted file mode 100644 index 0a5afec6e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mean.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {mean} from '../../ops/mean'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - mean(axis?: number|number[], keepDims?: boolean): T; - } -} - -getGlobalTensorClass().prototype.mean = function( - axis?: number|number[], keepDims?: boolean): T { - this.throwIfDisposed(); - return mean(this, axis, keepDims); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/min.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/min.ts deleted file mode 100644 index 24fab0bc4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/min.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {min} from '../../ops/min'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - min(axis?: number|number[], keepDims?: boolean): T; - } -} - -getGlobalTensorClass().prototype.min = function( - axis?: number|number[], keepDims?: boolean): T { - this.throwIfDisposed(); - return min(this, axis, keepDims); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/minimum.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/minimum.ts deleted file mode 100644 index 5b63edf52..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/minimum.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {minimum} from '../../ops/minimum'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - minimum(b: Tensor|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.minimum = function( - b: Tensor|TensorLike): T { - this.throwIfDisposed(); - return minimum(this, b); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mirror_pad.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mirror_pad.ts deleted file mode 100644 index 77e91c1f8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mirror_pad.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {mirrorPad} from '../../ops/mirror_pad'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - mirrorPad( - paddings: Array<[number, number]>, mode: 'reflect'|'symmetric'): T; - } -} - -getGlobalTensorClass().prototype.mirrorPad = function( - this: T, paddings: Array<[number, number]>, - mode: 'reflect'|'symmetric'): T { - this.throwIfDisposed(); - return mirrorPad(this, paddings, mode); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mod.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mod.ts deleted file mode 100644 index 1d48dba97..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mod.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {mod} from '../../ops/mod'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - mod(b: Tensor|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.mod = function( - b: Tensor|TensorLike): T { - this.throwIfDisposed(); - return mod(this, b); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mul.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mul.ts deleted file mode 100644 index 7ba2974bb..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/mul.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {mul} from '../../ops/mul'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - mul(b: Tensor|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.mul = function( - b: Tensor|TensorLike): T { - this.throwIfDisposed(); - return mul(this, b); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/neg.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/neg.ts deleted file mode 100644 index f0ff8d1af..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/neg.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {neg} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - neg(this: T): T; - } -} - -getGlobalTensorClass().prototype.neg = function(this: T): T { - this.throwIfDisposed(); - return neg(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/norm.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/norm.ts deleted file mode 100644 index f5db2a7cf..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/norm.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {norm} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - norm( - ord?: number|'euclidean'|'fro', axis?: number|number[], - keepDims?: boolean): Tensor; - } -} - -getGlobalTensorClass().prototype.norm = function( - ord?: number|'euclidean'|'fro', axis?: number|number[], - keepDims?: boolean) { - this.throwIfDisposed(); - return norm(this, ord, axis, keepDims) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/not_equal.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/not_equal.ts deleted file mode 100644 index a8eb6b649..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/not_equal.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {notEqual} from '../../ops/not_equal'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - notEqual(b: Tensor|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.notEqual = function( - b: Tensor|TensorLike): T { - this.throwIfDisposed(); - return notEqual(this, b); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/one_hot.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/one_hot.ts deleted file mode 100644 index afeda04fe..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/one_hot.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {oneHot} from '../../ops/one_hot'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - oneHot(depth: number, onValue: number, offValue: number): Tensor; - } -} - -getGlobalTensorClass().prototype.oneHot = function( - depth: number, onValue = 1, offValue = 0): Tensor { - this.throwIfDisposed(); - return oneHot(this, depth, onValue, offValue); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ones_like.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ones_like.ts deleted file mode 100644 index 31b16a789..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/ones_like.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {onesLike} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - onesLike(this: T): T; - } -} - -getGlobalTensorClass().prototype.onesLike = function(this: T): - T { - this.throwIfDisposed(); - return onesLike(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pad.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pad.ts deleted file mode 100644 index e8c7b1af1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pad.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {pad} from '../../ops/pad'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - pad( - paddings: Array<[number, number]>, constantValue?: number): T; - } -} - -getGlobalTensorClass().prototype.pad = function( - this: T, paddings: Array<[number, number]>, constantValue: number): T { - this.throwIfDisposed(); - return pad(this, paddings, constantValue); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pool.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pool.ts deleted file mode 100644 index b6996f393..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pool.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {pool} from '../../ops/pool'; -import {getGlobalTensorClass, Tensor3D, Tensor4D} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - pool( - windowShape: [number, number]|number, poolingType: 'avg'|'max', - padding: 'valid'|'same'|number, diationRate?: [number, number]|number, - strides?: [number, number]|number): T; - } -} - -getGlobalTensorClass().prototype.pool = function( - this: T, windowShape: [number, number]|number, poolingType: 'max'|'avg', - padding: 'valid'|'same'|number, dilationRate?: [number, number]|number, - strides?: [number, number]|number): T { - this.throwIfDisposed(); - return pool(this, windowShape, poolingType, padding, dilationRate, strides); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pow.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pow.ts deleted file mode 100644 index a8c06315e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/pow.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {pow} from '../../ops/pow'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - pow(exp: Tensor|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.pow = function( - exp: Tensor|TensorLike): T { - this.throwIfDisposed(); - return pow(this, exp); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/prelu.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/prelu.ts deleted file mode 100644 index 9f762c761..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/prelu.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {prelu} from '../../ops/prelu'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - prelu(alpha: T|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.prelu = function( - this: T, alpha: T|TensorLike): T { - this.throwIfDisposed(); - return prelu(this, alpha); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/prod.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/prod.ts deleted file mode 100644 index b642f2939..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/prod.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {prod} from '../../ops/prod'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - prod(this: T, axis?: number|number[], keepDims?: boolean): - T; - } -} - -getGlobalTensorClass().prototype.prod = function( - this: T, axis?: number|number[], keepDims?: boolean): T { - this.throwIfDisposed(); - return prod(this, axis, keepDims); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reciprocal.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reciprocal.ts deleted file mode 100644 index e7392385a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reciprocal.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {reciprocal} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - reciprocal(this: T): T; - } -} - -getGlobalTensorClass().prototype.reciprocal = function( - this: T): T { - this.throwIfDisposed(); - return reciprocal(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/register_all_chained_ops.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/register_all_chained_ops.ts deleted file mode 100644 index 66e092d2e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/register_all_chained_ops.ts +++ /dev/null @@ -1,152 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import './abs'; -import './acos'; -import './acosh'; -import './add'; -import './all'; -import './any'; -import './arg_max'; -import './arg_min'; -import './as_scalar'; -import './as_type'; -import './as1d'; -import './as2d'; -import './as3d'; -import './as4d'; -import './as5d'; -import './asin'; -import './asinh'; -import './atan'; -import './atan2'; -import './atanh'; -import './avg_pool'; -import './batch_to_space_nd'; -import './batchnorm'; -import './broadcast_to'; -import './cast'; -import './ceil'; -import './clip_by_value'; -import './concat'; -import './conv1d'; -import './conv2d_transpose'; -import './conv2d'; -import './cos'; -import './cosh'; -import './cumsum'; -import './depth_to_space'; -import './depthwise_conv2d'; -import './dilation2d'; -import './div_no_nan'; -import './div'; -import './dot'; -import './elu'; -import './equal'; -import './erf'; -import './exp'; -import './expand_dims'; -import './expm1'; -import './fft'; -import './flatten'; -import './floor'; -import './floorDiv'; -import './gather'; -import './greater_equal'; -import './greater'; -import './ifft'; -import './irfft'; -import './is_finite'; -import './is_inf'; -import './is_nan'; -import './leaky_relu'; -import './less_equal'; -import './less'; -import './local_response_normalization'; -import './log_sigmoid'; -import './log_softmax'; -import './log_sum_exp'; -import './log'; -import './log1p'; -import './logical_and'; -import './logical_not'; -import './logical_or'; -import './logical_xor'; -import './mat_mul'; -import './max_pool'; -import './max'; -import './maximum'; -import './mean'; -import './min'; -import './minimum'; -import './mirror_pad'; -import './mod'; -import './mul'; -import './neg'; -import './norm'; -import './not_equal'; -import './one_hot'; -import './ones_like'; -import './pad'; -import './pool'; -import './pow'; -import './prelu'; -import './prod'; -import './reciprocal'; -import './relu'; -import './relu6'; -import './reshape_as'; -import './reshape'; -import './resize_bilinear'; -import './resize_nearest_neighbor'; -import './reverse'; -import './rfft'; -import './round'; -import './rsqrt'; -import './selu'; -import './separable_conv2d'; -import './sigmoid'; -import './sign'; -import './sin'; -import './sinh'; -import './slice'; -import './softmax'; -import './softplus'; -import './space_to_batch_nd'; -import './split'; -import './sqrt'; -import './square'; -import './squared_difference'; -import './squeeze'; -import './stack'; -import './step'; -import './strided_slice'; -import './sub'; -import './sum'; -import './tan'; -import './tanh'; -import './tile'; -import './to_bool'; -import './to_float'; -import './to_int'; -import './topk'; -import './transpose'; -import './unique'; -import './unsorted_segment_sum'; -import './unstack'; -import './where'; -import './zeros_like'; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/relu.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/relu.ts deleted file mode 100644 index 119873ed4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/relu.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {relu} from '../../ops/relu'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - relu(): T; - } -} - -getGlobalTensorClass().prototype.relu = function(this: T): T { - this.throwIfDisposed(); - return relu(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/relu6.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/relu6.ts deleted file mode 100644 index 05c602aea..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/relu6.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {relu6} from '../../ops/relu6'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - relu6(): T; - } -} - -getGlobalTensorClass().prototype.relu6 = function(this: T): - T { - this.throwIfDisposed(); - return relu6(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reshape.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reshape.ts deleted file mode 100644 index 75a1265d3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reshape.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {reshape} from '../../ops/reshape'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - reshape(shape: number[]): T; - } -} - -getGlobalTensorClass().prototype.reshape = function( - shape: number[]): T { - this.throwIfDisposed(); - return reshape(this, shape) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reshape_as.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reshape_as.ts deleted file mode 100644 index 6a2e5de8f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reshape_as.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {reshape} from '../../ops/reshape'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - reshapeAs(x: T): T; - } -} - -/** - * Reshapes the tensor into the shape of the provided tensor. - * - * @param x The tensor of required shape. - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.reshapeAs = function(x: T): - T { - this.throwIfDisposed(); - return reshape(this, x.shape) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/resize_bilinear.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/resize_bilinear.ts deleted file mode 100644 index 76766cdd8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/resize_bilinear.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {resizeBilinear} from '../../ops/image/resize_bilinear'; -import {getGlobalTensorClass, Tensor3D, Tensor4D} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - resizeBilinear( - newShape2D: [number, number], alignCorners?: boolean, - halfPixelCenters?: boolean): T; - } -} - -getGlobalTensorClass().prototype.resizeBilinear = - function( - this: T, newShape2D: [number, number], alignCorners?: boolean, - halfPixelCenters?: boolean): T { - this.throwIfDisposed(); - return resizeBilinear(this, newShape2D, alignCorners, halfPixelCenters); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/resize_nearest_neighbor.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/resize_nearest_neighbor.ts deleted file mode 100644 index 4ea740abc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/resize_nearest_neighbor.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {resizeNearestNeighbor} from '../../ops/image/resize_nearest_neighbor'; -import {getGlobalTensorClass, Tensor3D, Tensor4D} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - resizeNearestNeighbor( - newShape2D: [number, number], alignCorners?: boolean, - halfFloatCenters?: boolean): T; - } -} - -getGlobalTensorClass().prototype.resizeNearestNeighbor = - function( - this: T, newShape2D: [number, number], alignCorners?: boolean, - halfFloatCenters?: boolean): T { - this.throwIfDisposed(); - return resizeNearestNeighbor( - this, newShape2D, alignCorners, halfFloatCenters); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reverse.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reverse.ts deleted file mode 100644 index 7a4189a3e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/reverse.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {reverse} from '../../ops/reverse'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - reverse(this: T, axis?: number|number[]): T; - } -} - -getGlobalTensorClass().prototype.reverse = function( - this: T, axis?: number|number[]): T { - this.throwIfDisposed(); - return reverse(this, axis); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/rfft.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/rfft.ts deleted file mode 100644 index 121b1aadf..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/rfft.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {rfft} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - rfft(this: Tensor): Tensor; - } -} - -getGlobalTensorClass().prototype.rfft = function( - this: Tensor): T { - this.throwIfDisposed(); - return rfft(this) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/round.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/round.ts deleted file mode 100644 index c0d337eb3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/round.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {round} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - round(this: T): T; - } -} - -getGlobalTensorClass().prototype.round = function(this: T): - T { - this.throwIfDisposed(); - return round(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/rsqrt.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/rsqrt.ts deleted file mode 100644 index 197f16e57..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/rsqrt.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {rsqrt} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - rsqrt(this: T): T; - } -} - -getGlobalTensorClass().prototype.rsqrt = function(this: T): - T { - this.throwIfDisposed(); - return rsqrt(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/selu.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/selu.ts deleted file mode 100644 index 527d2b92e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/selu.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {selu} from '../../ops/selu'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - selu(): T; - } -} - -getGlobalTensorClass().prototype.selu = function(this: T): T { - this.throwIfDisposed(); - return selu(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/separable_conv2d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/separable_conv2d.ts deleted file mode 100644 index 496bc7734..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/separable_conv2d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {separableConv2d} from '../../ops/separable_conv2d'; -import {getGlobalTensorClass, Tensor3D, Tensor4D} from '../../tensor'; -import {Rank, TensorLike, TensorLike4D} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - separableConv2d( - depthwiseFilter: Tensor4D|TensorLike4D, - pointwiseFilter: Tensor4D|TensorLike, strides: [number, number]|number, - pad: 'valid'|'same', dilation?: [number, number]|number, - dataFormat?: 'NHWC'|'NCHW'): T; - } -} - -getGlobalTensorClass().prototype.separableConv2d = - function( - depthwiseFilter: Tensor4D|TensorLike4D, - pointwiseFilter: Tensor4D|TensorLike, strides: [number, number]|number, - pad: 'valid'|'same', dilation?: [number, number]|number, - dataFormat?: 'NHWC'|'NCHW'): T { - this.throwIfDisposed(); - return separableConv2d( - this, depthwiseFilter, pointwiseFilter, strides, pad, dilation, - dataFormat) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sigmoid.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sigmoid.ts deleted file mode 100644 index e962ae995..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sigmoid.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {sigmoid} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - sigmoid(this: T): T; - } -} - -getGlobalTensorClass().prototype.sigmoid = function(this: T): - T { - this.throwIfDisposed(); - return sigmoid(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sign.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sign.ts deleted file mode 100644 index a05ec15e8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sign.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {sign} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - sign(this: T): T; - } -} - -getGlobalTensorClass().prototype.sign = function(this: T): T { - this.throwIfDisposed(); - return sign(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sin.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sin.ts deleted file mode 100644 index b46cb27e8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sin.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {sin} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - sin(this: T): T; - } -} - -getGlobalTensorClass().prototype.sin = function(this: T): T { - this.throwIfDisposed(); - return sin(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sinh.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sinh.ts deleted file mode 100644 index c699d78e7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sinh.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {sinh} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - sinh(this: T): T; - } -} - -getGlobalTensorClass().prototype.sinh = function(this: T): T { - this.throwIfDisposed(); - return sinh(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/slice.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/slice.ts deleted file mode 100644 index 369dcd417..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/slice.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {slice} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - slice( - this: T, begin: number|number[], size?: number|number[]): T; - } -} - -getGlobalTensorClass().prototype.slice = function( - this: T, begin: number|number[], size?: number|number[]): T { - this.throwIfDisposed(); - return slice(this, begin, size); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/softmax.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/softmax.ts deleted file mode 100644 index 56d388918..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/softmax.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {softmax} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - softmax(this: T, dim?: number): T; - } -} - -getGlobalTensorClass().prototype.softmax = function( - this: T, dim: number): T { - this.throwIfDisposed(); - return softmax(this, dim); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/softplus.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/softplus.ts deleted file mode 100644 index 756b43ec4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/softplus.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {softplus} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - softplus(this: T): T; - } -} - -getGlobalTensorClass().prototype.softplus = function(this: T): - T { - this.throwIfDisposed(); - return softplus(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/space_to_batch_nd.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/space_to_batch_nd.ts deleted file mode 100644 index 81e4856b2..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/space_to_batch_nd.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {spaceToBatchND} from '../../ops/space_to_batch_nd'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - spaceToBatchND(blockShape: number[], paddings: number[][]): - Tensor; - } -} - -getGlobalTensorClass().prototype.spaceToBatchND = function( - blockShape: number[], paddings: number[][]): Tensor { - this.throwIfDisposed(); - return spaceToBatchND(this, blockShape, paddings); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/split.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/split.ts deleted file mode 100644 index 524e7d1ef..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/split.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {split} from '../../ops/split'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - split(numOrSizeSplits: number[]|number, axis?: number): - T[]; - } -} - -getGlobalTensorClass().prototype.split = function( - numOrSizeSplits: number[]|number, axis?: number): T[] { - this.throwIfDisposed(); - return split(this, numOrSizeSplits, axis); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sqrt.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sqrt.ts deleted file mode 100644 index 8875fda87..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sqrt.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {sqrt} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - sqrt(this: T): T; - } -} - -getGlobalTensorClass().prototype.sqrt = function(this: T): T { - this.throwIfDisposed(); - return sqrt(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/square.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/square.ts deleted file mode 100644 index d66859308..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/square.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {square} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - square(this: T): T; - } -} - -getGlobalTensorClass().prototype.square = function(this: T): - T { - this.throwIfDisposed(); - return square(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/squared_difference.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/squared_difference.ts deleted file mode 100644 index a74c0563a..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/squared_difference.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {squaredDifference} from '../../ops/squared_difference'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - squaredDifference(b: Tensor|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.squaredDifference = function( - b: Tensor|TensorLike): T { - this.throwIfDisposed(); - return squaredDifference(this, b); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/squeeze.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/squeeze.ts deleted file mode 100644 index 65fd26739..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/squeeze.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {squeeze} from '../../ops/squeeze'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - squeeze(axis?: number[]): T; - } -} - -getGlobalTensorClass().prototype.squeeze = function( - axis?: number[]): T { - this.throwIfDisposed(); - return squeeze(this, axis); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/stack.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/stack.ts deleted file mode 100644 index dd1874363..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/stack.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {stack} from '../../ops/stack'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - stack(x: Tensor|Tensor[], axis?: number): T; - } -} - -getGlobalTensorClass().prototype.stack = function( - x: Tensor|Tensor[], axis?: number): T { - this.throwIfDisposed(); - const tensorsToBeStacked = x instanceof Tensor ? [this, x] : [this, ...x]; - return stack(tensorsToBeStacked, axis) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/step.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/step.ts deleted file mode 100644 index 10397f68b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/step.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {step} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - step(this: T, alpha?: number): T; - } -} - -getGlobalTensorClass().prototype.step = function( - this: T, alpha?: number) { - this.throwIfDisposed(); - return step(this, alpha); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/strided_slice.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/strided_slice.ts deleted file mode 100644 index 9170b0d0d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/strided_slice.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {stridedSlice} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - stridedSlice( - this: Tensor, begin: number[], end: number[], strides: number[], - beginMask?: number, endMask?: number, ellipsisMask?: number, - newAxisMask?: number, shrinkAxisMask?: number): Tensor; - } -} - -getGlobalTensorClass().prototype.stridedSlice = function( - this: Tensor, begin: number[], end: number[], strides: number[], - beginMask?: number, endMask?: number, ellipsisMask?: number, - newAxisMask?: number, shrinkAxisMask?: number): T { - this.throwIfDisposed(); - return stridedSlice( - this, begin, end, strides, beginMask, endMask, ellipsisMask, - newAxisMask, shrinkAxisMask) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sub.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sub.ts deleted file mode 100644 index 5e0fa3f77..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sub.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {sub} from '../../ops/sub'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - sub(b: Tensor|TensorLike): T; - } -} - -getGlobalTensorClass().prototype.sub = function( - b: Tensor|TensorLike): T { - this.throwIfDisposed(); - return sub(this, b); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sum.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sum.ts deleted file mode 100644 index 01f3a2b74..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/sum.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {sum} from '../../ops/sum'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - sum(axis?: number|number[], keepDims?: boolean): T; - } -} - -getGlobalTensorClass().prototype.sum = function( - axis?: number|number[], keepDims?: boolean): T { - this.throwIfDisposed(); - return sum(this, axis, keepDims); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tan.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tan.ts deleted file mode 100644 index 7717f596e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tan.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {tan} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - tan(this: T): T; - } -} - -getGlobalTensorClass().prototype.tan = function(this: T): T { - this.throwIfDisposed(); - return tan(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tanh.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tanh.ts deleted file mode 100644 index 2d8656955..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tanh.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {tanh} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - tanh(this: T): T; - } -} - -getGlobalTensorClass().prototype.tanh = function(this: T): T { - this.throwIfDisposed(); - return tanh(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tile.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tile.ts deleted file mode 100644 index 731b0457d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/tile.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {tile} from '../../ops/tile'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - tile(b: number[]): T; - } -} - -getGlobalTensorClass().prototype.tile = function( - reps: number[]): T { - this.throwIfDisposed(); - return tile(this, reps) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_bool.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_bool.ts deleted file mode 100644 index 123f1342d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_bool.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {cast} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - toBool(this: T): T; - } -} - -/** - * Casts the array to type `bool` - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.toBool = function(this: T): - T { - this.throwIfDisposed(); - return cast(this, 'bool'); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_float.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_float.ts deleted file mode 100644 index 59ea64dde..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_float.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {cast} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - toFloat(this: T): T; - } -} - -/** - * Casts the array to type `float32` - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.toFloat = function(this: T): - T { - this.throwIfDisposed(); - return cast(this, 'float32'); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_int.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_int.ts deleted file mode 100644 index ef6bd9466..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/to_int.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {cast} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - toInt(this: T): T; - } -} - -/** - * Casts the array to type `int32` - * - * @doc {heading: 'Tensors', subheading: 'Classes'} - */ -getGlobalTensorClass().prototype.toInt = function(this: T): - T { - this.throwIfDisposed(); - return cast(this, 'int32'); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/topk.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/topk.ts deleted file mode 100644 index 2ccbf9473..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/topk.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {topk} from '../../ops/topk'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - topk(this: T, k?: number, sorted?: boolean): - {values: T, indices: T}; - } -} - -getGlobalTensorClass().prototype.topk = function( - this: T, k?: number, sorted?: boolean): {values: T, indices: T} { - this.throwIfDisposed(); - return topk(this, k, sorted) as {values: T, indices: T}; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/transpose.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/transpose.ts deleted file mode 100644 index dd5fbe48c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/transpose.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {transpose} from '../../ops/transpose'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - transpose(perm?: number[]): T; - } -} - -getGlobalTensorClass().prototype.transpose = function( - this: T, perm?: number[]): T { - this.throwIfDisposed(); - return transpose(this, perm); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unique.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unique.ts deleted file mode 100644 index 139336bcb..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unique.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {unique} from '../../ops/unique'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - unique(this: T, axis?: number): {values: T, indices: T}; - } -} - -getGlobalTensorClass().prototype.unique = function( - this: T, axis?: number): {values: T, indices: T} { - this.throwIfDisposed(); - return unique(this, axis) as {values: T, indices: T}; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unsorted_segment_sum.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unsorted_segment_sum.ts deleted file mode 100644 index a5fff2bd4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unsorted_segment_sum.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {unsortedSegmentSum} from '../../ops/unsorted_segment_sum'; -import {getGlobalTensorClass, Tensor, Tensor1D} from '../../tensor'; -import {Rank, TensorLike1D} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - unsortedSegmentSum( - this: T, segmentIds: Tensor1D|TensorLike1D, numSegments: number): T; - } -} - -getGlobalTensorClass().prototype.unsortedSegmentSum = - function( - this: T, segmentIds: Tensor1D|TensorLike1D, numSegments: number): T { - this.throwIfDisposed(); - return unsortedSegmentSum(this, segmentIds, numSegments); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unstack.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unstack.ts deleted file mode 100644 index 69ebda651..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/unstack.ts +++ /dev/null @@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import {unstack} from '../../ops/unstack'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - unstack(axis?: number): T[]; - } -} - -getGlobalTensorClass().prototype.unstack = function( - axis?: number): T[] { - this.throwIfDisposed(); - return unstack(this, axis) as T[]; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/where.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/where.ts deleted file mode 100644 index c3ed66e24..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/where.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -import {where} from '../../ops/where'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank, TensorLike} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - where(condition: Tensor|TensorLike, x: Tensor|TensorLike): - T; - } -} - -getGlobalTensorClass().prototype.where = function( - condition: Tensor|TensorLike, x: Tensor|TensorLike): T { - this.throwIfDisposed(); - return where(condition, this, x) as T; -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/zeros_like.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/zeros_like.ts deleted file mode 100644 index 56104301e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-core/src/public/chained_ops/zeros_like.ts +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @license - * Copyright 2020 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ - -// TODO update import path once op is modularized. -import {zerosLike} from '../../ops/ops'; -import {getGlobalTensorClass, Tensor} from '../../tensor'; -import {Rank} from '../../types'; - -declare module '../../tensor' { - interface Tensor { - zerosLike(this: T): T; - } -} - -getGlobalTensorClass().prototype.zerosLike = function( - this: T): T { - this.throwIfDisposed(); - return zerosLike(this); -}; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/.nycrc b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/.nycrc deleted file mode 100644 index 5b0a53ac7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/.nycrc +++ /dev/null @@ -1,19 +0,0 @@ -{ - "extension": [ - ".ts" - ], - "reporter": [ - "html", - "text-summary" - ], - "include": [ - "src/**/*" - ], - "exclude": [ - "src/test_node.ts", - "src/**/*_test.ts" - ], - "cache": false, - "sourceMap": true, - "instrument": true -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/README.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/README.md deleted file mode 100644 index a65987172..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/README.md +++ /dev/null @@ -1,89 +0,0 @@ -# TensorFlow.js Data - -**This repo is under active development and is not production-ready. We are -actively developing as an open source project.** - -TensorFlow.js Data provides simple APIs to load and parse data from disk or over -the web in a variety of formats, and to prepare that data for use in machine -learning models (e.g. via operations like filter, map, shuffle, and batch). - -This project is the JavaScript analogue of -[tf.data](https://www.tensorflow.org/get_started/datasets_quickstart) on the -Python/C++ side. TF.js Data will match the tf.data API to the extent possible. - -To keep track of issues we use the [tensorflow/tfjs](https://github.com/tensorflow/tfjs/issues?q=is%3Aissue+is%3Aopen+label%3Acomp%3Adata) Github repo with `comp:data` tag. - -## Importing - -There are two ways to import TensorFlow.js Data - -1. You can access TensorFlow.js Data through the union package: [@tensorflow/tfjs](https://www.npmjs.com/package/@tensorflow/tfjs) -2. You can get TensorFlow.js Data as a module: - [@tensorflow/tfjs-data](https://www.npmjs.com/package/@tensorflow/tfjs-data). - Note that `tfjs-data` has peer dependency on tfjs-core, so if you import - `@tensorflow/tfjs-data`, you also need to import - `@tensorflow/tfjs-core`. - -## Sample Usage - -Reading a CSV file - -```js -import * as tf from '@tensorflow/tfjs'; - -const csvUrl = 'https://storage.googleapis.com/tfjs-examples/multivariate-linear-regression/data/boston-housing-train.csv'; - -async function run() { - // We want to predict the column "medv", which represents a median value of a - // home (in $1000s), so we mark it as a label. - const csvDataset = tf.data.csv( - csvUrl, { - columnConfigs: { - medv: { - isLabel: true - } - } - }); - // Number of features is the number of column names minus one for the label - // column. - const numOfFeatures = (await csvDataset.columnNames()).length - 1; - - // Prepare the Dataset for training. - const flattenedDataset = - csvDataset - .map(({xs, ys}) => { - // Convert xs(features) and ys(labels) from object form (keyed by column - // name) to array form. - return {xs: Object.values(xs), ys: Object.values(ys)}; - }) - .batch(10); - - // Define the model. - const model = tf.sequential(); - model.add(tf.layers.dense({ - inputShape: [numOfFeatures], - units: 1 - })); - model.compile({ - optimizer: tf.train.sgd(0.000001), - loss: 'meanSquaredError' - }); - - // Fit the model using the prepared Dataset - return model.fitDataset(flattenedDataset, { - epochs: 10, - callbacks: { - onEpochEnd: async (epoch, logs) => { - console.log(epoch, logs.loss); - } - } - }); -} - -run().then(() => console.log('Done')); -``` - -## For more information - -- [TensorFlow.js API documentation](https://js.tensorflow.org/api/latest/) -- [TensorFlow.js Tutorials](https://js.tensorflow.org/tutorials/) diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/ROADMAP.md b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/ROADMAP.md deleted file mode 100644 index 4ca466170..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/ROADMAP.md +++ /dev/null @@ -1,18 +0,0 @@ -# TensorFlow.js Data Roadmap - -**This repo is under active development as an open source project.** - -Following is a list of major upcoming features. For details please see the [issue list](https://github.com/tensorflow/tfjs/issues). - -## v0.2.0 -1. Add/Update API to load local file as stream in Node.js env [tracking issue](https://github.com/tensorflow/tfjs/issues/1008) -2. Provide microphone data source [tracking issue](https://github.com/tensorflow/tfjs/issues/1004) -3. Provide webcam data source [tracking issue](https://github.com/tensorflow/tfjs/issues/1005) - -## v0.3.0 -1. Support decoding/resizing image data [tracking issue](https://github.com/tensorflow/tfjs/issues/1003) -2. Statistics API for `Dataset` - -## Future -1. Support HTTP request with headers for `UrlDataSource` [tracking issue](https://github.com/tensorflow/tfjs/issues/1002) - diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/dataset.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/dataset.d.ts deleted file mode 100644 index 92d755a08..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/dataset.d.ts +++ /dev/null @@ -1,394 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -import * as tf from '@tensorflow/tfjs-core'; -import { TensorContainer } from '@tensorflow/tfjs-core'; -import { LazyIterator } from './iterators/lazy_iterator'; -import { Container } from './types'; -/** - * A nested structure of Datasets, used as the input to zip(). - */ -export declare type DatasetContainer = Container>; -/** - * Represents a potentially large list of independent data elements (typically - * 'samples' or 'examples'). - * - * A 'data example' may be a primitive, an array, a map from string keys to - * values, or any nested structure of these. - * - * A `Dataset` represents an ordered collection of elements, together with a - * chain of transformations to be performed on those elements. Each - * transformation is a method of `Dataset` that returns another `Dataset`, so - * these may be chained, e.g. - * `const processedDataset = rawDataset.filter(...).map(...).batch(...)`. - * - * Data loading and transformation is done in a lazy, streaming fashion. The - * dataset may be iterated over multiple times; each iteration starts the data - * loading anew and recapitulates the transformations. - * - * A `Dataset` is typically processed as a stream of unbatched examples --i.e., - * its transformations are applied one example at a time. Batching produces a - * new `Dataset` where each element is a batch. Batching should usually come - * last in a pipeline, because data transformations are easier to express on a - * per-example basis than on a per-batch basis. - * - * The following code examples are calling `await dataset.forEachAsync(...)` to - * iterate once over the entire dataset in order to print out the data. - * - * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'} - */ -export declare abstract class Dataset { - abstract iterator(): Promise>; - readonly size: number; - /** - * Groups elements into batches. - * - * It is assumed that each of the incoming dataset elements has the same - * structure-- i.e. the same set of keys at each location in an object - * hierarchy. For each key, the resulting `Dataset` provides a batched - * element collecting all of the incoming values for that key. - * - * * Incoming primitives are grouped into a 1-D Tensor. - * * Incoming Tensors are grouped into a new Tensor where the 0'th axis is - * the batch dimension. - * * Incoming arrays are converted to Tensor and then batched. - * * A nested array is interpreted as an n-D Tensor, so the batched result - * has n+1 dimensions. - * * An array that cannot be converted to Tensor produces an error. - * - * If an array should not be batched as a unit, it should first be converted - * to an object with integer keys. - * - * Here are a few examples: - * - * Batch a dataset of numbers: - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8]).batch(4); - * await a.forEachAsync(e => e.print()); - * ``` - * - * Batch a dataset of arrays: - * ```js - * const b = tf.data.array([[1], [2], [3], [4], [5], [6], [7], [8]]).batch(4); - * await b.forEachAsync(e => e.print()); - * ``` - * - * Batch a dataset of objects: - * ```js - * const c = tf.data.array([{a: 1, b: 11}, {a: 2, b: 12}, {a: 3, b: 13}, - * {a: 4, b: 14}, {a: 5, b: 15}, {a: 6, b: 16}, {a: 7, b: 17}, - * {a: 8, b: 18}]).batch(4); - * await c.forEachAsync(e => { - * console.log('{'); - * for(var key in e) { - * console.log(key+':'); - * e[key].print(); - * } - * console.log('}'); - * }) - * ``` - * - * @param batchSize The number of elements desired per batch. - * @param smallLastBatch Whether to emit the final batch when it has fewer - * than batchSize elements. Default true. - * @returns A `Dataset`, from which a stream of batches can be obtained. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - batch(batchSize: number, smallLastBatch?: boolean): Dataset; - /** - * Concatenates this `Dataset` with another. - * - * ```js - * const a = tf.data.array([1, 2, 3]); - * const b = tf.data.array([4, 5, 6]); - * const c = a.concatenate(b); - * await c.forEachAsync(e => console.log(e)); - * ``` - * - * @param dataset A `Dataset` to be concatenated onto this one. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - concatenate(dataset: Dataset): Dataset; - /** - * Filters this dataset according to `predicate`. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) - * .filter(x => x%2 === 0); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param predicate A function mapping a dataset element to a boolean or a - * `Promise` for one. - * - * @returns A `Dataset` of elements for which the predicate was true. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - filter(predicate: (value: T) => boolean): Dataset; - /** - * Apply a function to every element of the dataset. - * - * After the function is applied to a dataset element, any Tensors contained - * within that element are disposed. - * - * ```js - * const a = tf.data.array([1, 2, 3]); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param f A function to apply to each dataset element. - * @returns A `Promise` that resolves after all elements have been processed. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - forEachAsync(f: (input: T) => void): Promise; - /** - * Maps this dataset through a 1-to-1 transform. - * - * ```js - * const a = tf.data.array([1, 2, 3]).map(x => x*x); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param transform A function mapping a dataset element to a transformed - * dataset element. - * - * @returns A `Dataset` of transformed elements. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - map(transform: (value: T) => O): Dataset; - /** - * Maps this dataset through an async 1-to-1 transform. - * - * ```js - * const a = - * tf.data.array([1, 2, 3]).mapAsync(x => new Promise(function(resolve){ - * setTimeout(() => { - * resolve(x * x); - * }, Math.random()*1000 + 500); - * })); - * console.log(await a.toArray()); - * ``` - * - * @param transform A function mapping a dataset element to a `Promise` for a - * transformed dataset element. This transform is responsible for disposing - * any intermediate `Tensor`s, i.e. by wrapping its computation in - * `tf.tidy()`; that cannot be automated here (as it is in the synchronous - * `map()` case). - * - * @returns A `Dataset` of transformed elements. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - mapAsync(transform: (value: T) => Promise): Dataset; - /** - * Creates a `Dataset` that prefetches elements from this dataset. - * - * @param bufferSize: An integer specifying the number of elements to be - * prefetched. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - prefetch(bufferSize: number): Dataset; - /** - * Repeats this dataset `count` times. - * - * NOTE: If this dataset is a function of global state (e.g. a random number - * generator), then different repetitions may produce different elements. - * - * ```js - * const a = tf.data.array([1, 2, 3]).repeat(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param count: (Optional) An integer, representing the number of times - * the dataset should be repeated. The default behavior (if `count` is - * `undefined` or negative) is for the dataset be repeated indefinitely. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - repeat(count?: number): Dataset; - /** - * Creates a `Dataset` that skips `count` initial elements from this dataset. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]).skip(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param count: The number of elements of this dataset that should be skipped - * to form the new dataset. If `count` is greater than the size of this - * dataset, the new dataset will contain no elements. If `count` - * is `undefined` or negative, skips the entire dataset. - * - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - skip(count: number): Dataset; - static readonly MAX_BUFFER_SIZE = 10000; - /** - * Pseudorandomly shuffles the elements of this dataset. This is done in a - * streaming manner, by sampling from a given number of prefetched elements. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]).shuffle(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param bufferSize: An integer specifying the number of elements from this - * dataset from which the new dataset will sample. - * @param seed: (Optional) An integer specifying the random seed that will - * be used to create the distribution. - * @param reshuffleEachIteration: (Optional) A boolean, which if true - * indicates that the dataset should be pseudorandomly reshuffled each time - * it is iterated over. If false, elements will be returned in the same - * shuffled order on each iteration. (Defaults to `true`.) - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - shuffle(bufferSize: number, seed?: string, reshuffleEachIteration?: boolean): Dataset; - /** - * Creates a `Dataset` with at most `count` initial elements from this - * dataset. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]).take(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param count: The number of elements of this dataset that should be taken - * to form the new dataset. If `count` is `undefined` or negative, or if - * `count` is greater than the size of this dataset, the new dataset will - * contain all elements of this dataset. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - take(count: number): Dataset; - /** - * Collect all elements of this dataset into an array. - * - * Obviously this will succeed only for small datasets that fit in memory. - * Useful for testing and generally should be avoided if possible. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]); - * console.log(await a.toArray()); - * ``` - * - * @returns A Promise for an array of elements, which will resolve - * when a new stream has been obtained and fully consumed. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - toArray(): Promise; - /** - * 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; -} -/** - * Create a `Dataset` defined by a provided iterator() function. - * - * ```js - * let i = -1; - * const func = () => - * ++i < 5 ? {value: i, done: false} : {value: null, done: true}; - * const iter = tf.data.iteratorFromFunction(func); - * const ds = tf.data.datasetFromIteratorFn(iter); - * await ds.forEachAsync(e => console.log(e)); - * ``` - */ -export declare function datasetFromIteratorFn(iteratorFn: () => Promise>, size?: number): Dataset; -/** - * Create a `Dataset` from an array of elements. - * - * Create a Dataset from an array of objects: - * ```js - * const a = tf.data.array([{'item': 1}, {'item': 2}, {'item': 3}]); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * Create a Dataset from an array of numbers: - * ```js - * const a = tf.data.array([4, 5, 6]); - * await a.forEachAsync(e => console.log(e)); - * ``` - * @param items An array of elements that will be parsed as items in a dataset. - * - * @doc {heading: 'Data', subheading: 'Creation', namespace: 'data'} - */ -export declare function array(items: T[]): Dataset; -/** - * Create a `Dataset` by zipping together an array, dict, or nested - * structure of `Dataset`s (and perhaps additional constants). - * The underlying datasets must provide elements in a consistent order such that - * they correspond. - * - * The number of elements in the resulting dataset is the same as the size of - * the smallest dataset in datasets. - * - * The nested structure of the `datasets` argument determines the - * structure of elements in the resulting iterator. - * - * Note this means that, given an array of two datasets that produce dict - * elements, the result is a dataset that produces elements that are arrays - * of two dicts: - * - * Zip an array of datasets: - * ```js - * console.log('Zip two datasets of objects:'); - * const ds1 = tf.data.array([{a: 1}, {a: 2}, {a: 3}]); - * const ds2 = tf.data.array([{b: 4}, {b: 5}, {b: 6}]); - * const ds3 = tf.data.zip([ds1, ds2]); - * await ds3.forEachAsync(e => console.log(JSON.stringify(e))); - * - * // If the goal is to merge the dicts in order to produce elements like - * // {a: ..., b: ...}, this requires a second step such as: - * console.log('Merge the objects:'); - * const ds4 = ds3.map(x => {return {a: x[0].a, b: x[1].b}}); - * await ds4.forEachAsync(e => console.log(e)); - * ``` - * - * Zip a dict of datasets: - * ```js - * const a = tf.data.array([{a: 1}, {a: 2}, {a: 3}]); - * const b = tf.data.array([{b: 4}, {b: 5}, {b: 6}]); - * const c = tf.data.zip({c: a, d: b}); - * await c.forEachAsync(e => console.log(JSON.stringify(e))); - * ``` - * - * @doc {heading: 'Data', subheading: 'Operations', namespace: 'data'} - */ -export declare function zip(datasets: DatasetContainer): Dataset; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/dataset.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/dataset.js deleted file mode 100644 index 8422ee8d4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/dataset.js +++ /dev/null @@ -1,659 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -import * as tf from '@tensorflow/tfjs-core'; -import * as seedrandom from 'seedrandom'; -import { iteratorFromConcatenated, iteratorFromFunction, iteratorFromItems, iteratorFromZipped, ZipMismatchMode } from './iterators/lazy_iterator'; -import { canTensorify, deepMapAndAwaitAll, isIterable } from './util/deep_map'; -// TODO(soergel): consider vectorized operations within the pipeline. -/** - * Represents a potentially large list of independent data elements (typically - * 'samples' or 'examples'). - * - * A 'data example' may be a primitive, an array, a map from string keys to - * values, or any nested structure of these. - * - * A `Dataset` represents an ordered collection of elements, together with a - * chain of transformations to be performed on those elements. Each - * transformation is a method of `Dataset` that returns another `Dataset`, so - * these may be chained, e.g. - * `const processedDataset = rawDataset.filter(...).map(...).batch(...)`. - * - * Data loading and transformation is done in a lazy, streaming fashion. The - * dataset may be iterated over multiple times; each iteration starts the data - * loading anew and recapitulates the transformations. - * - * A `Dataset` is typically processed as a stream of unbatched examples --i.e., - * its transformations are applied one example at a time. Batching produces a - * new `Dataset` where each element is a batch. Batching should usually come - * last in a pipeline, because data transformations are easier to express on a - * per-example basis than on a per-batch basis. - * - * The following code examples are calling `await dataset.forEachAsync(...)` to - * iterate once over the entire dataset in order to print out the data. - * - * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'} - */ -export class Dataset { - constructor() { - this.size = null; - } - // TODO(soergel): Make Datasets report whether repeated iterator() calls - // produce the same result (e.g., reading from a file) or different results - // (e.g., from the webcam). Currently we don't make this distinction but it - // could be important for the user to know. - // abstract isDeterministic(): boolean; - /** - * Groups elements into batches. - * - * It is assumed that each of the incoming dataset elements has the same - * structure-- i.e. the same set of keys at each location in an object - * hierarchy. For each key, the resulting `Dataset` provides a batched - * element collecting all of the incoming values for that key. - * - * * Incoming primitives are grouped into a 1-D Tensor. - * * Incoming Tensors are grouped into a new Tensor where the 0'th axis is - * the batch dimension. - * * Incoming arrays are converted to Tensor and then batched. - * * A nested array is interpreted as an n-D Tensor, so the batched result - * has n+1 dimensions. - * * An array that cannot be converted to Tensor produces an error. - * - * If an array should not be batched as a unit, it should first be converted - * to an object with integer keys. - * - * Here are a few examples: - * - * Batch a dataset of numbers: - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8]).batch(4); - * await a.forEachAsync(e => e.print()); - * ``` - * - * Batch a dataset of arrays: - * ```js - * const b = tf.data.array([[1], [2], [3], [4], [5], [6], [7], [8]]).batch(4); - * await b.forEachAsync(e => e.print()); - * ``` - * - * Batch a dataset of objects: - * ```js - * const c = tf.data.array([{a: 1, b: 11}, {a: 2, b: 12}, {a: 3, b: 13}, - * {a: 4, b: 14}, {a: 5, b: 15}, {a: 6, b: 16}, {a: 7, b: 17}, - * {a: 8, b: 18}]).batch(4); - * await c.forEachAsync(e => { - * console.log('{'); - * for(var key in e) { - * console.log(key+':'); - * e[key].print(); - * } - * console.log('}'); - * }) - * ``` - * - * @param batchSize The number of elements desired per batch. - * @param smallLastBatch Whether to emit the final batch when it has fewer - * than batchSize elements. Default true. - * @returns A `Dataset`, from which a stream of batches can be obtained. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - batch(batchSize, smallLastBatch = true) { - const base = this; - tf.util.assert(batchSize > 0, () => `batchSize needs to be positive, but it is - ${batchSize}`); - let size; - if (this.size === Infinity || this.size == null) { - // If the size of this dataset is infinity or null, the new size keeps the - // same. - size = this.size; - } - else if (smallLastBatch) { - // If the size of this dataset is known and include small last batch, the - // new size is full batch count plus last batch. - size = Math.ceil(this.size / batchSize); - } - else { - // If the size of this dataset is known and not include small last batch, - // the new size is full batch count. - size = Math.floor(this.size / batchSize); - } - return datasetFromIteratorFn(async () => { - return (await base.iterator()) - .columnMajorBatch(batchSize, smallLastBatch, deepBatchConcat); - }, size); - } - /** - * Concatenates this `Dataset` with another. - * - * ```js - * const a = tf.data.array([1, 2, 3]); - * const b = tf.data.array([4, 5, 6]); - * const c = a.concatenate(b); - * await c.forEachAsync(e => console.log(e)); - * ``` - * - * @param dataset A `Dataset` to be concatenated onto this one. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - concatenate(dataset) { - const base = this; - let size; - if (this.size === Infinity || dataset.size === Infinity) { - // If the size of any of these two dataset is infinity, new size is - // infinity. - size = Infinity; - } - else if (this.size != null && dataset.size != null) { - // If the size of both datasets are known and not infinity, new size is - // sum the size of these two datasets. - size = this.size + dataset.size; - } - else { - // If neither of these two datasets has infinite size and any of these two - // datasets' size is null, the new size is null. - size = null; - } - return datasetFromIteratorFn(async () => (await base.iterator()).concatenate(await dataset.iterator()), size); - } - /** - * Filters this dataset according to `predicate`. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) - * .filter(x => x%2 === 0); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param predicate A function mapping a dataset element to a boolean or a - * `Promise` for one. - * - * @returns A `Dataset` of elements for which the predicate was true. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - filter(predicate) { - const base = this; - let size; - if (this.size === Infinity) { - // If the size of this dataset is infinity, new size is infinity - size = Infinity; - } - else { - // If this dataset has limited elements, new size is null because it might - // exhausted randomly. - size = null; - } - return datasetFromIteratorFn(async () => { - return (await base.iterator()).filter(x => tf.tidy(() => predicate(x))); - }, size); - } - /** - * Apply a function to every element of the dataset. - * - * After the function is applied to a dataset element, any Tensors contained - * within that element are disposed. - * - * ```js - * const a = tf.data.array([1, 2, 3]); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param f A function to apply to each dataset element. - * @returns A `Promise` that resolves after all elements have been processed. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - async forEachAsync(f) { - return (await this.iterator()).forEachAsync(f); - } - /** - * Maps this dataset through a 1-to-1 transform. - * - * ```js - * const a = tf.data.array([1, 2, 3]).map(x => x*x); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param transform A function mapping a dataset element to a transformed - * dataset element. - * - * @returns A `Dataset` of transformed elements. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - map(transform) { - const base = this; - return datasetFromIteratorFn(async () => { - return (await base.iterator()).map(x => tf.tidy(() => transform(x))); - }, this.size); - } - /** - * Maps this dataset through an async 1-to-1 transform. - * - * ```js - * const a = - * tf.data.array([1, 2, 3]).mapAsync(x => new Promise(function(resolve){ - * setTimeout(() => { - * resolve(x * x); - * }, Math.random()*1000 + 500); - * })); - * console.log(await a.toArray()); - * ``` - * - * @param transform A function mapping a dataset element to a `Promise` for a - * transformed dataset element. This transform is responsible for disposing - * any intermediate `Tensor`s, i.e. by wrapping its computation in - * `tf.tidy()`; that cannot be automated here (as it is in the synchronous - * `map()` case). - * - * @returns A `Dataset` of transformed elements. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - mapAsync(transform) { - const base = this; - return datasetFromIteratorFn(async () => { - return (await base.iterator()).mapAsync(transform); - }, this.size); - } - /** - * Creates a `Dataset` that prefetches elements from this dataset. - * - * @param bufferSize: An integer specifying the number of elements to be - * prefetched. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - prefetch(bufferSize) { - if (bufferSize == null) { - throw new RangeError('`Dataset.prefetch()` requires bufferSize to be specified.'); - } - const base = this; - return datasetFromIteratorFn(async () => (await base.iterator()).prefetch(bufferSize), this.size); - } - /** - * Repeats this dataset `count` times. - * - * NOTE: If this dataset is a function of global state (e.g. a random number - * generator), then different repetitions may produce different elements. - * - * ```js - * const a = tf.data.array([1, 2, 3]).repeat(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param count: (Optional) An integer, representing the number of times - * the dataset should be repeated. The default behavior (if `count` is - * `undefined` or negative) is for the dataset be repeated indefinitely. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - repeat(count) { - const base = this; - let size; - if (this.size != null && count > 0) { - // If this dataset has size and count is positive, new size is current - // size multiply count. This also covers the case that current size is - // infinity. - size = this.size * count; - } - else if (count === 0) { - // If count is 0, new size is 0. - size = 0; - } - else if (this.size != null && (count === undefined || count < 0)) { - // If this dataset has size and count is undefined or negative, the - // dataset will be repeated indefinitely and new size is infinity. - size = Infinity; - } - else { - // If the size of this dataset is null, the new dataset's size is null. - size = null; - } - return datasetFromIteratorFn(async () => { - const iteratorIterator = iteratorFromFunction(async () => ({ value: await base.iterator(), done: false })); - return iteratorFromConcatenated(iteratorIterator.take(count)); - }, size); - } - /** - * Creates a `Dataset` that skips `count` initial elements from this dataset. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]).skip(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param count: The number of elements of this dataset that should be skipped - * to form the new dataset. If `count` is greater than the size of this - * dataset, the new dataset will contain no elements. If `count` - * is `undefined` or negative, skips the entire dataset. - * - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - skip(count) { - const base = this; - let size; - if (this.size != null && count >= 0 && this.size >= count) { - // If the size of this dataset is greater than count, the new dataset's - // size is current size minus skipped size.This also covers the case that - // current size is infinity. - size = this.size - count; - } - else if (this.size != null && - (this.size < count || count === undefined || count < 0)) { - // If the size of this dataset is smaller than count, or count is - // undefined or negative, skips the entire dataset and the new size is 0. - size = 0; - } - else { - // If the size of this dataset is null, the new dataset's size is null. - size = null; - } - return datasetFromIteratorFn(async () => (await base.iterator()).skip(count), size); - } - /** - * Pseudorandomly shuffles the elements of this dataset. This is done in a - * streaming manner, by sampling from a given number of prefetched elements. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]).shuffle(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param bufferSize: An integer specifying the number of elements from this - * dataset from which the new dataset will sample. - * @param seed: (Optional) An integer specifying the random seed that will - * be used to create the distribution. - * @param reshuffleEachIteration: (Optional) A boolean, which if true - * indicates that the dataset should be pseudorandomly reshuffled each time - * it is iterated over. If false, elements will be returned in the same - * shuffled order on each iteration. (Defaults to `true`.) - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - shuffle(bufferSize, seed, reshuffleEachIteration = true) { - if (bufferSize == null || bufferSize < 0) { - if (this.size == null) { - throw new RangeError('`Dataset.shuffle()` requires bufferSize to be specified.'); - } - else { - throw new RangeError('`Dataset.shuffle()` requires bufferSize to be specified. ' + - 'If your data fits in main memory (for regular JS objects), ' + - 'and/or GPU memory (for `tf.Tensor`s), consider setting ' + - `bufferSize to the dataset size (${this.size} elements)`); - } - } - const base = this; - const random = seedrandom.alea(seed || tf.util.now().toString()); - return datasetFromIteratorFn(async () => { - let seed2 = random.int32(); - if (reshuffleEachIteration) { - seed2 += random.int32(); - } - return (await base.iterator()).shuffle(bufferSize, seed2.toString()); - }, this.size); - } - /** - * Creates a `Dataset` with at most `count` initial elements from this - * dataset. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]).take(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param count: The number of elements of this dataset that should be taken - * to form the new dataset. If `count` is `undefined` or negative, or if - * `count` is greater than the size of this dataset, the new dataset will - * contain all elements of this dataset. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - take(count) { - const base = this; - let size; - if (this.size != null && this.size > count) { - // If the size of this dataset is greater than count, the new dataset's - // size is count. - size = count; - } - else if (this.size != null && this.size <= count) { - // If the size of this dataset is equal or smaller than count, the new - // dataset's size is the size of this dataset. - size = this.size; - } - else { - // If the size of this dataset is null, the new dataset's size is null. - size = null; - } - return datasetFromIteratorFn(async () => (await base.iterator()).take(count), size); - } - /** - * Collect all elements of this dataset into an array. - * - * Obviously this will succeed only for small datasets that fit in memory. - * Useful for testing and generally should be avoided if possible. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]); - * console.log(await a.toArray()); - * ``` - * - * @returns A Promise for an array of elements, which will resolve - * when a new stream has been obtained and fully consumed. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - async toArray() { - if (this.size === Infinity) { - throw new Error('Can not convert infinite data stream to array.'); - } - return (await this.iterator()).toArray(); - } - /** - * 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. - */ - async toArrayForTest() { - if (this.size === Infinity) { - throw new Error('Can not convert infinite data stream to array.'); - } - return (await this.iterator()).toArrayForTest(); - } -} -// TODO(soergel): deep sharded shuffle, where supported -Dataset.MAX_BUFFER_SIZE = 10000; -/** - * Create a `Dataset` defined by a provided iterator() function. - * - * ```js - * let i = -1; - * const func = () => - * ++i < 5 ? {value: i, done: false} : {value: null, done: true}; - * const iter = tf.data.iteratorFromFunction(func); - * const ds = tf.data.datasetFromIteratorFn(iter); - * await ds.forEachAsync(e => console.log(e)); - * ``` - */ -export function datasetFromIteratorFn(iteratorFn, size = null) { - return new class extends Dataset { - constructor() { - super(...arguments); - this.size = size; - } - /* - * Provide a new stream of elements. Note this will also start new streams - * from any underlying `Dataset`s. - */ - async iterator() { - return iteratorFn(); - } - }(); -} -/** - * Create a `Dataset` from an array of elements. - * - * Create a Dataset from an array of objects: - * ```js - * const a = tf.data.array([{'item': 1}, {'item': 2}, {'item': 3}]); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * Create a Dataset from an array of numbers: - * ```js - * const a = tf.data.array([4, 5, 6]); - * await a.forEachAsync(e => console.log(e)); - * ``` - * @param items An array of elements that will be parsed as items in a dataset. - * - * @doc {heading: 'Data', subheading: 'Creation', namespace: 'data'} - */ -export function array(items) { - return datasetFromIteratorFn(async () => iteratorFromItems(items), items.length); -} -/** - * Create a `Dataset` by zipping together an array, dict, or nested - * structure of `Dataset`s (and perhaps additional constants). - * The underlying datasets must provide elements in a consistent order such that - * they correspond. - * - * The number of elements in the resulting dataset is the same as the size of - * the smallest dataset in datasets. - * - * The nested structure of the `datasets` argument determines the - * structure of elements in the resulting iterator. - * - * Note this means that, given an array of two datasets that produce dict - * elements, the result is a dataset that produces elements that are arrays - * of two dicts: - * - * Zip an array of datasets: - * ```js - * console.log('Zip two datasets of objects:'); - * const ds1 = tf.data.array([{a: 1}, {a: 2}, {a: 3}]); - * const ds2 = tf.data.array([{b: 4}, {b: 5}, {b: 6}]); - * const ds3 = tf.data.zip([ds1, ds2]); - * await ds3.forEachAsync(e => console.log(JSON.stringify(e))); - * - * // If the goal is to merge the dicts in order to produce elements like - * // {a: ..., b: ...}, this requires a second step such as: - * console.log('Merge the objects:'); - * const ds4 = ds3.map(x => {return {a: x[0].a, b: x[1].b}}); - * await ds4.forEachAsync(e => console.log(e)); - * ``` - * - * Zip a dict of datasets: - * ```js - * const a = tf.data.array([{a: 1}, {a: 2}, {a: 3}]); - * const b = tf.data.array([{b: 4}, {b: 5}, {b: 6}]); - * const c = tf.data.zip({c: a, d: b}); - * await c.forEachAsync(e => console.log(JSON.stringify(e))); - * ``` - * - * @doc {heading: 'Data', subheading: 'Operations', namespace: 'data'} - */ -export function zip(datasets) { - // manually type-check the argument for JS users - if (!isIterable(datasets)) { - throw new Error('The argument to zip() must be an object or array.'); - } - let size; - if (Array.isArray(datasets)) { - for (let i = 0; i < datasets.length; i++) { - size = size == null ? datasets[i].size : - Math.min(size, datasets[i].size); - } - } - else if (datasets instanceof Object) { - for (const ds in datasets) { - size = size == null ? datasets[ds].size : - Math.min(size, datasets[ds].size); - } - } - return datasetFromIteratorFn(async () => { - const streams = await deepMapAndAwaitAll(datasets, d => { - if (d instanceof Dataset) { - return { value: d.iterator(), recurse: false }; - } - else if (isIterable(d)) { - return { value: null, recurse: true }; - } - else { - throw new Error('Leaves of the structure passed to zip() must be Datasets, ' + - 'not primitives.'); - } - }); - return iteratorFromZipped(streams, ZipMismatchMode.SHORTEST); - }, size); -} -/** - * A zip function for use with deepZip, passed via the columnMajorBatch call. - * - * Accepts an array of identically-structured nested elements and either batches - * them (if they are primitives, numeric arrays, or Tensors) or requests - * recursion (if not). - */ -// tslint:disable-next-line:no-any -function deepBatchConcat(rows) { - if (rows === null) { - return null; - } - // use the first item to decide whether to recurse or batch here. - const exampleRow = rows[0]; - if (canTensorify(exampleRow)) { - // rows is an array of primitives, Tensors, or arrays. Batch them. - const value = batchConcat(rows); - return { value, recurse: false }; - } - // the example row is an object, so recurse into it. - return { value: null, recurse: true }; -} -/** - * Assembles a list of same-shaped numbers, number arrays, or Tensors - * into a single new Tensor where axis 0 is the batch dimension. - */ -function batchConcat(arrays) { - if (arrays.length === 0) { - // We can't return an empty Tensor because we don't know the element shape. - throw new Error('Can\'t make a batch of zero elements.'); - } - if (arrays[0] instanceof tf.Tensor) { - // Input is an array of Tensors - return tf.stack(arrays); - } - else { - // Input is a possibly-nested array of numbers. - return tf.tensor(arrays); - } -} -//# sourceMappingURL=dataset.js.map \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/dataset.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/dataset.js.map deleted file mode 100644 index b9aac2fbc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/dataset.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"dataset.js","sourceRoot":"","sources":["../src/dataset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,KAAK,UAAU,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAC,wBAAwB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,kBAAkB,EAAgB,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAE/J,OAAO,EAAC,YAAY,EAAE,kBAAkB,EAAiB,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAO5F,qEAAqE;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,OAAgB,OAAO;IAA7B;QAWW,SAAI,GAAW,IAAI,CAAC;IA2c/B,CAAC;IAzcC,wEAAwE;IACxE,2EAA2E;IAC3E,4EAA4E;IAC5E,2CAA2C;IAC3C,uCAAuC;IAEvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsDG;IACH,KAAK,CAAC,SAAiB,EAAE,cAAc,GAAG,IAA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,CAAC,CAAC;KACxC;AACH,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport {TensorContainer, TensorLike} from '@tensorflow/tfjs-core';\nimport * as seedrandom from 'seedrandom';\n\nimport {iteratorFromConcatenated, iteratorFromFunction, iteratorFromItems, iteratorFromZipped, LazyIterator, ZipMismatchMode} from './iterators/lazy_iterator';\nimport {Container} from './types';\nimport {canTensorify, deepMapAndAwaitAll, DeepMapResult, isIterable} from './util/deep_map';\n\n/**\n * A nested structure of Datasets, used as the input to zip().\n */\nexport type DatasetContainer = Container>;\n\n// TODO(soergel): consider vectorized operations within the pipeline.\n\n/**\n * Represents a potentially large list of independent data elements (typically\n * 'samples' or 'examples').\n *\n * A 'data example' may be a primitive, an array, a map from string keys to\n * values, or any nested structure of these.\n *\n * A `Dataset` represents an ordered collection of elements, together with a\n * chain of transformations to be performed on those elements. Each\n * transformation is a method of `Dataset` that returns another `Dataset`, so\n * these may be chained, e.g.\n * `const processedDataset = rawDataset.filter(...).map(...).batch(...)`.\n *\n * Data loading and transformation is done in a lazy, streaming fashion. The\n * dataset may be iterated over multiple times; each iteration starts the data\n * loading anew and recapitulates the transformations.\n *\n * A `Dataset` is typically processed as a stream of unbatched examples --i.e.,\n * its transformations are applied one example at a time. Batching produces a\n * new `Dataset` where each element is a batch. Batching should usually come\n * last in a pipeline, because data transformations are easier to express on a\n * per-example basis than on a per-batch basis.\n *\n * The following code examples are calling `await dataset.forEachAsync(...)` to\n * iterate once over the entire dataset in order to print out the data.\n *\n * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'}\n */\nexport abstract class Dataset {\n /*\n * Provide a new stream of elements. Note this will also start new streams\n * from any underlying `Dataset`s.\n *\n * CAUTION: Any Tensors contained within the elements returned from\n * this stream *must* be manually disposed to avoid a GPU memory leak.\n * The tf.tidy() approach cannot be used in an asynchronous context.\n */\n abstract async iterator(): Promise>;\n\n readonly size: number = null;\n\n // TODO(soergel): Make Datasets report whether repeated iterator() calls\n // produce the same result (e.g., reading from a file) or different results\n // (e.g., from the webcam). Currently we don't make this distinction but it\n // could be important for the user to know.\n // abstract isDeterministic(): boolean;\n\n /**\n * Groups elements into batches.\n *\n * It is assumed that each of the incoming dataset elements has the same\n * structure-- i.e. the same set of keys at each location in an object\n * hierarchy. For each key, the resulting `Dataset` provides a batched\n * element collecting all of the incoming values for that key.\n *\n * * Incoming primitives are grouped into a 1-D Tensor.\n * * Incoming Tensors are grouped into a new Tensor where the 0'th axis is\n * the batch dimension.\n * * Incoming arrays are converted to Tensor and then batched.\n * * A nested array is interpreted as an n-D Tensor, so the batched result\n * has n+1 dimensions.\n * * An array that cannot be converted to Tensor produces an error.\n *\n * If an array should not be batched as a unit, it should first be converted\n * to an object with integer keys.\n *\n * Here are a few examples:\n *\n * Batch a dataset of numbers:\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8]).batch(4);\n * await a.forEachAsync(e => e.print());\n * ```\n *\n * Batch a dataset of arrays:\n * ```js\n * const b = tf.data.array([[1], [2], [3], [4], [5], [6], [7], [8]]).batch(4);\n * await b.forEachAsync(e => e.print());\n * ```\n *\n * Batch a dataset of objects:\n * ```js\n * const c = tf.data.array([{a: 1, b: 11}, {a: 2, b: 12}, {a: 3, b: 13},\n * {a: 4, b: 14}, {a: 5, b: 15}, {a: 6, b: 16}, {a: 7, b: 17},\n * {a: 8, b: 18}]).batch(4);\n * await c.forEachAsync(e => {\n * console.log('{');\n * for(var key in e) {\n * console.log(key+':');\n * e[key].print();\n * }\n * console.log('}');\n * })\n * ```\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @returns A `Dataset`, from which a stream of batches can be obtained.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n batch(batchSize: number, smallLastBatch = true): Dataset {\n const base = this;\n tf.util.assert(\n batchSize > 0, () => `batchSize needs to be positive, but it is\n ${batchSize}`);\n let size;\n if (this.size === Infinity || this.size == null) {\n // If the size of this dataset is infinity or null, the new size keeps the\n // same.\n size = this.size;\n } else if (smallLastBatch) {\n // If the size of this dataset is known and include small last batch, the\n // new size is full batch count plus last batch.\n size = Math.ceil(this.size / batchSize);\n } else {\n // If the size of this dataset is known and not include small last batch,\n // the new size is full batch count.\n size = Math.floor(this.size / batchSize);\n }\n return datasetFromIteratorFn(async () => {\n return (await base.iterator())\n .columnMajorBatch(batchSize, smallLastBatch, deepBatchConcat);\n }, size);\n }\n\n /**\n * Concatenates this `Dataset` with another.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]);\n * const b = tf.data.array([4, 5, 6]);\n * const c = a.concatenate(b);\n * await c.forEachAsync(e => console.log(e));\n * ```\n *\n * @param dataset A `Dataset` to be concatenated onto this one.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n concatenate(dataset: Dataset): Dataset {\n const base = this;\n let size;\n if (this.size === Infinity || dataset.size === Infinity) {\n // If the size of any of these two dataset is infinity, new size is\n // infinity.\n size = Infinity;\n } else if (this.size != null && dataset.size != null) {\n // If the size of both datasets are known and not infinity, new size is\n // sum the size of these two datasets.\n size = this.size + dataset.size;\n } else {\n // If neither of these two datasets has infinite size and any of these two\n // datasets' size is null, the new size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () =>\n (await base.iterator()).concatenate(await dataset.iterator()),\n size);\n }\n\n /**\n * Filters this dataset according to `predicate`.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])\n * .filter(x => x%2 === 0);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param predicate A function mapping a dataset element to a boolean or a\n * `Promise` for one.\n *\n * @returns A `Dataset` of elements for which the predicate was true.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n filter(predicate: (value: T) => boolean): Dataset {\n const base = this;\n let size;\n if (this.size === Infinity) {\n // If the size of this dataset is infinity, new size is infinity\n size = Infinity;\n } else {\n // If this dataset has limited elements, new size is null because it might\n // exhausted randomly.\n size = null;\n }\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).filter(x => tf.tidy(() => predicate(x)));\n }, size);\n }\n\n /**\n * Apply a function to every element of the dataset.\n *\n * After the function is applied to a dataset element, any Tensors contained\n * within that element are disposed.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param f A function to apply to each dataset element.\n * @returns A `Promise` that resolves after all elements have been processed.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async forEachAsync(f: (input: T) => void): Promise {\n return (await this.iterator()).forEachAsync(f);\n }\n\n /**\n * Maps this dataset through a 1-to-1 transform.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]).map(x => x*x);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param transform A function mapping a dataset element to a transformed\n * dataset element.\n *\n * @returns A `Dataset` of transformed elements.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n map(transform: (value: T) => O): Dataset {\n const base = this;\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).map(x => tf.tidy(() => transform(x)));\n }, this.size);\n }\n\n /**\n * Maps this dataset through an async 1-to-1 transform.\n *\n * ```js\n * const a =\n * tf.data.array([1, 2, 3]).mapAsync(x => new Promise(function(resolve){\n * setTimeout(() => {\n * resolve(x * x);\n * }, Math.random()*1000 + 500);\n * }));\n * console.log(await a.toArray());\n * ```\n *\n * @param transform A function mapping a dataset element to a `Promise` for a\n * transformed dataset element. This transform is responsible for disposing\n * any intermediate `Tensor`s, i.e. by wrapping its computation in\n * `tf.tidy()`; that cannot be automated here (as it is in the synchronous\n * `map()` case).\n *\n * @returns A `Dataset` of transformed elements.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n mapAsync(transform: (value: T) => Promise):\n Dataset {\n const base = this;\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).mapAsync(transform);\n }, this.size);\n }\n\n /**\n * Creates a `Dataset` that prefetches elements from this dataset.\n *\n * @param bufferSize: An integer specifying the number of elements to be\n * prefetched.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n prefetch(bufferSize: number): Dataset {\n if (bufferSize == null) {\n throw new RangeError(\n '`Dataset.prefetch()` requires bufferSize to be specified.');\n }\n\n const base = this;\n return datasetFromIteratorFn(\n async () => (await base.iterator()).prefetch(bufferSize), this.size);\n }\n\n /**\n * Repeats this dataset `count` times.\n *\n * NOTE: If this dataset is a function of global state (e.g. a random number\n * generator), then different repetitions may produce different elements.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]).repeat(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: (Optional) An integer, representing the number of times\n * the dataset should be repeated. The default behavior (if `count` is\n * `undefined` or negative) is for the dataset be repeated indefinitely.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n repeat(count?: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && count > 0) {\n // If this dataset has size and count is positive, new size is current\n // size multiply count. This also covers the case that current size is\n // infinity.\n size = this.size * count;\n } else if (count === 0) {\n // If count is 0, new size is 0.\n size = 0;\n } else if (this.size != null && (count === undefined || count < 0)) {\n // If this dataset has size and count is undefined or negative, the\n // dataset will be repeated indefinitely and new size is infinity.\n size = Infinity;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(async () => {\n const iteratorIterator = iteratorFromFunction(\n async () => ({value: await base.iterator(), done: false}));\n return iteratorFromConcatenated(iteratorIterator.take(count));\n }, size);\n }\n\n /**\n * Creates a `Dataset` that skips `count` initial elements from this dataset.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).skip(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: The number of elements of this dataset that should be skipped\n * to form the new dataset. If `count` is greater than the size of this\n * dataset, the new dataset will contain no elements. If `count`\n * is `undefined` or negative, skips the entire dataset.\n *\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n skip(count: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && count >= 0 && this.size >= count) {\n // If the size of this dataset is greater than count, the new dataset's\n // size is current size minus skipped size.This also covers the case that\n // current size is infinity.\n size = this.size - count;\n } else if (\n this.size != null &&\n (this.size < count || count === undefined || count < 0)) {\n // If the size of this dataset is smaller than count, or count is\n // undefined or negative, skips the entire dataset and the new size is 0.\n size = 0;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () => (await base.iterator()).skip(count), size);\n }\n\n // TODO(soergel): deep sharded shuffle, where supported\n\n static readonly MAX_BUFFER_SIZE = 10000;\n\n /**\n * Pseudorandomly shuffles the elements of this dataset. This is done in a\n * streaming manner, by sampling from a given number of prefetched elements.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).shuffle(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param bufferSize: An integer specifying the number of elements from this\n * dataset from which the new dataset will sample.\n * @param seed: (Optional) An integer specifying the random seed that will\n * be used to create the distribution.\n * @param reshuffleEachIteration: (Optional) A boolean, which if true\n * indicates that the dataset should be pseudorandomly reshuffled each time\n * it is iterated over. If false, elements will be returned in the same\n * shuffled order on each iteration. (Defaults to `true`.)\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n shuffle(bufferSize: number, seed?: string, reshuffleEachIteration = true):\n Dataset {\n if (bufferSize == null || bufferSize < 0) {\n if (this.size == null) {\n throw new RangeError(\n '`Dataset.shuffle()` requires bufferSize to be specified.');\n } else {\n throw new RangeError(\n '`Dataset.shuffle()` requires bufferSize to be specified. ' +\n 'If your data fits in main memory (for regular JS objects), ' +\n 'and/or GPU memory (for `tf.Tensor`s), consider setting ' +\n `bufferSize to the dataset size (${this.size} elements)`);\n }\n }\n const base = this;\n const random = seedrandom.alea(seed || tf.util.now().toString());\n return datasetFromIteratorFn(async () => {\n let seed2 = random.int32();\n if (reshuffleEachIteration) {\n seed2 += random.int32();\n }\n return (await base.iterator()).shuffle(bufferSize, seed2.toString());\n }, this.size);\n }\n\n /**\n * Creates a `Dataset` with at most `count` initial elements from this\n * dataset.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).take(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: The number of elements of this dataset that should be taken\n * to form the new dataset. If `count` is `undefined` or negative, or if\n * `count` is greater than the size of this dataset, the new dataset will\n * contain all elements of this dataset.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n take(count: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && this.size > count) {\n // If the size of this dataset is greater than count, the new dataset's\n // size is count.\n size = count;\n } else if (this.size != null && this.size <= count) {\n // If the size of this dataset is equal or smaller than count, the new\n // dataset's size is the size of this dataset.\n size = this.size;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () => (await base.iterator()).take(count), size);\n }\n\n /**\n * Collect all elements of this dataset into an array.\n *\n * Obviously this will succeed only for small datasets that fit in memory.\n * Useful for testing and generally should be avoided if possible.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]);\n * console.log(await a.toArray());\n * ```\n *\n * @returns A Promise for an array of elements, which will resolve\n * when a new stream has been obtained and fully consumed.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async toArray() {\n if (this.size === Infinity) {\n throw new Error('Can not convert infinite data stream to array.');\n }\n return (await this.iterator()).toArray();\n }\n\n /**\n * Collect all elements of this dataset into an array with prefetching 100\n * elements. This is useful for testing, because the prefetch changes the\n * order in which the Promises are resolved along the processing pipeline.\n * This may help expose bugs where results are dependent on the order of\n * Promise resolution rather than on the logical order of the stream (i.e.,\n * due to hidden mutable state).\n *\n * @returns A Promise for an array of elements, which will resolve\n * when a new stream has been obtained and fully consumed.\n */\n async toArrayForTest() {\n if (this.size === Infinity) {\n throw new Error('Can not convert infinite data stream to array.');\n }\n return (await this.iterator()).toArrayForTest();\n }\n}\n\n/**\n * Create a `Dataset` defined by a provided iterator() function.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const iter = tf.data.iteratorFromFunction(func);\n * const ds = tf.data.datasetFromIteratorFn(iter);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n */\nexport function datasetFromIteratorFn(\n iteratorFn: () => Promise>,\n size: number = null): Dataset {\n return new class extends Dataset {\n size = size;\n\n /*\n * Provide a new stream of elements. Note this will also start new streams\n * from any underlying `Dataset`s.\n */\n async iterator(): Promise> {\n return iteratorFn();\n }\n }\n ();\n}\n\n/**\n * Create a `Dataset` from an array of elements.\n *\n * Create a Dataset from an array of objects:\n * ```js\n * const a = tf.data.array([{'item': 1}, {'item': 2}, {'item': 3}]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * Create a Dataset from an array of numbers:\n * ```js\n * const a = tf.data.array([4, 5, 6]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n * @param items An array of elements that will be parsed as items in a dataset.\n *\n * @doc {heading: 'Data', subheading: 'Creation', namespace: 'data'}\n */\nexport function array(items: T[]): Dataset {\n return datasetFromIteratorFn(\n async () => iteratorFromItems(items), items.length);\n}\n\n/**\n * Create a `Dataset` by zipping together an array, dict, or nested\n * structure of `Dataset`s (and perhaps additional constants).\n * The underlying datasets must provide elements in a consistent order such that\n * they correspond.\n *\n * The number of elements in the resulting dataset is the same as the size of\n * the smallest dataset in datasets.\n *\n * The nested structure of the `datasets` argument determines the\n * structure of elements in the resulting iterator.\n *\n * Note this means that, given an array of two datasets that produce dict\n * elements, the result is a dataset that produces elements that are arrays\n * of two dicts:\n *\n * Zip an array of datasets:\n * ```js\n * console.log('Zip two datasets of objects:');\n * const ds1 = tf.data.array([{a: 1}, {a: 2}, {a: 3}]);\n * const ds2 = tf.data.array([{b: 4}, {b: 5}, {b: 6}]);\n * const ds3 = tf.data.zip([ds1, ds2]);\n * await ds3.forEachAsync(e => console.log(JSON.stringify(e)));\n *\n * // If the goal is to merge the dicts in order to produce elements like\n * // {a: ..., b: ...}, this requires a second step such as:\n * console.log('Merge the objects:');\n * const ds4 = ds3.map(x => {return {a: x[0].a, b: x[1].b}});\n * await ds4.forEachAsync(e => console.log(e));\n * ```\n *\n * Zip a dict of datasets:\n * ```js\n * const a = tf.data.array([{a: 1}, {a: 2}, {a: 3}]);\n * const b = tf.data.array([{b: 4}, {b: 5}, {b: 6}]);\n * const c = tf.data.zip({c: a, d: b});\n * await c.forEachAsync(e => console.log(JSON.stringify(e)));\n * ```\n *\n * @doc {heading: 'Data', subheading: 'Operations', namespace: 'data'}\n */\nexport function zip(datasets: DatasetContainer):\n Dataset {\n // manually type-check the argument for JS users\n if (!isIterable(datasets)) {\n throw new Error('The argument to zip() must be an object or array.');\n }\n let size;\n if (Array.isArray(datasets)) {\n for (let i = 0; i < datasets.length; i++) {\n size = size == null ? (datasets[i] as Dataset).size :\n Math.min(size, (datasets[i] as Dataset).size);\n }\n } else if (datasets instanceof Object) {\n for (const ds in datasets) {\n size = size == null ? (datasets[ds] as Dataset).size :\n Math.min(size, (datasets[ds] as Dataset).size);\n }\n }\n return datasetFromIteratorFn(async () => {\n const streams = await deepMapAndAwaitAll(datasets, d => {\n if (d instanceof Dataset) {\n return {value: d.iterator(), recurse: false};\n } else if (isIterable(d)) {\n return {value: null, recurse: true};\n } else {\n throw new Error(\n 'Leaves of the structure passed to zip() must be Datasets, ' +\n 'not primitives.');\n }\n });\n return iteratorFromZipped(streams, ZipMismatchMode.SHORTEST);\n }, size);\n}\n\n/**\n * A zip function for use with deepZip, passed via the columnMajorBatch call.\n *\n * Accepts an array of identically-structured nested elements and either batches\n * them (if they are primitives, numeric arrays, or Tensors) or requests\n * recursion (if not).\n */\n// tslint:disable-next-line:no-any\nfunction deepBatchConcat(rows: any[]): DeepMapResult {\n if (rows === null) {\n return null;\n }\n\n // use the first item to decide whether to recurse or batch here.\n const exampleRow = rows[0];\n\n if (canTensorify(exampleRow)) {\n // rows is an array of primitives, Tensors, or arrays. Batch them.\n const value = batchConcat(rows);\n return {value, recurse: false};\n }\n\n // the example row is an object, so recurse into it.\n return {value: null, recurse: true};\n}\n\n/**\n * Assembles a list of same-shaped numbers, number arrays, or Tensors\n * into a single new Tensor where axis 0 is the batch dimension.\n */\nfunction batchConcat(arrays: T[]):\n tf.Tensor {\n if (arrays.length === 0) {\n // We can't return an empty Tensor because we don't know the element shape.\n throw new Error('Can\\'t make a batch of zero elements.');\n }\n\n if (arrays[0] instanceof tf.Tensor) {\n // Input is an array of Tensors\n return tf.stack(arrays as tf.Tensor[]);\n } else {\n // Input is a possibly-nested array of numbers.\n return tf.tensor(arrays as TensorLike);\n }\n}\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/dataset_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/dataset_test.js.map deleted file mode 100644 index e73d436cf..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/dataset_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3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AC,EAAE;YACV,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CACrB,4CAA4C;gBAC5C,oBAAoB,CAAC,CAAC;YAC1B,IAAI,EAAE,CAAC;SACR;QACD,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;AACR,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport {TensorContainerObject} from '@tensorflow/tfjs-core';\nimport {array, DatasetContainer} from './dataset';\nimport * as tfd from './index';\nimport {iteratorFromItems, LazyIterator} from './iterators/lazy_iterator';\nimport {describeAllEnvs} from './util/test_utils';\n\nclass TestObjectIterator extends LazyIterator<{}> {\n data = Array.from({length: 100}, (v, k) => k);\n currentIndex = 0;\n\n summary() {\n return `TestObjects`;\n }\n\n async next(): Promise> {\n if (this.currentIndex >= 100) {\n return {value: null, done: true};\n }\n const elementNumber = this.data[this.currentIndex];\n const result = {\n 'number': elementNumber,\n 'numberArray': [elementNumber, elementNumber ** 2, elementNumber ** 3],\n 'Tensor':\n tf.tensor1d([elementNumber, elementNumber ** 2, elementNumber ** 3]),\n 'Tensor2': tf.tensor2d(\n [\n elementNumber, elementNumber ** 2, elementNumber ** 3,\n elementNumber ** 4\n ],\n [2, 2]),\n 'string': `Item ${elementNumber}`\n };\n this.currentIndex++;\n return {value: result, done: false};\n }\n}\n\nexport class TestDataset extends tfd.Dataset {\n readonly size: number;\n constructor(setSize = false) {\n super();\n if (setSize) {\n this.size = 200;\n }\n }\n async iterator(): Promise> {\n return new TestObjectIterator();\n }\n}\n\n// tslint:disable-next-line:no-any\nfunction complexifyExampleAsDict(simple: any): {} {\n const v = simple['number'];\n const w = simple['numberArray'];\n const x = simple['Tensor'];\n const y = simple['Tensor2'];\n const z = simple['string'];\n return {\n a: {v, w, q: {aa: {x, y, z}, ab: {v, w, x}}},\n b: {\n ba: {baa: y, bab: z, bac: v},\n bb: {bba: w, bbb: x, bbc: y},\n bc: {bca: z, bcb: v, bcc: w}\n },\n c: {ca: {x, y, z}, cb: {v, w, x}, cc: {y, z, v}},\n };\n}\n\ndescribeAllEnvs('Dataset', () => {\n it('can be concatenated', async () => {\n const a = tfd.array([{'item': 1}, {'item': 2}, {'item': 3}]);\n const b = tfd.array([{'item': 4}, {'item': 5}, {'item': 6}]);\n const result = await a.concatenate(b).toArrayForTest();\n expect(result).toEqual([\n {'item': 1}, {'item': 2}, {'item': 3}, {'item': 4}, {'item': 5},\n {'item': 6}\n ]);\n });\n\n it('can be created by concatenating multiple underlying datasets via ' +\n 'reduce',\n async () => {\n const a = tfd.array([{'item': 1}, {'item': 2}]);\n const b = tfd.array([{'item': 3}, {'item': 4}]);\n const c = tfd.array([{'item': 5}, {'item': 6}]);\n const concatenated = [a, b, c].reduce((a, b) => a.concatenate(b));\n const result = await concatenated.toArrayForTest();\n expect(result).toEqual([\n {'item': 1}, {'item': 2}, {'item': 3}, {'item': 4}, {'item': 5},\n {'item': 6}\n ]);\n });\n\n it('can be created by zipping an array of datasets with primitive ' +\n 'elements',\n async () => {\n const a = tfd.array([1, 2, 3]);\n const b = tfd.array([4, 5, 6]);\n const result = await tfd.zip([a, b]).toArrayForTest();\n expect(result).toEqual([[1, 4], [2, 5], [3, 6]]);\n });\n\n it('can be created by zipping an array of datasets with object elements',\n async () => {\n const a = tfd.array([{a: 1}, {a: 2}, {a: 3}]);\n const b = tfd.array([{b: 4}, {b: 5}, {b: 6}]);\n const result = await tfd.zip([a, b]).toArrayForTest();\n expect(result).toEqual(\n [[{a: 1}, {b: 4}], [{a: 2}, {b: 5}], [{a: 3}, {b: 6}]]);\n });\n\n it('can be created by zipping a dict of datasets', async () => {\n const a = tfd.array([{a: 1}, {a: 2}, {a: 3}]);\n const b = tfd.array([{b: 4}, {b: 5}, {b: 6}]);\n const result = await tfd.zip({c: a, d: b}).toArrayForTest();\n expect(result).toEqual([\n {c: {a: 1}, d: {b: 4}}, {c: {a: 2}, d: {b: 5}}, {c: {a: 3}, d: {b: 6}}\n ]);\n });\n\n it('can be created by zipping a nested structure of datasets', async () => {\n const a = tfd.array([1, 2, 3]);\n const b = tfd.array([4, 5, 6]);\n const c = tfd.array([7, 8, 9]);\n const d = tfd.array([10, 11, 12]);\n const result = await tfd.zip({a, bcd: [b, {c, d}]}).toArrayForTest();\n\n expect(result).toEqual([\n {a: 1, bcd: [4, {c: 7, d: 10}]},\n {a: 2, bcd: [5, {c: 8, d: 11}]},\n {a: 3, bcd: [6, {c: 9, d: 12}]},\n ]);\n });\n\n it('can be created by zipping datasets of different sizes', async () => {\n const a = tfd.array([1, 2]);\n const b = tfd.array([3, 4, 5, 6]);\n const result = await tfd.zip([a, b]).toArrayForTest();\n expect(result).toEqual([[1, 3], [2, 4]]);\n });\n\n it('zipping a native string throws an error', async done => {\n try {\n // tslint:disable-next-line:no-any no-construct\n await tfd.zip('test' as any);\n done.fail();\n } catch (e) {\n expect(e.message).toEqual(\n 'The argument to zip() must be an object or array.');\n done();\n }\n });\n\n it('zipping a string object throws a meaningful error', async done => {\n try {\n // tslint:disable-next-line:no-any no-construct\n await tfd.zip(new String('test') as any).iterator();\n done.fail();\n } catch (e) {\n // This error is not specific to the error case arising from\n // typeof(new String('test')) === 'object'\n // Instead this error is thrown because the leaves of the structure\n // are the letters t, e, s, and t, as well a number for the length. I\n // think it's a fine error message for this situation anyway.\n expect(e.message).toEqual(\n 'Leaves of the structure passed to zip() must be Datasets, ' +\n 'not primitives.');\n done();\n }\n });\n\n it('zipping a structure with repeated elements works', async () => {\n const a = tfd.array([1, 2, 3]);\n const b = tfd.array([4, 5, 6]);\n const c = tfd.array([7, 8, 9]);\n const d = tfd.array([10, 11, 12]);\n const result =\n await tfd.zip({a, abacd: [a, b, {a, c, d}]}).toArrayForTest();\n\n expect(result).toEqual([\n {a: 1, abacd: [1, 4, {a: 1, c: 7, d: 10}]},\n {a: 2, abacd: [2, 5, {a: 2, c: 8, d: 11}]},\n {a: 3, abacd: [3, 6, {a: 3, c: 9, d: 12}]},\n ]);\n });\n\n it('zipping a structure with cycles throws an error', async done => {\n try {\n // tslint:disable-next-line:no-any\n const a = tfd.array([1, 2, 3]);\n const b = tfd.array([4, 5, 6]);\n const c: DatasetContainer = [tfd.array([7, 8, 9])];\n const abc: DatasetContainer = [a, b, c];\n c.push(abc);\n await tfd.zip({a, abc}).iterator();\n done.fail();\n } catch (e) {\n expect(e.message).toEqual('Circular references are not supported.');\n done();\n }\n });\n\n it('zip propagates errors thrown when iterating constituent datasets',\n async done => {\n try {\n const makeIterator = () => {\n let count = 0;\n return {\n next: () => {\n if (count > 2) {\n throw new Error('propagate me!');\n }\n return {value: count++, done: false};\n }\n };\n };\n const a = tfd.generator(makeIterator);\n const b = tfd.array([3, 4, 5, 6]);\n // Using toArray() rather than toArrayForTest(). The prefetch in\n // the latter, in combination with expecting an exception, causes\n // unrelated tests to fail (See\n // https://github.com/tensorflow/tfjs/issues/1330.\n await (await tfd.zip([a, b]).iterator()).toArray();\n done.fail();\n } catch (e) {\n expect(e.message).toMatch(/propagate me!/);\n done();\n }\n });\n\n it('can be repeated a fixed number of times', async () => {\n const a = tfd.array([{'item': 1}, {'item': 2}, {'item': 3}]);\n const result = await a.repeat(4).toArrayForTest();\n expect(result).toEqual([\n {'item': 1},\n {'item': 2},\n {'item': 3},\n {'item': 1},\n {'item': 2},\n {'item': 3},\n {'item': 1},\n {'item': 2},\n {'item': 3},\n {'item': 1},\n {'item': 2},\n {'item': 3},\n ]);\n });\n\n it('can be repeated indefinitely', async () => {\n const a = tfd.array([{'item': 1}, {'item': 2}, {'item': 3}]);\n await a.repeat().take(234).toArrayForTest();\n });\n\n it('can be repeated with state in a closure', async () => {\n // This tests a tricky bug having to do with 'this' being set properly.\n // See\n // https://github.com/Microsoft/TypeScript/wiki/%27this%27-in-TypeScript\n\n class CustomDataset extends tfd.Dataset<{}> {\n state = {val: 1};\n async iterator() {\n const result = iteratorFromItems([\n {'item': this.state.val++}, {'item': this.state.val++},\n {'item': this.state.val++}\n ]);\n return result;\n }\n }\n const a = new CustomDataset();\n await a.repeat().take(1234).toArrayForTest();\n });\n\n it('can collect all items into memory', async () => {\n const ds = new TestDataset();\n const items = await ds.toArrayForTest();\n expect(items.length).toEqual(100);\n // The test dataset has 100 elements, each containing 2 Tensors.\n expect(tf.memory().numTensors).toEqual(200);\n });\n\n it('batches entries into column-oriented batches', async () => {\n const ds = new TestDataset();\n const bds = ds.batch(8);\n const batchIterator = await bds.iterator();\n const result = await batchIterator.toArrayForTest();\n\n expect(result.length).toEqual(13);\n result.slice(0, 12).forEach(batch => {\n const b = batch as TensorContainerObject;\n expect((b['number'] as tf.Tensor).shape).toEqual([8]);\n expect((b['numberArray'] as tf.Tensor).shape).toEqual([8, 3]);\n expect((b['Tensor'] as tf.Tensor).shape).toEqual([8, 3]);\n expect((b['Tensor2'] as tf.Tensor).shape).toEqual([8, 2, 2]);\n expect((b['string'] as tf.Tensor).shape).toEqual([8]);\n });\n tf.dispose(result);\n expect(tf.memory().numTensors).toBe(0);\n });\n\n it('batches entries without leaking Tensors', async () => {\n // The prior test confirms this too, but this formulation is more\n // specific.\n\n // First show that an unbatched test iterator creates 2 Tensors per\n // element.\n const ds = new TestDataset();\n const iter = await ds.iterator();\n const element = await iter.next();\n expect(tf.memory().numTensors).toBe(2);\n tf.dispose(element.value);\n expect(tf.memory().numTensors).toBe(0);\n\n // Now obtain batches, which should contain 4 Tensors each.\n const bDs = new TestDataset().batch(8);\n const bIter = await bDs.iterator();\n const bElement = await bIter.next();\n // The batch element contains four Tensors, and the 8*2 Tensors in the\n // original unbatched elements have already been disposed.\n expect(tf.memory().numTensors).toBe(5);\n tf.dispose(bElement.value);\n expect(tf.memory().numTensors).toBe(0);\n });\n\n it('batches complex nested objects into column-oriented batches',\n async () => {\n // Our \"complexified\" examples map the simple examples into a deep\n // nested structure. This test shows that batching complexified\n // examples produces the same result as complexifying batches of\n // simple examples.\n\n const complexThenBatch =\n new TestDataset().map(complexifyExampleAsDict).batch(8);\n const batchThenComplex =\n new TestDataset().batch(8).map(complexifyExampleAsDict);\n\n const compareDataset = tfd.zip({complexThenBatch, batchThenComplex});\n\n const result = await (await compareDataset.iterator()).toArrayForTest();\n\n expect(result.length).toEqual(13);\n // tslint:disable-next-line:no-any\n result.slice(0, 12).forEach((compare: any) => {\n // TODO(soergel): could use deepMap to implement deep compare.\n // For now, just spot-check a few deep entries.\n expect(compare.complexThenBatch.a.v.shape)\n .toEqual(compare.batchThenComplex.a.v.shape);\n expect(compare.complexThenBatch.a.v.dataSync())\n .toEqual(compare.batchThenComplex.a.v.dataSync());\n\n expect(compare.complexThenBatch.a.q.ab.x.shape)\n .toEqual(compare.batchThenComplex.a.q.ab.x.shape);\n expect(compare.complexThenBatch.a.q.ab.x.dataSync())\n .toEqual(compare.batchThenComplex.a.q.ab.x.dataSync());\n\n expect(compare.complexThenBatch.b.bb.bbb.shape)\n .toEqual(compare.batchThenComplex.b.bb.bbb.shape);\n expect(compare.complexThenBatch.b.bb.bbb.dataSync())\n .toEqual(compare.batchThenComplex.b.bb.bbb.dataSync());\n\n expect(compare.complexThenBatch.c.ca.x.shape)\n .toEqual(compare.batchThenComplex.c.ca.x.shape);\n expect(compare.complexThenBatch.c.ca.x.dataSync())\n .toEqual(compare.batchThenComplex.c.ca.x.dataSync());\n });\n tf.dispose(result);\n expect(tf.memory().numTensors).toBe(0);\n });\n\n it('batches nested numeric arrays into a single Tensor', async () => {\n const dataset =\n new TestDataset()\n .map((e) => {\n const a = e.number as number;\n const b = a * 2;\n const c = b + 5;\n return {\n foo: [[[a, b], [c, a], [b, c]], [[b, c], [a, b], [c, a]]]\n };\n })\n .batch(8);\n\n const result = await (await dataset.iterator()).toArrayForTest();\n expect(result.length).toEqual(13);\n\n // tslint:disable-next-line:no-any\n result.slice(0, 12).forEach((e: any) => {\n expect(e.foo instanceof tf.Tensor).toBeTruthy();\n expect(e.foo.shape).toEqual([8, 2, 3, 2]);\n });\n // tslint:disable-next-line:no-any\n expect((result[12] as any).foo.shape).toEqual([4, 2, 3, 2]);\n\n tf.dispose(result);\n expect(tf.memory().numTensors).toBe(0);\n });\n\n // TODO(soergel, smilkov): Reinstate this once tfjs-core enforces\n // TensorLike.\n /*\n it('throws an error when given an array containing a dict', async done\n => {\n const dataset = array([[1, {a: 2, b: 3}], [4, {a: 5, b: 6}]]).batch(2);\n try {\n await (await dataset.iterator()).collect();\n done.fail();\n } catch (e) {\n expect(e.message).toEqual('TODO');\n done();\n }\n expect(tf.memory().numTensors).toBe(0);\n });\n */\n\n it('batch creates a small last batch', async () => {\n const ds = new TestDataset();\n const bds = ds.batch(8);\n const batchIterator = await bds.iterator();\n const result = await batchIterator.toArrayForTest();\n const lastBatch = result[result.length - 1] as TensorContainerObject;\n expect((lastBatch['number'] as tf.Tensor).shape).toEqual([4]);\n expect((lastBatch['numberArray'] as tf.Tensor).shape).toEqual([4, 3]);\n expect((lastBatch['Tensor'] as tf.Tensor).shape).toEqual([4, 3]);\n expect((lastBatch['Tensor2'] as tf.Tensor).shape).toEqual([4, 2, 2]);\n expect((lastBatch['string'] as tf.Tensor).shape).toEqual([4]);\n\n const expectedNumberLastBatch = tf.tensor1d([96, 97, 98, 99]);\n tf.test_util.expectArraysClose(\n await (lastBatch['number'] as tf.Tensor).array(),\n await expectedNumberLastBatch.array());\n\n const expectedNumberArrayLastBatch = tf.tensor2d(\n [\n [96, 96 ** 2, 96 ** 3], [97, 97 ** 2, 97 ** 3],\n [98, 98 ** 2, 98 ** 3], [99, 99 ** 2, 99 ** 3]\n ],\n [4, 3]);\n tf.test_util.expectArraysClose(\n await (lastBatch['numberArray'] as tf.Tensor).array(),\n await expectedNumberArrayLastBatch.array());\n\n const expectedTensorLastBatch = tf.tensor2d(\n [\n [96, 96 ** 2, 96 ** 3], [97, 97 ** 2, 97 ** 3],\n [98, 98 ** 2, 98 ** 3], [99, 99 ** 2, 99 ** 3]\n ],\n [4, 3]);\n tf.test_util.expectArraysClose(\n await (lastBatch['Tensor'] as tf.Tensor).array(),\n await expectedTensorLastBatch.array());\n\n const expectedTensor2LastBatch = tf.tensor3d(\n [\n [[96, 96 ** 2], [96 ** 3, 96 ** 4]],\n [[97, 97 ** 2], [97 ** 3, 97 ** 4]],\n [[98, 98 ** 2], [98 ** 3, 98 ** 4]],\n [[99, 99 ** 2], [99 ** 3, 99 ** 4]],\n ],\n [4, 2, 2]);\n tf.test_util.expectArraysClose(\n await (lastBatch['Tensor2'] as tf.Tensor).array(),\n await expectedTensor2LastBatch.array());\n\n const expectedStringLastBatch =\n tf.tensor1d(['Item 96', 'Item 97', 'Item 98', 'Item 99']);\n tf.test_util.expectArraysEqual(\n await (lastBatch['string'] as tf.Tensor).array(),\n await expectedStringLastBatch.array());\n\n tf.dispose(result);\n tf.dispose(expectedNumberLastBatch);\n tf.dispose(expectedNumberArrayLastBatch);\n tf.dispose(expectedTensorLastBatch);\n tf.dispose(expectedTensor2LastBatch);\n tf.dispose(expectedStringLastBatch);\n\n expect(tf.memory().numTensors).toBe(0);\n });\n\n it('skip does not leak Tensors', async done => {\n try {\n const ds = new TestDataset();\n expect(tf.memory().numTensors).toEqual(0);\n const result = await ds.skip(15).toArrayForTest();\n // The test dataset had 100 elements; we skipped 15; 85 remain.\n expect(result.length).toEqual(85);\n // Each element of the test dataset contains 2 Tensors;\n // 85 elements remain, so 2 * 85 = 170 Tensors remain.\n expect(tf.memory().numTensors).toEqual(170);\n done();\n } catch (e) {\n done.fail(e);\n }\n });\n\n it('filter does not leak Tensors', async () => {\n const ds = new TestDataset();\n expect(tf.memory().numTensors).toEqual(0);\n await ds.filter(x => ((x['number'] as number) % 2 === 0)).toArrayForTest();\n // Each element of the test dataset contains 2 Tensors.\n // There were 100 elements, but we filtered out half of them.\n // Thus 50 * 2 = 100 Tensors remain.\n expect(tf.memory().numTensors).toEqual(100);\n });\n\n it('shuffle does not leak Tensors', async () => {\n const ds = new TestDataset();\n expect(tf.memory().numTensors).toEqual(0);\n await ds.shuffle(1000).toArrayForTest();\n // The shuffle operation emitted all of the tensors.\n expect(tf.memory().numTensors).toEqual(200);\n });\n\n it('shuffle throws an error when bufferSize is not specified and ' +\n 'dataset.size is unknown.',\n async () => {\n const ds = new TestDataset();\n\n expect(() => ds.shuffle(undefined))\n .toThrowError(\n '`Dataset.shuffle()` requires bufferSize to be specified.');\n });\n\n it('shuffle throws an error when bufferSize is not specified and ' +\n 'dataset.size is known.',\n async () => {\n const ds = new TestDataset(true);\n\n expect(() => ds.shuffle(undefined))\n .toThrowError(\n '`Dataset.shuffle()` requires bufferSize to be ' +\n 'specified. If your data fits in main memory (for ' +\n 'regular JS objects), and/or GPU memory (for ' +\n '`tf.Tensor`s), consider setting bufferSize to the ' +\n 'dataset size (200 elements)');\n });\n\n it('prefetch throws an error when bufferSize is not specified.', async () => {\n const ds = new TestDataset();\n\n expect(() => ds.prefetch(undefined))\n .toThrowError(\n '`Dataset.prefetch()` requires bufferSize to be specified.');\n });\n\n it('prefetch does not leak Tensors', async () => {\n const ds = new TestDataset();\n expect(tf.memory().numTensors).toEqual(0);\n await ds.prefetch(1000).toArray();\n // The prefetch operation emitted all of the tensors.\n expect(tf.memory().numTensors).toEqual(200);\n });\n\n it('map does not leak Tensors when none are returned', async () => {\n const ds = new TestDataset();\n expect(tf.memory().numTensors).toEqual(0);\n await ds.map(x => ({'constant': 1})).toArrayForTest();\n // The map operation consumed all of the tensors and emitted none.\n expect(tf.memory().numTensors).toEqual(0);\n });\n\n it('map does not lose or leak Tensors when some inputs are passed ' +\n 'through',\n async () => {\n const ds = new TestDataset();\n expect(tf.memory().numTensors).toEqual(0);\n await ds.map(x => ({'Tensor2': x['Tensor2']})).toArrayForTest();\n // Each element of the test dataset contains 2 Tensors.\n // Our map operation retained one of the Tensors and discarded the\n // other. Thus the mapped data contains 100 elements with 1 Tensor\n // each.\n expect(tf.memory().numTensors).toEqual(100);\n });\n\n it('map does not leak Tensors when inputs are replaced', async () => {\n const ds = new TestDataset();\n expect(tf.memory().numTensors).toEqual(0);\n await ds.map(x => ({'a': tf.tensor1d([1, 2, 3])})).toArrayForTest();\n // Each element of the test dataset contains 2 Tensors.\n // Our map operation discarded both Tensors and created one new one.\n // Thus the mapped data contains 100 elements with 1 Tensor each.\n expect(tf.memory().numTensors).toEqual(100);\n });\n\n it('forEachAsync does not leak Tensors', async () => {\n const ds = new TestDataset();\n let count = 0;\n await ds.forEachAsync(element => {\n count++;\n return {};\n });\n // forEachAsync traversed the entire dataset of 100 elements.\n expect(count).toEqual(100);\n // forEachAsync consumed all of the input Tensors.\n expect(tf.memory().numTensors).toEqual(0);\n });\n\n it('clone tensors when returning iterator of a dataset generated from ' +\n 'existing tensors',\n async () => {\n expect(tf.memory().numTensors).toEqual(0);\n const a = tf.ones([2, 1]);\n const b = tf.ones([2, 1]);\n expect(tf.memory().numTensors).toEqual(2);\n const ds = tfd.array([a, b]);\n // Pre-existing tensors are not cloned during dataset creation.\n expect(tf.memory().numTensors).toEqual(2);\n\n let count = 0;\n // ds.forEachAsync() automatically disposes incoming Tensors after\n // processing them.\n await ds.forEachAsync(elem => {\n count++;\n expect(elem.isDisposed).toBeFalsy();\n });\n expect(count).toEqual(2);\n // Cloned tensors are disposed after traverse, while original tensors\n // stay.\n expect(tf.memory().numTensors).toEqual(2);\n\n await ds.forEachAsync(elem => {\n count++;\n expect(elem.isDisposed).toBeFalsy();\n });\n expect(count).toEqual(4);\n expect(tf.memory().numTensors).toEqual(2);\n\n await ds.forEachAsync(elem => {\n count++;\n expect(elem.isDisposed).toBeFalsy();\n });\n expect(count).toEqual(6);\n expect(tf.memory().numTensors).toEqual(2);\n\n expect(a.isDisposed).toBeFalsy();\n expect(b.isDisposed).toBeFalsy();\n });\n\n it('clone tensors in nested structures when returning iterator of a ' +\n 'dataset generated from existing tensors',\n async () => {\n expect(tf.memory().numTensors).toEqual(0);\n const a = tf.ones([2, 1]);\n const b = tf.ones([2, 1]);\n const c = tf.ones([2, 1]);\n const d = tf.ones([2, 1]);\n expect(tf.memory().numTensors).toEqual(4);\n const ds = tfd.array([{foo: a, bar: b}, {foo: c, bar: d}]);\n // Pre-existing tensors are not cloned during dataset creation.\n expect(tf.memory().numTensors).toEqual(4);\n\n let count = 0;\n // ds.forEachAsync() automatically disposes incoming Tensors after\n // processing them.\n await ds.forEachAsync(elem => {\n count++;\n expect(elem.foo.isDisposed).toBeFalsy();\n expect(elem.bar.isDisposed).toBeFalsy();\n });\n expect(count).toEqual(2);\n // Cloned tensors are disposed after traverse, while original tensors\n // stay.\n expect(tf.memory().numTensors).toEqual(4);\n\n await ds.forEachAsync(elem => {\n count++;\n expect(elem.foo.isDisposed).toBeFalsy();\n expect(elem.bar.isDisposed).toBeFalsy();\n });\n expect(count).toEqual(4);\n expect(tf.memory().numTensors).toEqual(4);\n\n await ds.forEachAsync(elem => {\n count++;\n expect(elem.foo.isDisposed).toBeFalsy();\n expect(elem.bar.isDisposed).toBeFalsy();\n });\n expect(count).toEqual(6);\n expect(tf.memory().numTensors).toEqual(4);\n\n expect(a.isDisposed).toBeFalsy();\n expect(b.isDisposed).toBeFalsy();\n });\n\n it('traverse dataset from tensors without leaking Tensors', async () => {\n expect(tf.memory().numTensors).toEqual(0);\n const a = tf.ones([2, 1]);\n const b = tf.ones([2, 1]);\n const c = tf.ones([2, 1]);\n const d = tf.ones([2, 1]);\n expect(tf.memory().numTensors).toEqual(4);\n const ds = tfd.array([a, b, c, d]).take(2);\n // Pre-existing tensors are not cloned during dataset creation.\n expect(tf.memory().numTensors).toEqual(4);\n\n let count = 0;\n // ds.forEachAsync() automatically disposes incoming Tensors after\n // processing them.\n await ds.forEachAsync(elem => {\n count++;\n expect(elem.isDisposed).toBeFalsy();\n });\n expect(count).toEqual(2);\n // Cloned tensors are disposed after traverse, while original tensors\n // stay.\n expect(tf.memory().numTensors).toEqual(4);\n\n await ds.forEachAsync(elem => {\n count++;\n expect(elem.isDisposed).toBeFalsy();\n });\n expect(count).toEqual(4);\n expect(tf.memory().numTensors).toEqual(4);\n\n await ds.forEachAsync(elem => {\n count++;\n expect(elem.isDisposed).toBeFalsy();\n });\n expect(count).toEqual(6);\n expect(tf.memory().numTensors).toEqual(4);\n\n expect(a.isDisposed).toBeFalsy();\n expect(b.isDisposed).toBeFalsy();\n });\n\n it('can get correct size of dataset from objects array', async () => {\n const ds = tfd.array([{'item': 1}, {'item': 2}, {'item': 3}]);\n expect(ds.size).toEqual(3);\n });\n\n it('can get correct size of dataset from number array', async () => {\n const ds = tfd.array([1, 2, 3, 4, 5]);\n expect(ds.size).toEqual(5);\n });\n\n it('can get size 0 from empty dataset', async () => {\n const ds = tfd.array([]);\n expect(ds.size).toEqual(0);\n });\n\n it('size is null if dataset may exhausted randomly', async () => {\n const makeIterator = () => {\n let i = -1;\n return {\n next: () =>\n ++i < 7 ? {value: i, done: false} : {value: null, done: true}\n };\n };\n const ds = tfd.generator(makeIterator);\n expect(ds.size).toBeNull();\n });\n\n it('repeat dataset has correct size', async () => {\n const ds = tfd.array([1, 2, 3, 4, 5]).repeat(3);\n expect(ds.size).toEqual(15);\n });\n\n it('repeat dataset forever has infinite size', async () => {\n const ds = tfd.array([1, 2, 3, 4, 5]).repeat();\n expect(ds.size).toEqual(Infinity);\n });\n\n it('repeat unknown size dataset has null size', async () => {\n const makeIterator = () => {\n let i = -1;\n return {\n next: () =>\n ++i < 7 ? {value: i, done: false} : {value: null, done: true}\n };\n };\n const ds = tfd.generator(makeIterator).repeat(3);\n expect(ds.size).toBeNull();\n });\n\n it('take dataset has correct size', async () => {\n const ds = tfd.array([1, 2, 3, 4, 5]).take(3);\n expect(ds.size).toEqual(3);\n });\n\n it('take dataset without enough elements has correct size', async () => {\n const ds = tfd.array([1, 2, 3, 4, 5]).take(10);\n expect(ds.size).toEqual(5);\n });\n\n it('take dataset with unknown size has null size', async () => {\n const makeIterator = () => {\n let i = -1;\n return {\n next: () =>\n ++i < 7 ? {value: i, done: false} : {value: null, done: true}\n };\n };\n const ds = tfd.generator(makeIterator).take(3);\n expect(ds.size).toBeNull();\n });\n\n it('take dataset with infinite elements has correct size', async () => {\n const ds = tfd.array([1, 2, 3, 4, 5]).repeat().take(10);\n expect(ds.size).toEqual(10);\n });\n\n it('skip dataset has correct size', async () => {\n const ds = tfd.array([1, 2, 3, 4, 5]).skip(2);\n expect(ds.size).toEqual(3);\n });\n\n it('skip dataset without enough elements has correct size', async () => {\n const ds = tfd.array([1, 2, 3, 4, 5]).skip(10);\n expect(ds.size).toEqual(0);\n });\n\n it('skip dataset with unknown size has null size', async () => {\n const makeIterator = () => {\n let i = -1;\n return {\n next: () =>\n ++i < 7 ? {value: i, done: false} : {value: null, done: true}\n };\n };\n const ds = tfd.generator(makeIterator).skip(3);\n expect(ds.size).toBeNull();\n });\n\n it('skip dataset with infinite elements has infinity size', async () => {\n const ds = tfd.array([1, 2, 3, 4, 5]).repeat().skip(10);\n expect(ds.size).toEqual(Infinity);\n });\n\n it('batch dataset with small last batch has correct size', async () => {\n const ds = tfd.array([1, 2, 3, 4, 5, 6, 7]).batch(2, true);\n expect(ds.size).toEqual(4);\n });\n\n it('batch dataset without small last batch has correct size', async () => {\n const ds = tfd.array([1, 2, 3, 4, 5, 6, 7]).batch(2, false);\n expect(ds.size).toEqual(3);\n });\n\n it('batch dataset with unknown size has null size', async () => {\n const makeIterator = () => {\n let i = -1;\n return {\n next: () =>\n ++i < 7 ? {value: i, done: false} : {value: null, done: true}\n };\n };\n const ds = tfd.generator(makeIterator).batch(2);\n expect(ds.size).toBeNull();\n });\n\n it('batch dataset with infinite elements has infinity size', async () => {\n const ds = tfd.array([1, 2, 3, 4, 5]).repeat().batch(2);\n expect(ds.size).toEqual(Infinity);\n });\n\n it('map dataset preserves regular size', async () => {\n const ds = tfd.array([1, 2, 3, 4, 5]).map(e => e + 1);\n expect(ds.size).toEqual(5);\n });\n\n it('map dataset preserves infinity size', async () => {\n const ds = tfd.array([1, 2, 3, 4, 5]).repeat().map(e => e + 1);\n expect(ds.size).toEqual(Infinity);\n });\n\n it('map dataset preserves null size', async () => {\n const makeIterator = () => {\n let i = -1;\n return {\n next: () =>\n ++i < 7 ? {value: i, done: false} : {value: null, done: true}\n };\n };\n const ds = tfd.generator(makeIterator).map(e => e + 1);\n expect(ds.size).toBeNull();\n });\n\n it('filter dataset preserves infinity size', async () => {\n const ds = tfd.array([1, 2, 3, 4, 5]).repeat().filter(e => e % 2 === 0);\n expect(ds.size).toEqual(Infinity);\n });\n\n it('filter dataset with regular size has null size', async () => {\n const ds = tfd.array([1, 2, 3, 4, 5]).filter(e => e % 2 === 0);\n expect(ds.size).toBeNull();\n });\n\n it('filter dataset with null size has null size', async () => {\n const makeIterator = () => {\n let i = -1;\n return {\n next: () =>\n ++i < 7 ? {value: i, done: false} : {value: null, done: true}\n };\n };\n const ds = tfd.generator(makeIterator).filter(e => e % 2 === 0);\n expect(ds.size).toBeNull();\n });\n\n it('zipping an array of datasets with primitive elements has correct ' +\n 'size',\n async () => {\n const a = tfd.array([1, 2, 3]);\n const b = tfd.array([4, 5, 6, 7, 8]);\n const result = await tfd.zip([a, b]);\n expect(result.size).toEqual(3);\n });\n\n it('zipping an array of datasets with object elements has correct size',\n async () => {\n const a = tfd.array([{a: 1}, {a: 2}, {a: 3}]);\n const b = tfd.array([{b: 4}, {b: 5}, {b: 6}, {b: 7}, {b: 8}]);\n const result = await tfd.zip([a, b]);\n expect(result.size).toEqual(3);\n });\n\n it('zipping an object of datasets with primitive elements has correct ' +\n 'size',\n async () => {\n const a = tfd.array([1, 2, 3]);\n const b = tfd.array([4, 5, 6, 7, 8]);\n const result = await tfd.zip({'a': a, 'b': b});\n expect(result.size).toEqual(3);\n });\n\n it('zipping an object of datasets with object elements has correct size',\n async () => {\n const a = tfd.array([{a: 1}, {a: 2}, {a: 3}]);\n const b = tfd.array([{b: 4}, {b: 5}, {b: 6}, {b: 7}, {b: 8}]);\n const result = await tfd.zip({'a': a, 'b': b});\n expect(result.size).toEqual(3);\n });\n\n it('converting dataset with infinite elements to array throws error',\n async done => {\n try {\n const ds = tfd.array([1, 2, 3, 4, 5]).repeat();\n expect(ds.size).toEqual(Infinity);\n await ds.toArrayForTest();\n done.fail();\n } catch (e) {\n expect(e.message).toEqual(\n 'Can not convert infinite data stream to array.');\n done();\n }\n });\n\n it('ArrayBuffer type data is not converted', async () => {\n const a = new Float32Array([1, 2, 3]);\n const ds = tfd.array([a]);\n const result = await ds.toArrayForTest();\n const resultArray = result[0];\n expect(resultArray[0]).toBe(1);\n expect(resultArray[1]).toBe(2);\n expect(resultArray[2]).toBe(3);\n expect(ArrayBuffer.isView(resultArray)).toBe(true);\n expect(resultArray.constructor === Float32Array).toBe(true);\n });\n});\n\ndescribeAllEnvs('Dataset with DEBUG mode', () => {\n beforeAll(() => {\n tf.env().set('DEBUG', true);\n });\n\n it('throws an error when given an array of inconsistent shape',\n async done => {\n const dataset = array([[[1, 2], [3]], [[4, 5], [6]]]).batch(2);\n try {\n // Using toArray() rather than toArrayForTest(). The prefetch in\n // the latter, in combination with expecting an exception, causes\n // unrelated tests to fail (See\n // https://github.com/tensorflow/tfjs/issues/1330.\n await (await dataset.iterator()).toArray();\n done.fail();\n } catch (e) {\n expect(e.message).toEqual(\n 'Element arr[0][1] should have 2 elements, ' +\n 'but has 1 elements');\n done();\n }\n expect(tf.memory().numTensors).toBe(0);\n });\n});\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasource.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasource.d.ts deleted file mode 100644 index a3549077b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasource.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -import { ByteChunkIterator } from './iterators/byte_chunk_iterator'; -/** - * Represents a data source readable as a stream of binary data chunks. - * - * Because `Dataset`s can be read repeatedly (via `Dataset.iterator()`), this - * provides a means to repeatedly create streams from the underlying data - * sources. - */ -export declare abstract class DataSource { - /** - * Obtain a new stream of binary data chunks. - * - * Starts the new stream from the beginning of the data source, even if other - * streams have been obtained previously. - */ - abstract iterator(): Promise; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasource.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasource.js deleted file mode 100644 index 991802b1d..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasource.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/** - * Represents a data source readable as a stream of binary data chunks. - * - * Because `Dataset`s can be read repeatedly (via `Dataset.iterator()`), this - * provides a means to repeatedly create streams from the underlying data - * sources. - */ -export class DataSource { -} -// TODO(soergel): consider convenience factory functions here -// in combination with chainable source->dataset above, e.g.: -// tf.data.url(...).asCsvDataset().shuffle().batch() -//# sourceMappingURL=datasource.js.map \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasource.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasource.js.map deleted file mode 100644 index cbc241812..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/datasource.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"datasource.js","sourceRoot":"","sources":["../src/datasource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH;;;;;;GAMG;AACH,MAAM,OAAgB,UAAU;CAU/B;AAED,6DAA6D;AAC7D,6DAA6D;AAC7D,oDAAoD","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {ByteChunkIterator} from './iterators/byte_chunk_iterator';\n\n/**\n * Represents a data source readable as a stream of binary data chunks.\n *\n * Because `Dataset`s can be read repeatedly (via `Dataset.iterator()`), this\n * provides a means to repeatedly create streams from the underlying data\n * sources.\n */\nexport abstract class DataSource {\n /**\n * Obtain a new stream of binary data chunks.\n *\n * Starts the new stream from the beginning of the data source, even if other\n * streams have been obtained previously.\n */\n abstract async iterator(): Promise;\n\n // TODO(soergel): consider chainable Dataset construction here\n}\n\n// TODO(soergel): consider convenience factory functions here\n// in combination with chainable source->dataset above, e.g.:\n// tf.data.url(...).asCsvDataset().shuffle().batch()\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/index.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/index.d.ts deleted file mode 100644 index 48c18e396..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/index.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -export { array, Dataset, zip } from './dataset'; -export { CSVDataset } from './datasets/csv_dataset'; -export { TextLineDataset } from './datasets/text_line_dataset'; -export { csv, func, generator, microphone, webcam } from './readers'; -export { FileDataSource } from './sources/file_data_source'; -export { URLDataSource } from './sources/url_data_source'; -export { ColumnConfig, MicrophoneConfig, WebcamConfig } from './types'; -export { version as version_data } from './version'; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/index.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/index.js deleted file mode 100644 index 616ff0376..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/index.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -export { array, Dataset, zip } from './dataset'; -export { CSVDataset } from './datasets/csv_dataset'; -export { TextLineDataset } from './datasets/text_line_dataset'; -export { csv, func, generator, microphone, webcam } from './readers'; -export { FileDataSource } from './sources/file_data_source'; -export { URLDataSource } from './sources/url_data_source'; -export { version as version_data } from './version'; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/index.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/index.js.map deleted file mode 100644 index 10427aa87..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAC,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAC,MAAM,WAAW,CAAC;AACnE,OAAO,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,WAAW,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nexport {array, Dataset, zip} from './dataset';\nexport {CSVDataset} from './datasets/csv_dataset';\nexport {TextLineDataset} from './datasets/text_line_dataset';\nexport {csv, func, generator, microphone, webcam} from './readers';\nexport {FileDataSource} from './sources/file_data_source';\nexport {URLDataSource} from './sources/url_data_source';\nexport {ColumnConfig, MicrophoneConfig, WebcamConfig} from './types';\nexport {version as version_data} from './version';\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/readers.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/readers.d.ts deleted file mode 100644 index 4d35294c3..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/readers.d.ts +++ /dev/null @@ -1,254 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -import { TensorContainer } from '@tensorflow/tfjs-core'; -import { Dataset } from './dataset'; -import { CSVDataset } from './datasets/csv_dataset'; -import { MicrophoneIterator } from './iterators/microphone_iterator'; -import { WebcamIterator } from './iterators/webcam_iterator'; -import { CSVConfig, MicrophoneConfig, WebcamConfig } from './types'; -/** - * Create a `CSVDataset` by reading and decoding CSV file(s) from provided URL - * or local path if it's in Node environment. - * - * Note: If isLabel in columnConfigs is `true` for at least one column, the - * element in returned `CSVDataset` will be an object of - * `{xs:features, ys:labels}`: xs is a dict of features key/value pairs, ys - * is a dict of labels key/value pairs. If no column is marked as label, - * returns a dict of features only. - * - * ```js - * const csvUrl = - * 'https://storage.googleapis.com/tfjs-examples/multivariate-linear-regression/data/boston-housing-train.csv'; - * - * async function run() { - * // We want to predict the column "medv", which represents a median value of - * // a home (in $1000s), so we mark it as a label. - * const csvDataset = tf.data.csv( - * csvUrl, { - * columnConfigs: { - * medv: { - * isLabel: true - * } - * } - * }); - * - * // Number of features is the number of column names minus one for the label - * // column. - * const numOfFeatures = (await csvDataset.columnNames()).length - 1; - * - * // Prepare the Dataset for training. - * const flattenedDataset = - * csvDataset - * .map(({xs, ys}) => - * { - * // Convert xs(features) and ys(labels) from object form (keyed by - * // column name) to array form. - * return {xs:Object.values(xs), ys:Object.values(ys)}; - * }) - * .batch(10); - * - * // Define the model. - * const model = tf.sequential(); - * model.add(tf.layers.dense({ - * inputShape: [numOfFeatures], - * units: 1 - * })); - * model.compile({ - * optimizer: tf.train.sgd(0.000001), - * loss: 'meanSquaredError' - * }); - * - * // Fit the model using the prepared Dataset - * return model.fitDataset(flattenedDataset, { - * epochs: 10, - * callbacks: { - * onEpochEnd: async (epoch, logs) => { - * console.log(epoch + ':' + logs.loss); - * } - * } - * }); - * } - * - * await run(); - * ``` - * - * @param source URL or local path to get CSV file. If it's a local path, it - * must have prefix `file://` and it only works in node environment. - * @param csvConfig (Optional) A CSVConfig object that contains configurations - * of reading and decoding from CSV file(s). - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * configParamIndices: [1] - * } - */ -export declare function csv(source: RequestInfo, csvConfig?: CSVConfig): CSVDataset; -/** - * Create a `Dataset` that produces each element by calling a provided function. - * - * Note that repeated iterations over this `Dataset` may produce different - * results, because the function will be called anew for each element of each - * iteration. - * - * Also, beware that the sequence of calls to this function may be out of order - * in time with respect to the logical order of the Dataset. This is due to the - * asynchronous lazy nature of stream processing, and depends on downstream - * transformations (e.g. .shuffle()). If the provided function is pure, this is - * no problem, but if it is a closure over a mutable state (e.g., a traversal - * pointer), then the order of the produced elements may be scrambled. - * - * ```js - * let i = -1; - * const func = () => - * ++i < 5 ? {value: i, done: false} : {value: null, done: true}; - * const ds = tf.data.func(func); - * await ds.forEachAsync(e => console.log(e)); - * ``` - * - * @param f A function that produces one data element on each call. - */ -export declare function func(f: () => IteratorResult | Promise>): Dataset; -/** - * Create a `Dataset` that produces each element from provided JavaScript - * generator, which is a function* - * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions), - * or a function that returns an - * iterator - * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions). - * - * The returned iterator should have `.next()` function that returns element in - * format of `{value: TensorContainer, done:boolean}`. - * - * Example of creating a dataset from an iterator factory: - * ```js - * function makeIterator() { - * const numElements = 10; - * let index = 0; - * - * const iterator = { - * next: () => { - * let result; - * if (index < numElements) { - * result = {value: index, done: false}; - * index++; - * return result; - * } - * return {value: index, done: true}; - * } - * }; - * return iterator; - * } - * const ds = tf.data.generator(makeIterator); - * await ds.forEachAsync(e => console.log(e)); - * ``` - * - * Example of creating a dataset from a generator: - * ```js - * function* dataGenerator() { - * const numElements = 10; - * let index = 0; - * while (index < numElements) { - * const x = index; - * index++; - * yield x; - * } - * } - * - * const ds = tf.data.generator(dataGenerator); - * await ds.forEachAsync(e => console.log(e)); - * ``` - * - * @param generator A Javascript generator function that returns a JavaScript - * iterator. - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * configParamIndices: [1] - * } - */ -export declare function generator(generator: () => Iterator | Promise>): Dataset; -/** - * Create an iterator that generate `Tensor`s from webcam video stream. This API - * only works in Browser environment when the device has webcam. - * - * Note: this code snippet only works when the device has a webcam. It will - * request permission to open the webcam when running. - * ```js - * const videoElement = document.createElement('video'); - * videoElement.width = 100; - * videoElement.height = 100; - * const cam = await tf.data.webcam(videoElement); - * const img = await cam.capture(); - * img.print(); - * cam.stop(); - * ``` - * - * @param webcamVideoElement A `HTMLVideoElement` used to play video from - * webcam. If this element is not provided, a hidden `HTMLVideoElement` will - * be created. In that case, `resizeWidth` and `resizeHeight` must be - * provided to set the generated tensor shape. - * @param webcamConfig A `WebcamConfig` object that contains configurations of - * reading and manipulating data from webcam video stream. - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * ignoreCI: true - * } - */ -export declare function webcam(webcamVideoElement?: HTMLVideoElement, webcamConfig?: WebcamConfig): Promise; -/** - * Create an iterator that generate frequency-domain spectrogram `Tensor`s from - * microphone audio stream with browser's native FFT. This API only works in - * browser environment when the device has microphone. - * - * Note: this code snippet only works when the device has a microphone. It will - * request permission to open the microphone when running. - * ```js - * const mic = await tf.data.microphone({ - * fftSize: 1024, - * columnTruncateLength: 232, - * numFramesPerSpectrogram: 43, - * sampleRateHz:44100, - * includeSpectrogram: true, - * includeWaveform: true - * }); - * const audioData = await mic.capture(); - * const spectrogramTensor = audioData.spectrogram; - * spectrogramTensor.print(); - * const waveformTensor = audioData.waveform; - * waveformTensor.print(); - * mic.stop(); - * ``` - * - * @param microphoneConfig A `MicrophoneConfig` object that contains - * configurations of reading audio data from microphone. - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * ignoreCI: true - * } - */ -export declare function microphone(microphoneConfig?: MicrophoneConfig): Promise; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/readers.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/readers.js deleted file mode 100644 index 91686196b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/readers.js +++ /dev/null @@ -1,269 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -import { datasetFromIteratorFn } from './dataset'; -import { CSVDataset } from './datasets/csv_dataset'; -import { iteratorFromFunction } from './iterators/lazy_iterator'; -import { MicrophoneIterator } from './iterators/microphone_iterator'; -import { WebcamIterator } from './iterators/webcam_iterator'; -import { URLDataSource } from './sources/url_data_source'; -/** - * Create a `CSVDataset` by reading and decoding CSV file(s) from provided URL - * or local path if it's in Node environment. - * - * Note: If isLabel in columnConfigs is `true` for at least one column, the - * element in returned `CSVDataset` will be an object of - * `{xs:features, ys:labels}`: xs is a dict of features key/value pairs, ys - * is a dict of labels key/value pairs. If no column is marked as label, - * returns a dict of features only. - * - * ```js - * const csvUrl = - * 'https://storage.googleapis.com/tfjs-examples/multivariate-linear-regression/data/boston-housing-train.csv'; - * - * async function run() { - * // We want to predict the column "medv", which represents a median value of - * // a home (in $1000s), so we mark it as a label. - * const csvDataset = tf.data.csv( - * csvUrl, { - * columnConfigs: { - * medv: { - * isLabel: true - * } - * } - * }); - * - * // Number of features is the number of column names minus one for the label - * // column. - * const numOfFeatures = (await csvDataset.columnNames()).length - 1; - * - * // Prepare the Dataset for training. - * const flattenedDataset = - * csvDataset - * .map(({xs, ys}) => - * { - * // Convert xs(features) and ys(labels) from object form (keyed by - * // column name) to array form. - * return {xs:Object.values(xs), ys:Object.values(ys)}; - * }) - * .batch(10); - * - * // Define the model. - * const model = tf.sequential(); - * model.add(tf.layers.dense({ - * inputShape: [numOfFeatures], - * units: 1 - * })); - * model.compile({ - * optimizer: tf.train.sgd(0.000001), - * loss: 'meanSquaredError' - * }); - * - * // Fit the model using the prepared Dataset - * return model.fitDataset(flattenedDataset, { - * epochs: 10, - * callbacks: { - * onEpochEnd: async (epoch, logs) => { - * console.log(epoch + ':' + logs.loss); - * } - * } - * }); - * } - * - * await run(); - * ``` - * - * @param source URL or local path to get CSV file. If it's a local path, it - * must have prefix `file://` and it only works in node environment. - * @param csvConfig (Optional) A CSVConfig object that contains configurations - * of reading and decoding from CSV file(s). - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * configParamIndices: [1] - * } - */ -export function csv(source, csvConfig = {}) { - return new CSVDataset(new URLDataSource(source), csvConfig); -} -/** - * Create a `Dataset` that produces each element by calling a provided function. - * - * Note that repeated iterations over this `Dataset` may produce different - * results, because the function will be called anew for each element of each - * iteration. - * - * Also, beware that the sequence of calls to this function may be out of order - * in time with respect to the logical order of the Dataset. This is due to the - * asynchronous lazy nature of stream processing, and depends on downstream - * transformations (e.g. .shuffle()). If the provided function is pure, this is - * no problem, but if it is a closure over a mutable state (e.g., a traversal - * pointer), then the order of the produced elements may be scrambled. - * - * ```js - * let i = -1; - * const func = () => - * ++i < 5 ? {value: i, done: false} : {value: null, done: true}; - * const ds = tf.data.func(func); - * await ds.forEachAsync(e => console.log(e)); - * ``` - * - * @param f A function that produces one data element on each call. - */ -export function func(f) { - const iter = iteratorFromFunction(f); - return datasetFromIteratorFn(async () => iter); -} -/** - * Create a `Dataset` that produces each element from provided JavaScript - * generator, which is a function* - * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions), - * or a function that returns an - * iterator - * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions). - * - * The returned iterator should have `.next()` function that returns element in - * format of `{value: TensorContainer, done:boolean}`. - * - * Example of creating a dataset from an iterator factory: - * ```js - * function makeIterator() { - * const numElements = 10; - * let index = 0; - * - * const iterator = { - * next: () => { - * let result; - * if (index < numElements) { - * result = {value: index, done: false}; - * index++; - * return result; - * } - * return {value: index, done: true}; - * } - * }; - * return iterator; - * } - * const ds = tf.data.generator(makeIterator); - * await ds.forEachAsync(e => console.log(e)); - * ``` - * - * Example of creating a dataset from a generator: - * ```js - * function* dataGenerator() { - * const numElements = 10; - * let index = 0; - * while (index < numElements) { - * const x = index; - * index++; - * yield x; - * } - * } - * - * const ds = tf.data.generator(dataGenerator); - * await ds.forEachAsync(e => console.log(e)); - * ``` - * - * @param generator A Javascript generator function that returns a JavaScript - * iterator. - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * configParamIndices: [1] - * } - */ -export function generator(generator) { - return datasetFromIteratorFn(async () => { - const gen = await generator(); - return iteratorFromFunction(() => gen.next()); - }); -} -/** - * Create an iterator that generate `Tensor`s from webcam video stream. This API - * only works in Browser environment when the device has webcam. - * - * Note: this code snippet only works when the device has a webcam. It will - * request permission to open the webcam when running. - * ```js - * const videoElement = document.createElement('video'); - * videoElement.width = 100; - * videoElement.height = 100; - * const cam = await tf.data.webcam(videoElement); - * const img = await cam.capture(); - * img.print(); - * cam.stop(); - * ``` - * - * @param webcamVideoElement A `HTMLVideoElement` used to play video from - * webcam. If this element is not provided, a hidden `HTMLVideoElement` will - * be created. In that case, `resizeWidth` and `resizeHeight` must be - * provided to set the generated tensor shape. - * @param webcamConfig A `WebcamConfig` object that contains configurations of - * reading and manipulating data from webcam video stream. - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * ignoreCI: true - * } - */ -export async function webcam(webcamVideoElement, webcamConfig) { - return WebcamIterator.create(webcamVideoElement, webcamConfig); -} -/** - * Create an iterator that generate frequency-domain spectrogram `Tensor`s from - * microphone audio stream with browser's native FFT. This API only works in - * browser environment when the device has microphone. - * - * Note: this code snippet only works when the device has a microphone. It will - * request permission to open the microphone when running. - * ```js - * const mic = await tf.data.microphone({ - * fftSize: 1024, - * columnTruncateLength: 232, - * numFramesPerSpectrogram: 43, - * sampleRateHz:44100, - * includeSpectrogram: true, - * includeWaveform: true - * }); - * const audioData = await mic.capture(); - * const spectrogramTensor = audioData.spectrogram; - * spectrogramTensor.print(); - * const waveformTensor = audioData.waveform; - * waveformTensor.print(); - * mic.stop(); - * ``` - * - * @param microphoneConfig A `MicrophoneConfig` object that contains - * configurations of reading audio data from microphone. - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * ignoreCI: true - * } - */ -export async function microphone(microphoneConfig) { - return MicrophoneIterator.create(microphoneConfig); -} -//# sourceMappingURL=readers.js.map \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/readers.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/readers.js.map deleted file mode 100644 index 8a787628c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/readers.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"readers.js","sourceRoot":"","sources":["../src/readers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAU,qBAAqB,EAAC,MAAM,WAAW,CAAC;AACzD,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAC,oBAAoB,EAAC,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAC,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAC,aAAa,EAAC,MAAM,2BAA2B,CAAC;AAGxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6EG;AACH,MAAM,UAAU,GAAG,CACf,MAAmB,EAAE,YAAuB,EAAE;IAChD,OAAO,IAAI,UAAU,CAAC,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,IAAI,CAChB,CAAsD;IACxD,MAAM,IAAI,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC;IACrC,OAAO,qBAAqB,CAAC,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC;AACjD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,MAAM,UAAU,SAAS,CACrB,SAAkD;IACpD,OAAO,qBAAqB,CAAC,KAAK,IAAI,EAAE;QACtC,MAAM,GAAG,GAAG,MAAM,SAAS,EAAE,CAAC;QAC9B,OAAO,oBAAoB,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,CAAC,KAAK,UAAU,MAAM,CACxB,kBAAqC,EACrC,YAA2B;IAC7B,OAAO,cAAc,CAAC,MAAM,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC;AACjE,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,gBAAmC;IAElE,OAAO,kBAAkB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;AACrD,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {TensorContainer} from '@tensorflow/tfjs-core';\nimport {Dataset, datasetFromIteratorFn} from './dataset';\nimport {CSVDataset} from './datasets/csv_dataset';\nimport {iteratorFromFunction} from './iterators/lazy_iterator';\nimport {MicrophoneIterator} from './iterators/microphone_iterator';\nimport {WebcamIterator} from './iterators/webcam_iterator';\nimport {URLDataSource} from './sources/url_data_source';\nimport {CSVConfig, MicrophoneConfig, WebcamConfig} from './types';\n\n/**\n * Create a `CSVDataset` by reading and decoding CSV file(s) from provided URL\n * or local path if it's in Node environment.\n *\n * Note: If isLabel in columnConfigs is `true` for at least one column, the\n * element in returned `CSVDataset` will be an object of\n * `{xs:features, ys:labels}`: xs is a dict of features key/value pairs, ys\n * is a dict of labels key/value pairs. If no column is marked as label,\n * returns a dict of features only.\n *\n * ```js\n * const csvUrl =\n * 'https://storage.googleapis.com/tfjs-examples/multivariate-linear-regression/data/boston-housing-train.csv';\n *\n * async function run() {\n * // We want to predict the column \"medv\", which represents a median value of\n * // a home (in $1000s), so we mark it as a label.\n * const csvDataset = tf.data.csv(\n * csvUrl, {\n * columnConfigs: {\n * medv: {\n * isLabel: true\n * }\n * }\n * });\n *\n * // Number of features is the number of column names minus one for the label\n * // column.\n * const numOfFeatures = (await csvDataset.columnNames()).length - 1;\n *\n * // Prepare the Dataset for training.\n * const flattenedDataset =\n * csvDataset\n * .map(({xs, ys}) =>\n * {\n * // Convert xs(features) and ys(labels) from object form (keyed by\n * // column name) to array form.\n * return {xs:Object.values(xs), ys:Object.values(ys)};\n * })\n * .batch(10);\n *\n * // Define the model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense({\n * inputShape: [numOfFeatures],\n * units: 1\n * }));\n * model.compile({\n * optimizer: tf.train.sgd(0.000001),\n * loss: 'meanSquaredError'\n * });\n *\n * // Fit the model using the prepared Dataset\n * return model.fitDataset(flattenedDataset, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * console.log(epoch + ':' + logs.loss);\n * }\n * }\n * });\n * }\n *\n * await run();\n * ```\n *\n * @param source URL or local path to get CSV file. If it's a local path, it\n * must have prefix `file://` and it only works in node environment.\n * @param csvConfig (Optional) A CSVConfig object that contains configurations\n * of reading and decoding from CSV file(s).\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * configParamIndices: [1]\n * }\n */\nexport function csv(\n source: RequestInfo, csvConfig: CSVConfig = {}): CSVDataset {\n return new CSVDataset(new URLDataSource(source), csvConfig);\n}\n\n/**\n * Create a `Dataset` that produces each element by calling a provided function.\n *\n * Note that repeated iterations over this `Dataset` may produce different\n * results, because the function will be called anew for each element of each\n * iteration.\n *\n * Also, beware that the sequence of calls to this function may be out of order\n * in time with respect to the logical order of the Dataset. This is due to the\n * asynchronous lazy nature of stream processing, and depends on downstream\n * transformations (e.g. .shuffle()). If the provided function is pure, this is\n * no problem, but if it is a closure over a mutable state (e.g., a traversal\n * pointer), then the order of the produced elements may be scrambled.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const ds = tf.data.func(func);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * @param f A function that produces one data element on each call.\n */\nexport function func(\n f: () => IteratorResult| Promise>): Dataset {\n const iter = iteratorFromFunction(f);\n return datasetFromIteratorFn(async () => iter);\n}\n\n/**\n * Create a `Dataset` that produces each element from provided JavaScript\n * generator, which is a function*\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions),\n * or a function that returns an\n * iterator\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions).\n *\n * The returned iterator should have `.next()` function that returns element in\n * format of `{value: TensorContainer, done:boolean}`.\n *\n * Example of creating a dataset from an iterator factory:\n * ```js\n * function makeIterator() {\n * const numElements = 10;\n * let index = 0;\n *\n * const iterator = {\n * next: () => {\n * let result;\n * if (index < numElements) {\n * result = {value: index, done: false};\n * index++;\n * return result;\n * }\n * return {value: index, done: true};\n * }\n * };\n * return iterator;\n * }\n * const ds = tf.data.generator(makeIterator);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * Example of creating a dataset from a generator:\n * ```js\n * function* dataGenerator() {\n * const numElements = 10;\n * let index = 0;\n * while (index < numElements) {\n * const x = index;\n * index++;\n * yield x;\n * }\n * }\n *\n * const ds = tf.data.generator(dataGenerator);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * @param generator A Javascript generator function that returns a JavaScript\n * iterator.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * configParamIndices: [1]\n * }\n */\nexport function generator(\n generator: () => Iterator| Promise>): Dataset {\n return datasetFromIteratorFn(async () => {\n const gen = await generator();\n return iteratorFromFunction(() => gen.next());\n });\n}\n\n/**\n * Create an iterator that generate `Tensor`s from webcam video stream. This API\n * only works in Browser environment when the device has webcam.\n *\n * Note: this code snippet only works when the device has a webcam. It will\n * request permission to open the webcam when running.\n * ```js\n * const videoElement = document.createElement('video');\n * videoElement.width = 100;\n * videoElement.height = 100;\n * const cam = await tf.data.webcam(videoElement);\n * const img = await cam.capture();\n * img.print();\n * cam.stop();\n * ```\n *\n * @param webcamVideoElement A `HTMLVideoElement` used to play video from\n * webcam. If this element is not provided, a hidden `HTMLVideoElement` will\n * be created. In that case, `resizeWidth` and `resizeHeight` must be\n * provided to set the generated tensor shape.\n * @param webcamConfig A `WebcamConfig` object that contains configurations of\n * reading and manipulating data from webcam video stream.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * ignoreCI: true\n * }\n */\nexport async function webcam(\n webcamVideoElement?: HTMLVideoElement,\n webcamConfig?: WebcamConfig): Promise {\n return WebcamIterator.create(webcamVideoElement, webcamConfig);\n}\n\n/**\n * Create an iterator that generate frequency-domain spectrogram `Tensor`s from\n * microphone audio stream with browser's native FFT. This API only works in\n * browser environment when the device has microphone.\n *\n * Note: this code snippet only works when the device has a microphone. It will\n * request permission to open the microphone when running.\n * ```js\n * const mic = await tf.data.microphone({\n * fftSize: 1024,\n * columnTruncateLength: 232,\n * numFramesPerSpectrogram: 43,\n * sampleRateHz:44100,\n * includeSpectrogram: true,\n * includeWaveform: true\n * });\n * const audioData = await mic.capture();\n * const spectrogramTensor = audioData.spectrogram;\n * spectrogramTensor.print();\n * const waveformTensor = audioData.waveform;\n * waveformTensor.print();\n * mic.stop();\n * ```\n *\n * @param microphoneConfig A `MicrophoneConfig` object that contains\n * configurations of reading audio data from microphone.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * ignoreCI: true\n * }\n */\nexport async function microphone(microphoneConfig?: MicrophoneConfig):\n Promise {\n return MicrophoneIterator.create(microphoneConfig);\n}\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/readers_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/readers_test.js.map deleted file mode 100644 index cbe1d5c9e..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/readers_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"readers_test.js","sourceRoot":"","sources":["../src/readers_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,GAAG,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,eAAe,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,oBAAoB,EAAC,MAAM,mBAAmB,CAAC;AAE9I,eAAe,CAAC,SAAS,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,gCAAgC,EAAE,KAAK,IAAI,EAAE;QAC9C,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACX,MAAM,CAAC,GAAG,GAAG,EAAE,CACX,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC,CAAC,EAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC;QAClE,MAAM,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACvB,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,cAAc,EAAE,CAAC;QACzC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4CAA4C,EAAE,K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O,CACrB,0DAA0D,CAAC,CAAC;YAChE,IAAI,EAAE,CAAC;SACR;IACH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,KAAK,EAAC,IAAI,EAAC,EAAE;QAC1D,IAAI;YACF,MAAM,GAAG,CAAC,UAAU,EAAE,CAAC;YACvB,IAAI,CAAC,IAAI,EAAE,CAAC;SACb;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CACrB,0DAA0D,CAAC,CAAC;YAChE,IAAI,EAAE,CAAC;SACR;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as tfd from './readers';\nimport {describeAllEnvs, describeBrowserEnvs, describeNodeEnvs, replaceHTMLVideoElementSource, setupFakeVideoStream} from './util/test_utils';\n\ndescribeAllEnvs('readers', () => {\n it('generate dataset from function', async () => {\n let i = -1;\n const f = () =>\n ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n const ds = tfd.func(f);\n const result = await ds.toArrayForTest();\n expect(result).toEqual([0, 1, 2, 3, 4]);\n });\n\n it('generate dataset from JavaScript generator', async () => {\n function* dataGenerator() {\n const numElements = 5;\n let index = 0;\n while (index < numElements) {\n const x = index;\n index++;\n yield x;\n }\n }\n const ds = tfd.generator(dataGenerator);\n const result = await ds.toArrayForTest();\n expect(result).toEqual([0, 1, 2, 3, 4]);\n });\n\n it('generate multiple datasets from JavaScript generator', async () => {\n function* dataGenerator() {\n const numElements = 5;\n let index = 0;\n while (index < numElements) {\n const x = index;\n index++;\n yield x;\n }\n }\n const ds = tfd.generator(dataGenerator);\n const result1 = await ds.toArrayForTest();\n expect(result1).toEqual([0, 1, 2, 3, 4]);\n const result2 = await ds.toArrayForTest();\n expect(result2).toEqual([0, 1, 2, 3, 4]);\n });\n\n it('generate dataset from JavaScript iterator factory', async () => {\n function makeIterator() {\n let iterationCount = 0;\n const iterator = {\n next: () => {\n let result;\n if (iterationCount < 5) {\n result = {value: iterationCount, done: false};\n iterationCount++;\n return result;\n }\n return {value: iterationCount, done: true};\n }\n };\n return iterator;\n }\n const ds = tfd.generator(makeIterator);\n const result = await ds.toArrayForTest();\n expect(result).toEqual([0, 1, 2, 3, 4]);\n });\n\n it('generate multiple datasets from JavaScript iterator factory',\n async () => {\n function makeIterator() {\n let iterationCount = 0;\n const iterator = {\n next: () => {\n let result;\n if (iterationCount < 5) {\n result = {value: iterationCount, done: false};\n iterationCount++;\n return result;\n }\n return {value: iterationCount, done: true};\n }\n };\n return iterator;\n }\n const ds = tfd.generator(makeIterator);\n const result1 = await ds.toArrayForTest();\n expect(result1).toEqual([0, 1, 2, 3, 4]);\n const result2 = await ds.toArrayForTest();\n expect(result2).toEqual([0, 1, 2, 3, 4]);\n });\n\n it('generate dataset from async iterator factory', async () => {\n async function waitAndCreateCount() {\n return new Promise(resolve => {\n setTimeout(() => {\n resolve(3);\n }, 1000);\n });\n }\n async function makeIterator() {\n let iterationCount = (await waitAndCreateCount()) as number;\n const iterator = {\n next: () => {\n let result;\n if (iterationCount < 6) {\n result = {value: iterationCount, done: false};\n iterationCount++;\n return result;\n }\n return {value: iterationCount, done: true};\n }\n };\n return iterator;\n }\n const ds = tfd.generator(makeIterator);\n const result = await ds.toArrayForTest();\n expect(result).toEqual([3, 4, 5]);\n });\n});\n\ndescribeBrowserEnvs('readers in browser', () => {\n it('generate data from webcam with HTML element', async () => {\n setupFakeVideoStream();\n const videoElement = document.createElement('video');\n videoElement.width = 160;\n videoElement.height = 90;\n\n const webcamIterator = await tfd.webcam(videoElement);\n await replaceHTMLVideoElementSource(videoElement);\n const result = await webcamIterator.next();\n expect(result.done).toBeFalsy();\n expect(result.value.shape).toEqual([90, 160, 3]);\n });\n\n it('generate data from webcam with no HTML element', async () => {\n setupFakeVideoStream();\n const webcamIterator =\n await tfd.webcam(null, {resizeWidth: 300, resizeHeight: 150});\n const result = await webcamIterator.next();\n expect(result.done).toBeFalsy();\n expect(result.value.shape).toEqual([150, 300, 3]);\n });\n\n it('generate data from webcam with HTML element and resize', async () => {\n setupFakeVideoStream();\n const videoElement = document.createElement('video');\n videoElement.width = 300;\n videoElement.height = 500;\n\n const webcamIterator = await tfd.webcam(\n videoElement, {resizeWidth: 100, resizeHeight: 200, centerCrop: true});\n const result = await webcamIterator.next();\n expect(result.done).toBeFalsy();\n expect(result.value.shape).toEqual([200, 100, 3]);\n });\n});\n\ndescribeNodeEnvs('readers in node', () => {\n it('webcam only available in browser env', async done => {\n try {\n await tfd.webcam();\n done.fail();\n } catch (e) {\n expect(e.message).toEqual(\n 'tf.data.webcam is only supported in browser environment.');\n done();\n }\n });\n\n it('microphone only available in browser env', async done => {\n try {\n await tfd.microphone();\n done.fail();\n } catch (e) {\n expect(e.message).toEqual(\n 'microphone API is only supported in browser environment.');\n done();\n }\n });\n});\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/statistics.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/statistics.d.ts deleted file mode 100644 index d7ae0c6ed..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/statistics.d.ts +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -import * as tf from '@tensorflow/tfjs-core'; -import { Dataset } from './dataset'; -/** - * The value associated with a given key for a single element. - * - * Such a value may not have a batch dimension. A value may be a scalar or an - * n-dimensional array. - */ -export declare type ElementArray = number | number[] | tf.Tensor | string; -/** - * A map from string keys (aka column names) to values for a single element. - */ -export declare type TabularRecord = { - [key: string]: ElementArray; -}; -/** An interface representing numeric statistics of a column. */ -export interface NumericColumnStatistics { - min: number; - max: number; - mean: number; - variance: number; - stddev: number; - length: number; -} -/** - * An interface representing column level NumericColumnStatistics for a - * Dataset. - */ -export interface DatasetStatistics { - [key: string]: NumericColumnStatistics; -} -/** - * Provides a function that scales numeric values into the [0, 1] interval. - * - * @param min the lower bound of the inputs, which should be mapped to 0. - * @param max the upper bound of the inputs, which should be mapped to 1, - * @return A function that maps an input ElementArray to a scaled ElementArray. - */ -export declare function scaleTo01(min: number, max: number): (value: ElementArray) => ElementArray; -/** - * Provides a function that calculates column level statistics, i.e. min, max, - * variance, stddev. - * - * @param dataset The Dataset object whose statistics will be calculated. - * @param sampleSize (Optional) If set, statistics will only be calculated - * against a subset of the whole data. - * @param shuffleWindowSize (Optional) If set, shuffle provided dataset before - * calculating statistics. - * @return A DatasetStatistics object that contains NumericColumnStatistics of - * each column. - */ -export declare function computeDatasetStatistics(dataset: Dataset, sampleSize?: number, shuffleWindowSize?: number): Promise; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/statistics.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/statistics.js deleted file mode 100644 index 5d6f6d6cc..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/statistics.js +++ /dev/null @@ -1,163 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -import * as tf from '@tensorflow/tfjs-core'; -import { div, max, min, sub } from '@tensorflow/tfjs-core'; -/** - * Provides a function that scales numeric values into the [0, 1] interval. - * - * @param min the lower bound of the inputs, which should be mapped to 0. - * @param max the upper bound of the inputs, which should be mapped to 1, - * @return A function that maps an input ElementArray to a scaled ElementArray. - */ -export function scaleTo01(min, max) { - const range = max - min; - const minTensor = tf.scalar(min); - const rangeTensor = tf.scalar(range); - return (value) => { - if (typeof (value) === 'string') { - throw new Error('Can\'t scale a string.'); - } - else { - if (value instanceof tf.Tensor) { - const result = div(sub(value, minTensor), rangeTensor); - return result; - } - else if (value instanceof Array) { - return value.map(v => (v - min) / range); - } - else { - return (value - min) / range; - } - } - }; -} -/** - * Provides a function that calculates column level statistics, i.e. min, max, - * variance, stddev. - * - * @param dataset The Dataset object whose statistics will be calculated. - * @param sampleSize (Optional) If set, statistics will only be calculated - * against a subset of the whole data. - * @param shuffleWindowSize (Optional) If set, shuffle provided dataset before - * calculating statistics. - * @return A DatasetStatistics object that contains NumericColumnStatistics of - * each column. - */ -export async function computeDatasetStatistics(dataset, sampleSize, shuffleWindowSize) { - let sampleDataset = dataset; - // TODO(soergel): allow for deep shuffle where possible. - if (shuffleWindowSize != null) { - sampleDataset = sampleDataset.shuffle(shuffleWindowSize); - } - if (sampleSize != null) { - sampleDataset = sampleDataset.take(sampleSize); - } - // TODO(soergel): prepare the column objects based on a schema. - const result = {}; - await sampleDataset.forEachAsync(e => { - for (const key of Object.keys(e)) { - const value = e[key]; - if (typeof (value) === 'string') { - // No statistics for string element. - } - else { - let previousMean = 0; - let previousLength = 0; - let previousVariance = 0; - let columnStats = result[key]; - if (columnStats == null) { - columnStats = { - min: Number.POSITIVE_INFINITY, - max: Number.NEGATIVE_INFINITY, - mean: 0, - variance: 0, - stddev: 0, - length: 0 - }; - result[key] = columnStats; - } - else { - previousMean = columnStats.mean; - previousLength = columnStats.length; - previousVariance = columnStats.variance; - } - let recordMin; - let recordMax; - // Calculate accumulated mean and variance following tf.Transform - // implementation - let valueLength = 0; - let valueMean = 0; - let valueVariance = 0; - let combinedLength = 0; - let combinedMean = 0; - let combinedVariance = 0; - if (value instanceof tf.Tensor) { - recordMin = min(value).dataSync()[0]; - recordMax = max(value).dataSync()[0]; - const valueMoment = tf.moments(value); - valueMean = valueMoment.mean.dataSync()[0]; - valueVariance = valueMoment.variance.dataSync()[0]; - valueLength = value.size; - } - else if (value instanceof Array) { - recordMin = value.reduce((a, b) => Math.min(a, b)); - recordMax = value.reduce((a, b) => Math.max(a, b)); - const valueMoment = tf.moments(value); - valueMean = valueMoment.mean.dataSync()[0]; - valueVariance = valueMoment.variance.dataSync()[0]; - valueLength = value.length; - } - else if (!isNaN(value) && isFinite(value)) { - recordMin = value; - recordMax = value; - valueMean = value; - valueVariance = 0; - valueLength = 1; - } - else { - columnStats = null; - continue; - } - combinedLength = previousLength + valueLength; - combinedMean = previousMean + - (valueLength / combinedLength) * (valueMean - previousMean); - combinedVariance = previousVariance + - (valueLength / combinedLength) * - (valueVariance + - ((valueMean - combinedMean) * (valueMean - previousMean)) - - previousVariance); - columnStats.min = Math.min(columnStats.min, recordMin); - columnStats.max = Math.max(columnStats.max, recordMax); - columnStats.length = combinedLength; - columnStats.mean = combinedMean; - columnStats.variance = combinedVariance; - columnStats.stddev = Math.sqrt(combinedVariance); - } - } - }); - // Variance and stddev should be NaN for the case of a single element. - for (const key in result) { - const stat = result[key]; - if (stat.length === 1) { - stat.variance = NaN; - stat.stddev = NaN; - } - } - return result; -} -//# sourceMappingURL=statistics.js.map \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/statistics.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/statistics.js.map deleted file mode 100644 index f08c80e7f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/statistics.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"statistics.js","sourceRoot":"","sources":["../src/statistics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAC,MAAM,uBAAuB,CAAC;AA8CzD;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW,EAAE,GAAW;IAEhD,MAAM,KAAK,GAAG,GAAG,GAAG,GAAG,CAAC;IACxB,MAAM,SAAS,GAAc,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC5C,MAAM,WAAW,GAAc,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAChD,OAAO,CAAC,KAAmB,EAAgB,EAAE;QAC3C,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,QAAQ,EAAE;YAC/B,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;SAC3C;aAAM;YACL,IAAI,KAAK,YAAY,EAAE,CAAC,MAAM,EAAE;gBAC9B,MAAM,MAAM,GAAG,GAA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SAAS,GAAG,YAAY,CAAC,CAAC;4BACzD,gBAAgB,CAAC,CAAC;gBAE3B,WAAW,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;gBACvD,WAAW,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;gBACvD,WAAW,CAAC,MAAM,GAAG,cAAc,CAAC;gBACpC,WAAW,CAAC,IAAI,GAAG,YAAY,CAAC;gBAChC,WAAW,CAAC,QAAQ,GAAG,gBAAgB,CAAC;gBACxC,WAAW,CAAC,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;aAClD;SACF;IACH,CAAC,CAAC,CAAC;IACH,sEAAsE;IACtE,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;QACxB,MAAM,IAAI,GAA4B,MAAM,CAAC,GAAG,CAAC,CAAC;QAClD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;YACrB,IAAI,CAAC,QAAQ,GAAG,GAAG,CAAC;YACpB,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC;SACnB;KACF;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport {div, max, min, sub} from '@tensorflow/tfjs-core';\n\nimport {Dataset} from './dataset';\n\n// TODO(kangyizhang): eliminate the need for ElementArray and TabularRecord, by\n// computing stats on nested structures via deepMap/deepZip.\n\n/**\n * The value associated with a given key for a single element.\n *\n * Such a value may not have a batch dimension. A value may be a scalar or an\n * n-dimensional array.\n */\nexport type ElementArray = number|number[]|tf.Tensor|string;\n\n/**\n * A map from string keys (aka column names) to values for a single element.\n */\nexport type TabularRecord = {\n [key: string]: ElementArray\n};\n\n// TODO(kangyizhang): Flesh out collected statistics.\n// For numeric columns we should provide mean, stddev, histogram, etc.\n// For string columns we should provide a vocabulary (at least, top-k), maybe a\n// length histogram, etc.\n// Collecting only numeric min and max is just the bare minimum for now.\n\n/** An interface representing numeric statistics of a column. */\nexport interface NumericColumnStatistics {\n min: number;\n max: number;\n mean: number;\n variance: number;\n stddev: number;\n length: number;\n}\n\n/**\n * An interface representing column level NumericColumnStatistics for a\n * Dataset.\n */\nexport interface DatasetStatistics {\n [key: string]: NumericColumnStatistics;\n}\n\n/**\n * Provides a function that scales numeric values into the [0, 1] interval.\n *\n * @param min the lower bound of the inputs, which should be mapped to 0.\n * @param max the upper bound of the inputs, which should be mapped to 1,\n * @return A function that maps an input ElementArray to a scaled ElementArray.\n */\nexport function scaleTo01(min: number, max: number): (value: ElementArray) =>\n ElementArray {\n const range = max - min;\n const minTensor: tf.Tensor = tf.scalar(min);\n const rangeTensor: tf.Tensor = tf.scalar(range);\n return (value: ElementArray): ElementArray => {\n if (typeof (value) === 'string') {\n throw new Error('Can\\'t scale a string.');\n } else {\n if (value instanceof tf.Tensor) {\n const result = div(sub(value, minTensor), rangeTensor);\n return result;\n } else if (value instanceof Array) {\n return value.map(v => (v - min) / range);\n } else {\n return (value - min) / range;\n }\n }\n };\n}\n\n/**\n * Provides a function that calculates column level statistics, i.e. min, max,\n * variance, stddev.\n *\n * @param dataset The Dataset object whose statistics will be calculated.\n * @param sampleSize (Optional) If set, statistics will only be calculated\n * against a subset of the whole data.\n * @param shuffleWindowSize (Optional) If set, shuffle provided dataset before\n * calculating statistics.\n * @return A DatasetStatistics object that contains NumericColumnStatistics of\n * each column.\n */\nexport async function computeDatasetStatistics(\n dataset: Dataset, sampleSize?: number,\n shuffleWindowSize?: number): Promise {\n let sampleDataset = dataset;\n // TODO(soergel): allow for deep shuffle where possible.\n if (shuffleWindowSize != null) {\n sampleDataset = sampleDataset.shuffle(shuffleWindowSize);\n }\n if (sampleSize != null) {\n sampleDataset = sampleDataset.take(sampleSize);\n }\n\n // TODO(soergel): prepare the column objects based on a schema.\n const result: DatasetStatistics = {};\n\n await sampleDataset.forEachAsync(e => {\n for (const key of Object.keys(e)) {\n const value = e[key];\n if (typeof (value) === 'string') {\n // No statistics for string element.\n } else {\n let previousMean = 0;\n let previousLength = 0;\n let previousVariance = 0;\n let columnStats: NumericColumnStatistics = result[key];\n if (columnStats == null) {\n columnStats = {\n min: Number.POSITIVE_INFINITY,\n max: Number.NEGATIVE_INFINITY,\n mean: 0,\n variance: 0,\n stddev: 0,\n length: 0\n };\n result[key] = columnStats;\n } else {\n previousMean = columnStats.mean;\n previousLength = columnStats.length;\n previousVariance = columnStats.variance;\n }\n let recordMin: number;\n let recordMax: number;\n\n // Calculate accumulated mean and variance following tf.Transform\n // implementation\n let valueLength = 0;\n let valueMean = 0;\n let valueVariance = 0;\n let combinedLength = 0;\n let combinedMean = 0;\n let combinedVariance = 0;\n\n if (value instanceof tf.Tensor) {\n recordMin = min(value).dataSync()[0];\n recordMax = max(value).dataSync()[0];\n const valueMoment = tf.moments(value);\n valueMean = valueMoment.mean.dataSync()[0];\n valueVariance = valueMoment.variance.dataSync()[0];\n valueLength = value.size;\n\n } else if (value instanceof Array) {\n recordMin = value.reduce((a, b) => Math.min(a, b));\n recordMax = value.reduce((a, b) => Math.max(a, b));\n const valueMoment = tf.moments(value);\n valueMean = valueMoment.mean.dataSync()[0];\n valueVariance = valueMoment.variance.dataSync()[0];\n valueLength = value.length;\n\n } else if (!isNaN(value) && isFinite(value)) {\n recordMin = value;\n recordMax = value;\n valueMean = value;\n valueVariance = 0;\n valueLength = 1;\n\n } else {\n columnStats = null;\n continue;\n }\n combinedLength = previousLength + valueLength;\n combinedMean = previousMean +\n (valueLength / combinedLength) * (valueMean - previousMean);\n combinedVariance = previousVariance +\n (valueLength / combinedLength) *\n (valueVariance +\n ((valueMean - combinedMean) * (valueMean - previousMean)) -\n previousVariance);\n\n columnStats.min = Math.min(columnStats.min, recordMin);\n columnStats.max = Math.max(columnStats.max, recordMax);\n columnStats.length = combinedLength;\n columnStats.mean = combinedMean;\n columnStats.variance = combinedVariance;\n columnStats.stddev = Math.sqrt(combinedVariance);\n }\n }\n });\n // Variance and stddev should be NaN for the case of a single element.\n for (const key in result) {\n const stat: NumericColumnStatistics = result[key];\n if (stat.length === 1) {\n stat.variance = NaN;\n stat.stddev = NaN;\n }\n }\n return result;\n}\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/statistics_test.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/statistics_test.js.map deleted file mode 100644 index 8619a4ec7..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/statistics_test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"statistics_test.js","sourceRoot":"","sources":["../src/statistics_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAE5C,OAAO,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAC,wBAAwB,EAAE,SAAS,EAAgB,MAAM,cAAc,CAAC;AAChF,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAElD,eAAe,CAAC,uBAAuB,EAAE,GAAG,EAAE;IAC5C,EAAE,CAAC,gEAAgE,EAChE,KAAK,IAAI,EAAE;QACT,MA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CAAC,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAC,CAAC,CAAC,CAAC;QAEtE,MAAM,KAAK,GAAG,MAAM,wBAAwB,CAAC,aAAa,CAAC,CAAC;QAC5D,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAC3C,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport {Dataset} from './dataset';\nimport {TestDataset} from './dataset_test';\nimport {computeDatasetStatistics, scaleTo01, TabularRecord} from './statistics';\nimport {describeAllEnvs} from './util/test_utils';\n\ndescribeAllEnvs('makeDatasetStatistics', () => {\n it('computes numeric min and max over numbers, arrays, and Tensors',\n async () => {\n const ds = new TestDataset().skip(55) as Dataset;\n const stats = await computeDatasetStatistics(ds);\n expect(stats['number'].min).toEqual(55);\n expect(stats['number'].max).toEqual(99);\n // The TestDataset includes cubes of the indices\n expect(stats['numberArray'].min).toEqual(55);\n expect(stats['numberArray'].max).toEqual(99 * 99 * 99);\n expect(stats['Tensor'].min).toEqual(55);\n expect(stats['Tensor'].max).toEqual(99 * 99 * 99);\n });\n\n it('computes numeric mean and variance over numbers, arrays, and Tensors',\n async () => {\n // According to https://github.com/tensorflow/tfjs/issues/658, unit tests\n // for mean and variance will use small numbers.\n const ds = new TestDataset().take(10) as Dataset;\n const stats = await computeDatasetStatistics(ds);\n expect(stats['number'].min).toEqual(0);\n expect(stats['number'].max).toEqual(9);\n expect(stats['number'].mean).toEqual(4.5);\n expect(stats['number'].variance).toEqual(8.25);\n expect(stats['number'].stddev).toEqual(2.8722813232690143);\n\n // The TestDataset includes cubes of the indices\n expect(stats['numberArray'].min).toEqual(0);\n expect(stats['numberArray'].max).toEqual(729);\n tf.test_util.expectNumbersClose(\n stats['numberArray'].mean, 78.50000066757202);\n tf.test_util.expectNumbersClose(\n stats['numberArray'].variance, 26971.849851671857, 0.1);\n tf.test_util.expectNumbersClose(\n stats['numberArray'].stddev, 164.2310867396056);\n\n expect(stats['Tensor'].min).toEqual(0);\n expect(stats['Tensor'].max).toEqual(729);\n tf.test_util.expectNumbersClose(stats['Tensor'].mean, 78.50000066757202);\n tf.test_util.expectNumbersClose(\n stats['Tensor'].variance, 26971.849851671857, 0.1);\n tf.test_util.expectNumbersClose(\n stats['Tensor'].stddev, 164.2310867396056);\n });\n\n it('variance should be NaN if there is only one element', async () => {\n const ds = new TestDataset().take(1) as Dataset;\n const stats = await computeDatasetStatistics(ds);\n expect(stats['number'].min).toEqual(0);\n expect(stats['number'].max).toEqual(0);\n expect(stats['number'].mean).toEqual(0);\n expect(stats['number'].variance).toEqual(NaN);\n expect(stats['number'].stddev).toEqual(NaN);\n });\n});\n\ndescribeAllEnvs('scaleTo01', () => {\n it('scales numeric data to the [0, 1] interval', async () => {\n const ds = new TestDataset().skip(55) as Dataset;\n const scaleFn = scaleTo01(55, 99 * 99 * 99);\n const scaledDataset = ds.map(x => ({'Tensor': scaleFn(x['Tensor'])}));\n\n const stats = await computeDatasetStatistics(scaledDataset);\n expect(stats['Tensor'].min).toBeCloseTo(0);\n expect(stats['Tensor'].max).toBeCloseTo(1);\n });\n});\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/test_node.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/test_node.d.ts deleted file mode 100644 index 2f64cc32b..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/test_node.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import '@tensorflow/tfjs-backend-cpu'; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/test_node.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/test_node.js.map deleted file mode 100644 index da10c4036..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/test_node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test_node.js","sourceRoot":"","sources":["../src/test_node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,8BAA8B,CAAC;AACtC,iDAAiD;AACjD,OAAO,EAAC,WAAW,EAAC,MAAM,yCAAyC,CAAC;AAEpE,8CAA8C;AAC9C,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAEnC,OAAO,CAAC,EAAE,CAAC,oBAAoB,EAAE,CAAC,CAAC,EAAE;IACnC,MAAM,CAAC,CAAC;AACV,CAAC,CAAC,CAAC;AAEH,WAAW,CAAC,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAC,CAAC,CAAC,CAAC;AAElD,MAAM,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;AAC7B,MAAM,CAAC,UAAU,CAAC,EAAC,UAAU,EAAE,CAAC,kBAAkB,CAAC,EAAE,MAAM,EAAE,KAAK,EAAC,CAAC,CAAC;AACrE,MAAM,CAAC,OAAO,EAAE,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n * =============================================================================\n */\n\nimport '@tensorflow/tfjs-backend-cpu';\n// tslint:disable-next-line: no-imports-from-dist\nimport {setTestEnvs} from '@tensorflow/tfjs-core/dist/jasmine_util';\n\n// tslint:disable-next-line:no-require-imports\nconst jasmine = require('jasmine');\n\nprocess.on('unhandledRejection', e => {\n throw e;\n});\n\nsetTestEnvs([{name: 'node', backendName: 'cpu'}]);\n\nconst runner = new jasmine();\nrunner.loadConfig({spec_files: ['src/**/*_test.ts'], random: false});\nrunner.execute();\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.es2017.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.es2017.js deleted file mode 100644 index bd10e3421..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.es2017.js +++ /dev/null @@ -1,4668 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tensorflow/tfjs-core')) : - typeof define === 'function' && define.amd ? define(['exports', '@tensorflow/tfjs-core'], factory) : - (global = global || self, factory((global.tf = global.tf || {}, global.tf.data = global.tf.data || {}), global.tf)); -}(this, (function (exports, tf) { 'use strict'; - - var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - - function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; - } - - var alea = createCommonjsModule(function (module) { - // A port of an algorithm by Johannes Baagøe , 2010 - // http://baagoe.com/en/RandomMusings/javascript/ - // https://github.com/nquinlan/better-random-numbers-for-javascript-mirror - // Original work is under MIT license - - - // Copyright (C) 2010 by Johannes Baagøe - // - // Permission is hereby granted, free of charge, to any person obtaining a copy - // of this software and associated documentation files (the "Software"), to deal - // in the Software without restriction, including without limitation the rights - // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - // copies of the Software, and to permit persons to whom the Software is - // furnished to do so, subject to the following conditions: - // - // The above copyright notice and this permission notice shall be included in - // all copies or substantial portions of the Software. - // - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - // THE SOFTWARE. - - - - (function(global, module, define) { - - function Alea(seed) { - var me = this, mash = Mash(); - - me.next = function() { - var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32 - me.s0 = me.s1; - me.s1 = me.s2; - return me.s2 = t - (me.c = t | 0); - }; - - // Apply the seeding algorithm from Baagoe. - me.c = 1; - me.s0 = mash(' '); - me.s1 = mash(' '); - me.s2 = mash(' '); - me.s0 -= mash(seed); - if (me.s0 < 0) { me.s0 += 1; } - me.s1 -= mash(seed); - if (me.s1 < 0) { me.s1 += 1; } - me.s2 -= mash(seed); - if (me.s2 < 0) { me.s2 += 1; } - mash = null; - } - - function copy(f, t) { - t.c = f.c; - t.s0 = f.s0; - t.s1 = f.s1; - t.s2 = f.s2; - return t; - } - - function impl(seed, opts) { - var xg = new Alea(seed), - state = opts && opts.state, - prng = xg.next; - prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }; - prng.double = function() { - return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53 - }; - prng.quick = prng; - if (state) { - if (typeof(state) == 'object') copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; - } - - function Mash() { - var n = 0xefc8249d; - - var mash = function(data) { - data = data.toString(); - for (var i = 0; i < data.length; i++) { - n += data.charCodeAt(i); - var h = 0.02519603282416938 * n; - n = h >>> 0; - h -= n; - h *= n; - n = h >>> 0; - h -= n; - n += h * 0x100000000; // 2^32 - } - return (n >>> 0) * 2.3283064365386963e-10; // 2^-32 - }; - - return mash; - } - - - if (module && module.exports) { - module.exports = impl; - } else if (define && define.amd) { - define(function() { return impl; }); - } else { - this.alea = impl; - } - - })( - commonjsGlobal, - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader - ); - }); - - var xor128 = createCommonjsModule(function (module) { - // A Javascript implementaion of the "xor128" prng algorithm by - // George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper - - (function(global, module, define) { - - function XorGen(seed) { - var me = this, strseed = ''; - - me.x = 0; - me.y = 0; - me.z = 0; - me.w = 0; - - // Set up generator function. - me.next = function() { - var t = me.x ^ (me.x << 11); - me.x = me.y; - me.y = me.z; - me.z = me.w; - return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8); - }; - - if (seed === (seed | 0)) { - // Integer seed. - me.x = seed; - } else { - // String seed. - strseed += seed; - } - - // Mix in string seed, then discard an initial batch of 64 values. - for (var k = 0; k < strseed.length + 64; k++) { - me.x ^= strseed.charCodeAt(k) | 0; - me.next(); - } - } - - function copy(f, t) { - t.x = f.x; - t.y = f.y; - t.z = f.z; - t.w = f.w; - return t; - } - - function impl(seed, opts) { - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (typeof(state) == 'object') copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; - } - - if (module && module.exports) { - module.exports = impl; - } else if (define && define.amd) { - define(function() { return impl; }); - } else { - this.xor128 = impl; - } - - })( - commonjsGlobal, - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader - ); - }); - - var xorwow = createCommonjsModule(function (module) { - // A Javascript implementaion of the "xorwow" prng algorithm by - // George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper - - (function(global, module, define) { - - function XorGen(seed) { - var me = this, strseed = ''; - - // Set up generator function. - me.next = function() { - var t = (me.x ^ (me.x >>> 2)); - me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v; - return (me.d = (me.d + 362437 | 0)) + - (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0; - }; - - me.x = 0; - me.y = 0; - me.z = 0; - me.w = 0; - me.v = 0; - - if (seed === (seed | 0)) { - // Integer seed. - me.x = seed; - } else { - // String seed. - strseed += seed; - } - - // Mix in string seed, then discard an initial batch of 64 values. - for (var k = 0; k < strseed.length + 64; k++) { - me.x ^= strseed.charCodeAt(k) | 0; - if (k == strseed.length) { - me.d = me.x << 10 ^ me.x >>> 4; - } - me.next(); - } - } - - function copy(f, t) { - t.x = f.x; - t.y = f.y; - t.z = f.z; - t.w = f.w; - t.v = f.v; - t.d = f.d; - return t; - } - - function impl(seed, opts) { - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (typeof(state) == 'object') copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; - } - - if (module && module.exports) { - module.exports = impl; - } else if (define && define.amd) { - define(function() { return impl; }); - } else { - this.xorwow = impl; - } - - })( - commonjsGlobal, - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader - ); - }); - - var xorshift7 = createCommonjsModule(function (module) { - // A Javascript implementaion of the "xorshift7" algorithm by - // François Panneton and Pierre L'ecuyer: - // "On the Xorgshift Random Number Generators" - // http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf - - (function(global, module, define) { - - function XorGen(seed) { - var me = this; - - // Set up generator function. - me.next = function() { - // Update xor generator. - var X = me.x, i = me.i, t, v; - t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24); - t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10); - t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3); - t = X[(i + 4) & 7]; v ^= t ^ (t << 7); - t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9); - X[i] = v; - me.i = (i + 1) & 7; - return v; - }; - - function init(me, seed) { - var j, w, X = []; - - if (seed === (seed | 0)) { - // Seed state array using a 32-bit integer. - w = X[0] = seed; - } else { - // Seed state using a string. - seed = '' + seed; - for (j = 0; j < seed.length; ++j) { - X[j & 7] = (X[j & 7] << 15) ^ - (seed.charCodeAt(j) + X[(j + 1) & 7] << 13); - } - } - // Enforce an array length of 8, not all zeroes. - while (X.length < 8) X.push(0); - for (j = 0; j < 8 && X[j] === 0; ++j); - if (j == 8) w = X[7] = -1; else w = X[j]; - - me.x = X; - me.i = 0; - - // Discard an initial 256 values. - for (j = 256; j > 0; --j) { - me.next(); - } - } - - init(me, seed); - } - - function copy(f, t) { - t.x = f.x.slice(); - t.i = f.i; - return t; - } - - function impl(seed, opts) { - if (seed == null) seed = +(new Date); - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (state.x) copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; - } - - if (module && module.exports) { - module.exports = impl; - } else if (define && define.amd) { - define(function() { return impl; }); - } else { - this.xorshift7 = impl; - } - - })( - commonjsGlobal, - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader - ); - }); - - var xor4096 = createCommonjsModule(function (module) { - // A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm. - // - // This fast non-cryptographic random number generator is designed for - // use in Monte-Carlo algorithms. It combines a long-period xorshift - // generator with a Weyl generator, and it passes all common batteries - // of stasticial tests for randomness while consuming only a few nanoseconds - // for each prng generated. For background on the generator, see Brent's - // paper: "Some long-period random number generators using shifts and xors." - // http://arxiv.org/pdf/1004.3115v1.pdf - // - // Usage: - // - // var xor4096 = require('xor4096'); - // random = xor4096(1); // Seed with int32 or string. - // assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits. - // assert.equal(random.int32(), 1806534897); // signed int32, 32 bits. - // - // For nonzero numeric keys, this impelementation provides a sequence - // identical to that by Brent's xorgens 3 implementaion in C. This - // implementation also provides for initalizing the generator with - // string seeds, or for saving and restoring the state of the generator. - // - // On Chrome, this prng benchmarks about 2.1 times slower than - // Javascript's built-in Math.random(). - - (function(global, module, define) { - - function XorGen(seed) { - var me = this; - - // Set up generator function. - me.next = function() { - var w = me.w, - X = me.X, i = me.i, t, v; - // Update Weyl generator. - me.w = w = (w + 0x61c88647) | 0; - // Update xor generator. - v = X[(i + 34) & 127]; - t = X[i = ((i + 1) & 127)]; - v ^= v << 13; - t ^= t << 17; - v ^= v >>> 15; - t ^= t >>> 12; - // Update Xor generator array state. - v = X[i] = v ^ t; - me.i = i; - // Result is the combination. - return (v + (w ^ (w >>> 16))) | 0; - }; - - function init(me, seed) { - var t, v, i, j, w, X = [], limit = 128; - if (seed === (seed | 0)) { - // Numeric seeds initialize v, which is used to generates X. - v = seed; - seed = null; - } else { - // String seeds are mixed into v and X one character at a time. - seed = seed + '\0'; - v = 0; - limit = Math.max(limit, seed.length); - } - // Initialize circular array and weyl value. - for (i = 0, j = -32; j < limit; ++j) { - // Put the unicode characters into the array, and shuffle them. - if (seed) v ^= seed.charCodeAt((j + 32) % seed.length); - // After 32 shuffles, take v as the starting w value. - if (j === 0) w = v; - v ^= v << 10; - v ^= v >>> 15; - v ^= v << 4; - v ^= v >>> 13; - if (j >= 0) { - w = (w + 0x61c88647) | 0; // Weyl. - t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array. - i = (0 == t) ? i + 1 : 0; // Count zeroes. - } - } - // We have detected all zeroes; make the key nonzero. - if (i >= 128) { - X[(seed && seed.length || 0) & 127] = -1; - } - // Run the generator 512 times to further mix the state before using it. - // Factoring this as a function slows the main generator, so it is just - // unrolled here. The weyl generator is not advanced while warming up. - i = 127; - for (j = 4 * 128; j > 0; --j) { - v = X[(i + 34) & 127]; - t = X[i = ((i + 1) & 127)]; - v ^= v << 13; - t ^= t << 17; - v ^= v >>> 15; - t ^= t >>> 12; - X[i] = v ^ t; - } - // Storing state as object members is faster than using closure variables. - me.w = w; - me.X = X; - me.i = i; - } - - init(me, seed); - } - - function copy(f, t) { - t.i = f.i; - t.w = f.w; - t.X = f.X.slice(); - return t; - } - function impl(seed, opts) { - if (seed == null) seed = +(new Date); - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (state.X) copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; - } - - if (module && module.exports) { - module.exports = impl; - } else if (define && define.amd) { - define(function() { return impl; }); - } else { - this.xor4096 = impl; - } - - })( - commonjsGlobal, // window object or global - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader - ); - }); - - var tychei = createCommonjsModule(function (module) { - // A Javascript implementaion of the "Tyche-i" prng algorithm by - // Samuel Neves and Filipe Araujo. - // See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf - - (function(global, module, define) { - - function XorGen(seed) { - var me = this, strseed = ''; - - // Set up generator function. - me.next = function() { - var b = me.b, c = me.c, d = me.d, a = me.a; - b = (b << 25) ^ (b >>> 7) ^ c; - c = (c - d) | 0; - d = (d << 24) ^ (d >>> 8) ^ a; - a = (a - b) | 0; - me.b = b = (b << 20) ^ (b >>> 12) ^ c; - me.c = c = (c - d) | 0; - me.d = (d << 16) ^ (c >>> 16) ^ a; - return me.a = (a - b) | 0; - }; - - /* The following is non-inverted tyche, which has better internal - * bit diffusion, but which is about 25% slower than tyche-i in JS. - me.next = function() { - var a = me.a, b = me.b, c = me.c, d = me.d; - a = (me.a + me.b | 0) >>> 0; - d = me.d ^ a; d = d << 16 ^ d >>> 16; - c = me.c + d | 0; - b = me.b ^ c; b = b << 12 ^ d >>> 20; - me.a = a = a + b | 0; - d = d ^ a; me.d = d = d << 8 ^ d >>> 24; - me.c = c = c + d | 0; - b = b ^ c; - return me.b = (b << 7 ^ b >>> 25); - } - */ - - me.a = 0; - me.b = 0; - me.c = 2654435769 | 0; - me.d = 1367130551; - - if (seed === Math.floor(seed)) { - // Integer seed. - me.a = (seed / 0x100000000) | 0; - me.b = seed | 0; - } else { - // String seed. - strseed += seed; - } - - // Mix in string seed, then discard an initial batch of 64 values. - for (var k = 0; k < strseed.length + 20; k++) { - me.b ^= strseed.charCodeAt(k) | 0; - me.next(); - } - } - - function copy(f, t) { - t.a = f.a; - t.b = f.b; - t.c = f.c; - t.d = f.d; - return t; - } - function impl(seed, opts) { - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (typeof(state) == 'object') copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; - } - - if (module && module.exports) { - module.exports = impl; - } else if (define && define.amd) { - define(function() { return impl; }); - } else { - this.tychei = impl; - } - - })( - commonjsGlobal, - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader - ); - }); - - var seedrandom = createCommonjsModule(function (module) { - /* - Copyright 2014 David Bau. - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - */ - - (function (pool, math) { - // - // The following constants are related to IEEE 754 limits. - // - var global = this, - width = 256, // each RC4 output is 0 <= x < 256 - chunks = 6, // at least six RC4 outputs for each double - digits = 52, // there are 52 significant digits in a double - rngname = 'random', // rngname: name for Math.random and Math.seedrandom - startdenom = math.pow(width, chunks), - significance = math.pow(2, digits), - overflow = significance * 2, - mask = width - 1, - nodecrypto; // node.js crypto module, initialized at the bottom. - - // - // seedrandom() - // This is the seedrandom function described above. - // - function seedrandom(seed, options, callback) { - var key = []; - options = (options == true) ? { entropy: true } : (options || {}); - - // Flatten the seed string or build one from local entropy if needed. - var shortseed = mixkey(flatten( - options.entropy ? [seed, tostring(pool)] : - (seed == null) ? autoseed() : seed, 3), key); - - // Use the seed to initialize an ARC4 generator. - var arc4 = new ARC4(key); - - // This function returns a random double in [0, 1) that contains - // randomness in every bit of the mantissa of the IEEE 754 value. - var prng = function() { - var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48 - d = startdenom, // and denominator d = 2 ^ 48. - x = 0; // and no 'extra last byte'. - while (n < significance) { // Fill up all significant digits by - n = (n + x) * width; // shifting numerator and - d *= width; // denominator and generating a - x = arc4.g(1); // new least-significant-byte. - } - while (n >= overflow) { // To avoid rounding up, before adding - n /= 2; // last byte, shift everything - d /= 2; // right using integer math until - x >>>= 1; // we have exactly the desired bits. - } - return (n + x) / d; // Form the number within [0, 1). - }; - - prng.int32 = function() { return arc4.g(4) | 0; }; - prng.quick = function() { return arc4.g(4) / 0x100000000; }; - prng.double = prng; - - // Mix the randomness into accumulated entropy. - mixkey(tostring(arc4.S), pool); - - // Calling convention: what to return as a function of prng, seed, is_math. - return (options.pass || callback || - function(prng, seed, is_math_call, state) { - if (state) { - // Load the arc4 state from the given state if it has an S array. - if (state.S) { copy(state, arc4); } - // Only provide the .state method if requested via options.state. - prng.state = function() { return copy(arc4, {}); }; - } - - // If called as a method of Math (Math.seedrandom()), mutate - // Math.random because that is how seedrandom.js has worked since v1.0. - if (is_math_call) { math[rngname] = prng; return seed; } - - // Otherwise, it is a newer calling convention, so return the - // prng directly. - else return prng; - })( - prng, - shortseed, - 'global' in options ? options.global : (this == math), - options.state); - } - math['seed' + rngname] = seedrandom; - - // - // ARC4 - // - // An ARC4 implementation. The constructor takes a key in the form of - // an array of at most (width) integers that should be 0 <= x < (width). - // - // The g(count) method returns a pseudorandom integer that concatenates - // the next (count) outputs from ARC4. Its return value is a number x - // that is in the range 0 <= x < (width ^ count). - // - function ARC4(key) { - var t, keylen = key.length, - me = this, i = 0, j = me.i = me.j = 0, s = me.S = []; - - // The empty key [] is treated as [0]. - if (!keylen) { key = [keylen++]; } - - // Set up S using the standard key scheduling algorithm. - while (i < width) { - s[i] = i++; - } - for (i = 0; i < width; i++) { - s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))]; - s[j] = t; - } - - // The "g" method returns the next (count) outputs as one number. - (me.g = function(count) { - // Using instance members instead of closure state nearly doubles speed. - var t, r = 0, - i = me.i, j = me.j, s = me.S; - while (count--) { - t = s[i = mask & (i + 1)]; - r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))]; - } - me.i = i; me.j = j; - return r; - // For robust unpredictability, the function call below automatically - // discards an initial batch of values. This is called RC4-drop[256]. - // See http://google.com/search?q=rsa+fluhrer+response&btnI - })(width); - } - - // - // copy() - // Copies internal state of ARC4 to or from a plain object. - // - function copy(f, t) { - t.i = f.i; - t.j = f.j; - t.S = f.S.slice(); - return t; - } - // - // flatten() - // Converts an object tree to nested arrays of strings. - // - function flatten(obj, depth) { - var result = [], typ = (typeof obj), prop; - if (depth && typ == 'object') { - for (prop in obj) { - try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {} - } - } - return (result.length ? result : typ == 'string' ? obj : obj + '\0'); - } - - // - // mixkey() - // Mixes a string seed into a key that is an array of integers, and - // returns a shortened string seed that is equivalent to the result key. - // - function mixkey(seed, key) { - var stringseed = seed + '', smear, j = 0; - while (j < stringseed.length) { - key[mask & j] = - mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++)); - } - return tostring(key); - } - - // - // autoseed() - // Returns an object for autoseeding, using window.crypto and Node crypto - // module if available. - // - function autoseed() { - try { - var out; - if (nodecrypto && (out = nodecrypto.randomBytes)) { - // The use of 'out' to remember randomBytes makes tight minified code. - out = out(width); - } else { - out = new Uint8Array(width); - (global.crypto || global.msCrypto).getRandomValues(out); - } - return tostring(out); - } catch (e) { - var browser = global.navigator, - plugins = browser && browser.plugins; - return [+new Date, global, plugins, global.screen, tostring(pool)]; - } - } - - // - // tostring() - // Converts an array of charcodes to a string - // - function tostring(a) { - return String.fromCharCode.apply(0, a); - } - - // - // When seedrandom.js is loaded, we immediately mix a few bits - // from the built-in RNG into the entropy pool. Because we do - // not want to interfere with deterministic PRNG state later, - // seedrandom will not call math.random on its own again after - // initialization. - // - mixkey(math.random(), pool); - - // - // Nodejs and AMD support: export the implementation as a module using - // either convention. - // - if ( module.exports) { - module.exports = seedrandom; - // When in node.js, try using crypto package for autoseeding. - try { - nodecrypto = require('crypto'); - } catch (ex) {} - } - - // End anonymous scope, and pass initial values. - })( - [], // pool: entropy pool starts empty - Math // math: package containing random, pow, and seedrandom - ); - }); - - // A library of seedable RNGs implemented in Javascript. - // - // Usage: - // - // var seedrandom = require('seedrandom'); - // var random = seedrandom(1); // or any seed. - // var x = random(); // 0 <= x < 1. Every bit is random. - // var x = random.quick(); // 0 <= x < 1. 32 bits of randomness. - - // alea, a 53-bit multiply-with-carry generator by Johannes Baagøe. - // Period: ~2^116 - // Reported to pass all BigCrush tests. - - - // xor128, a pure xor-shift generator by George Marsaglia. - // Period: 2^128-1. - // Reported to fail: MatrixRank and LinearComp. - - - // xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl. - // Period: 2^192-2^32 - // Reported to fail: CollisionOver, SimpPoker, and LinearComp. - - - // xorshift7, by François Panneton and Pierre L'ecuyer, takes - // a different approach: it adds robustness by allowing more shifts - // than Marsaglia's original three. It is a 7-shift generator - // with 256 bits, that passes BigCrush with no systmatic failures. - // Period 2^256-1. - // No systematic BigCrush failures reported. - - - // xor4096, by Richard Brent, is a 4096-bit xor-shift with a - // very long period that also adds a Weyl generator. It also passes - // BigCrush with no systematic failures. Its long period may - // be useful if you have many generators and need to avoid - // collisions. - // Period: 2^4128-2^32. - // No systematic BigCrush failures reported. - - - // Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random - // number generator derived from ChaCha, a modern stream cipher. - // https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf - // Period: ~2^127 - // No systematic BigCrush failures reported. - - - // The original ARC4-based prng included in this library. - // Period: ~2^1600 - - - seedrandom.alea = alea; - seedrandom.xor128 = xor128; - seedrandom.xorwow = xorwow; - seedrandom.xorshift7 = xorshift7; - seedrandom.xor4096 = xor4096; - seedrandom.tychei = tychei; - - var seedrandom$1 = seedrandom; - var seedrandom_1 = seedrandom$1.alea; - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /** - * Apply a mapping function to a nested structure in a recursive manner. - * - * The result of the mapping is an object with the same nested structure (i.e., - * of arrays and dicts) as the input, except that some subtrees are replaced, - * according to the results of the mapping function. - * - * Mappings are memoized. Thus, if the nested structure contains the same - * object in multiple positions, the output will contain the same mapped object - * in those positions. Cycles are not supported, however. - * - * @param input: The object to which to apply the mapping function. - * @param mapFn: A function that expects a single node of the object tree, and - * returns a `DeepMapResult`. The `DeepMapResult` either provides a - * replacement value for that node (i.e., replacing the subtree), or indicates - * that the node should be processed recursively. - */ - function deepMap(input, mapFn) { - return deepMapInternal(input, mapFn); - } - /** - * @param seen: A Map of known object mappings (i.e., memoized results of - * `mapFn()`) - * @param containedIn: An set containing objects on the reference path currently - * being processed (used to detect cycles). - */ - function deepMapInternal(input, mapFn, seen = new Map(), containedIn = new Set()) { - if (input == null) { - return null; - } - if (containedIn.has(input)) { - throw new Error('Circular references are not supported.'); - } - if (seen.has(input)) { - return seen.get(input); - } - const result = mapFn(input); - if (result.recurse && result.value !== null) { - throw new Error('A deep map function may not return both a value and recurse=true.'); - } - if (!result.recurse) { - seen.set(input, result.value); - return result.value; - } - else if (isIterable(input)) { - // tslint:disable-next-line:no-any - const mappedIterable = Array.isArray(input) ? [] : {}; - containedIn.add(input); - for (const k in input) { - const child = input[k]; - const childResult = deepMapInternal(child, mapFn, seen, containedIn); - mappedIterable[k] = childResult; - } - containedIn.delete(input); - return mappedIterable; - } - else { - throw new Error(`Can't recurse into non-iterable type: ${input}`); - } - } - // TODO(soergel, kangyizhang) Reconsider naming of deepZip() to avoid confusion - // with zip() - /** - * Zip nested structures together in a recursive manner. - * - * This has the effect of transposing or pivoting data, e.g. converting it from - * a row-major representation to a column-major representation. - * - * For example, `deepZip([{a: 1, b: 2}, {a: 3, b: 4}])` returns - * `{a: [1, 3], b: [2, 4]}`. - * - * The inputs should all have the same nested structure (i.e., of arrays and - * dicts). The result is a single object with the same nested structure, where - * the leaves are arrays collecting the values of the inputs at that location - * (or, optionally, the result of a custom function applied to those arrays). - * - * @param inputs: An array of the objects to zip together. - * @param zipFn: (optional) A function that expects an array of elements at a - * single node of the object tree, and returns a `DeepMapResult`. The - * `DeepMapResult` either provides a result value for that node (i.e., - * representing the subtree), or indicates that the node should be processed - * recursively. The default zipFn recurses as far as possible and places - * arrays at the leaves. - */ - function deepZip(inputs, zipFn = zipToList) { - return deepZipInternal(inputs, zipFn); - } - /** - * @param containedIn: An set containing objects on the reference path currently - * being processed (used to detect cycles). - */ - function deepZipInternal(inputs, zipFn, containedIn = new Set()) { - // The recursion follows the structure of input 0; it's assumed that all the - // other inputs have the same structure. - const input = inputs[0]; - if (containedIn.has(input)) { - throw new Error('Circular references are not supported.'); - } - const result = zipFn(inputs); - if (result.recurse && result.value !== null) { - throw new Error('A deep zip function may not return both a value and recurse=true.'); - } - if (!result.recurse) { - return result.value; - } - else if (isIterable(input)) { - // tslint:disable-next-line:no-any - const mappedIterable = Array.isArray(input) ? [] : {}; - containedIn.add(input); - for (const k in input) { - const children = inputs.map(x => x[k]); - const childResult = deepZipInternal(children, zipFn, containedIn); - mappedIterable[k] = childResult; - } - containedIn.delete(input); - return mappedIterable; - } - else { - throw new Error(`Can't recurse into non-iterable type: ${input}`); - } - } - // tslint:disable-next-line:no-any - function zipToList(x) { - if (x === null) { - return null; - } - // TODO(soergel): validate array type? - if (isIterable(x[0])) { - return { value: null, recurse: true }; - } - else { - return { value: x, recurse: false }; - } - } - /** - * Apply an async mapping function to a nested structure in a recursive manner. - * - * This first creates a nested structure of Promises, and then awaits all of - * those, resulting in a single Promise for a resolved nested structure. - * - * The result of the mapping is an object with the same nested structure (i.e., - * of arrays and dicts) as the input, except that some subtrees are replaced, - * according to the results of the mapping function. - * - * Mappings are memoized. Thus, if the nested structure contains the same - * object in multiple positions, the output will contain the same mapped object - * in those positions. Cycles are not supported, however. - * - * @param input: The object to which to apply the mapping function. - * @param mapFn: A function that expects a single node of the object tree, and - * returns a `DeepMapAsyncResult`. The `DeepMapAsyncResult` either provides - * a `Promise` for a replacement value for that node (i.e., replacing the - * subtree), or indicates that the node should be processed recursively. Note - * that the decision whether or not to recurse must be made immediately; only - * the mapped value may be promised. - */ - async function deepMapAndAwaitAll(input, mapFn) { - const seen = new Map(); - // First do a normal deepMap, collecting Promises in 'seen' as a side effect. - deepMapInternal(input, mapFn, seen); - // Replace the Promises in 'seen' in place. - // Note TypeScript provides no async map iteration, and regular map iteration - // is broken too, so sadly we have to do Array.from() to make it work. - // (There's no advantage to Promise.all(), and that would be tricky anyway.) - for (const key of Array.from(seen.keys())) { - const value = seen.get(key); - if (tf.util.isPromise(value)) { - const mappedValue = await value; - seen.set(key, mappedValue); - } - } - // Normal deepMap again, this time filling in the resolved values. - // It's unfortunate that we have to do two passes. - // TODO(soergel): test performance and think harder about a fast solution. - const result = deepMapInternal(input, mapFn, seen); - return result; - } - /** - * Determine whether the argument is iterable. - * - * @returns true if the argument is an array or any non-Tensor object. - */ - // tslint:disable-next-line:no-any - function isIterable(obj) { - return obj != null && (!ArrayBuffer.isView(obj)) && - (Array.isArray(obj) || - (typeof obj === 'object' && !(obj instanceof tf.Tensor))); - } - /** - * Determine whether the argument can be converted to Tensor. - * - * Tensors, primitives, arrays, and TypedArrays all qualify; anything else does - * not. - * - * @returns true if the argument can be converted to Tensor. - */ - // tslint:disable-next-line:no-any - function canTensorify(obj) { - return obj == null || isPrimitive(obj) || Array.isArray(obj) || - (typeof obj === 'object' && (obj instanceof tf.Tensor)) || - tf.util.isTypedArray(obj); - } - /** - * Returns true if the given `value` is a primitive type. Otherwise returns - * false. This is equivalant to node util.isPrimitive - */ - function isPrimitive(value) { - return (value === null || - (typeof value !== 'object' && typeof value !== 'function')); - } - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - function deepClone(container) { - return deepMap(container, cloneIfTensor); - } - // tslint:disable-next-line: no-any - function cloneIfTensor(item) { - if (item instanceof tf.Tensor) { - return ({ value: item.clone(), recurse: false }); - } - else if (isIterable(item)) { - return { value: null, recurse: true }; - } - else { - return { value: item, recurse: false }; - } - } - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /** - * A ring buffer, providing O(1) FIFO, LIFO, and related operations. - */ - class RingBuffer { - /** - * Constructs a `RingBuffer`. - * @param capacity The number of items that the buffer can accomodate. - */ - constructor(capacity) { - this.capacity = capacity; - // Note we store the indices in the range 0 <= index < 2*capacity. - // This allows us to distinguish the full from the empty case. - // See https://www.snellman.net/blog/archive/2016-12-13-ring-buffers/ - this.begin = 0; // inclusive - this.end = 0; // exclusive - if (capacity == null) { - throw new RangeError('Can\'t create a ring buffer of unknown capacity.'); - } - if (capacity < 1) { - throw new RangeError('Can\'t create ring buffer of capacity < 1.'); - } - this.data = new Array(capacity); - this.doubledCapacity = 2 * capacity; - } - /** - * Map any index into the range 0 <= index < 2*capacity. - */ - wrap(index) { - // don't trust % on negative numbers - while (index < 0) { - index += this.doubledCapacity; - } - return index % this.doubledCapacity; - } - get(index) { - if (index < 0) { - throw new RangeError('Can\'t get item at a negative index.'); - } - return this.data[index % this.capacity]; - } - set(index, value) { - if (index < 0) { - throw new RangeError('Can\'t set item at a negative index.'); - } - this.data[index % this.capacity] = value; - } - /** - * Returns the current number of items in the buffer. - */ - length() { - let length = this.end - this.begin; - if (length < 0) { - length = this.doubledCapacity + length; - } - return length; - } - /** - * Reports whether the buffer is full. - * @returns true if the number of items in the buffer equals its capacity, and - * false otherwise. - */ - isFull() { - return this.length() === this.capacity; - } - /** - * Reports whether the buffer is empty. - * @returns true if the number of items in the buffer equals zero, and - * false otherwise. - */ - isEmpty() { - return this.length() === 0; - } - /** - * Adds an item to the end of the buffer. - */ - push(value) { - if (this.isFull()) { - throw new RangeError('Ring buffer is full.'); - } - this.set(this.end, value); - this.end = this.wrap(this.end + 1); - } - /** - * Adds many items to the end of the buffer, in order. - */ - pushAll(values) { - for (const value of values) { - this.push(value); - } - } - /** - * Removes and returns the last item in the buffer. - */ - pop() { - if (this.isEmpty()) { - throw new RangeError('Ring buffer is empty.'); - } - this.end = this.wrap(this.end - 1); - const result = this.get(this.end); - this.set(this.end, undefined); - return result; - } - /** - * Adds an item to the beginning of the buffer. - */ - unshift(value) { - if (this.isFull()) { - throw new RangeError('Ring buffer is full.'); - } - this.begin = this.wrap(this.begin - 1); - this.set(this.begin, value); - } - /** - * Removes and returns the first item in the buffer. - */ - shift() { - if (this.isEmpty()) { - throw new RangeError('Ring buffer is empty.'); - } - const result = this.get(this.begin); - this.set(this.begin, undefined); - this.begin = this.wrap(this.begin + 1); - return result; - } - /** - * Removes and returns a specific item in the buffer, and moves the last item - * to the vacated slot. This is useful for implementing a shuffling stream. - * Note that this operation necessarily scrambles the original order. - * - * @param relativeIndex: the index of the item to remove, relative to the - * first item in the buffer (e.g., hiding the ring nature of the underlying - * storage). - */ - shuffleExcise(relativeIndex) { - if (this.isEmpty()) { - throw new RangeError('Ring buffer is empty.'); - } - const index = this.wrap(this.begin + relativeIndex); - const result = this.get(index); - this.set(index, this.pop()); - return result; - } - } - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - class GrowingRingBuffer extends RingBuffer { - /** - * Constructs a `GrowingRingBuffer`. - */ - constructor() { - super(GrowingRingBuffer.INITIAL_CAPACITY); - } - isFull() { - return false; - } - push(value) { - if (super.isFull()) { - this.expand(); - } - super.push(value); - } - unshift(value) { - if (super.isFull()) { - this.expand(); - } - super.unshift(value); - } - /** - * Doubles the capacity of the buffer. - */ - expand() { - const newCapacity = this.capacity * 2; - const newData = new Array(newCapacity); - const len = this.length(); - // Rotate the buffer to start at index 0 again, since we can't just - // allocate more space at the end. - for (let i = 0; i < len; i++) { - newData[i] = this.get(this.wrap(this.begin + i)); - } - this.data = newData; - this.capacity = newCapacity; - this.doubledCapacity = 2 * this.capacity; - this.begin = 0; - this.end = len; - } - } - GrowingRingBuffer.INITIAL_CAPACITY = 32; - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - // Here we implement a simple asynchronous iterator. - // This lets us avoid using either third-party stream libraries or - // recent TypeScript language support requiring polyfills. - /** - * Create a `LazyIterator` from an array of items. - */ - function iteratorFromItems(items) { - return new ArrayIterator(items); - } - /** - * Create a `LazyIterator` from a function. - * - * ```js - * let i = -1; - * const func = () => - * ++i < 5 ? {value: i, done: false} : {value: null, done: true}; - * const iter = tf.data.iteratorFromFunction(func); - * await iter.forEachAsync(e => console.log(e)); - * ``` - * - * @param func A function that produces data on each call. - */ - function iteratorFromFunction(func) { - return new FunctionCallIterator(func); - } - /** - * Create a `LazyIterator` by concatenating underlying streams, which are - * themselves provided as a stream. - * - * This can also be thought of as a "stream flatten" operation. - * - * @param baseIterators A stream of streams to be concatenated. - * @param baseErrorHandler An optional function that can intercept `Error`s - * raised during a `next()` call on the base stream. This function can decide - * whether the error should be propagated, whether the error should be - * ignored, or whether the base stream should be terminated. - */ - function iteratorFromConcatenated(baseIterators, baseErrorHandler) { - return new ChainedIterator(baseIterators, baseErrorHandler); - } - /** - * Create a `LazyIterator` by zipping together an array, dict, or nested - * structure of `LazyIterator`s (and perhaps additional constants). - * - * The underlying streams must provide elements in a consistent order such - * that they correspond. - * - * Typically, the underlying streams should have the same number of - * elements. If they do not, the behavior is determined by the - * `mismatchMode` argument. - * - * The nested structure of the `iterators` argument determines the - * structure of elements in the resulting iterator. - * - * @param iterators: An array or object containing LazyIterators at the - * leaves. - * @param mismatchMode: Determines what to do when one underlying iterator - * is exhausted before the others. `ZipMismatchMode.FAIL` (the default) - * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST` - * causes the zipped iterator to terminate with the furst underlying - * streams, so elements remaining on the longer streams are ignored. - * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling - * in nulls for the exhausted streams, until all streams are exhausted. - */ - function iteratorFromZipped(iterators, mismatchMode = ZipMismatchMode.FAIL) { - return new ZipIterator(iterators, mismatchMode); - } - /** - * An asynchronous iterator, providing lazy access to a potentially - * unbounded stream of elements. - * - * Iterator can be obtained from a dataset: - * `const iter = await dataset.iterator();` - */ - class LazyIterator { - /** - * Collect all remaining elements of a bounded stream into an array. - * Obviously this will succeed only for small streams that fit in memory. - * Useful for testing. - * - * @returns A Promise for an array of stream elements, which will resolve - * when the stream is exhausted. - */ - async toArray() { - const result = []; - let x = await this.next(); - while (!x.done) { - result.push(x.value); - x = await this.next(); - } - 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). - * - * @returns A Promise for an array of stream elements, which will resolve - * when the stream is exhausted. - */ - async toArrayForTest() { - const stream = this.prefetch(100); - const result = []; - let x = await stream.next(); - while (!x.done) { - result.push(x.value); - x = await stream.next(); - } - return result; - } - /** - * Draw items from the stream until it is exhausted. - * - * This can be useful when the stream has side effects but no output. In - * that case, calling this function guarantees that the stream will be - * fully processed. - */ - async resolveFully() { - let x = await this.next(); - while (!x.done) { - x = await this.next(); - } - } - /** - * Draw items from the stream until it is exhausted, or a predicate fails. - * - * This can be useful when the stream has side effects but no output. In - * that case, calling this function guarantees that the stream will be - * fully processed. - */ - async resolveWhile(predicate) { - let x = await this.next(); - let shouldContinue = predicate(x.value); - while ((!x.done) && shouldContinue) { - x = await this.next(); - shouldContinue = predicate(x.value); - } - } - /** - * Handles errors thrown on this stream using a provided handler function. - * - * @param handler A function that handles any `Error` thrown during a `next()` - * call and returns true if the stream should continue (dropping the failed - * call) or false if the stream should quietly terminate. If the handler - * itself throws (or rethrows) an `Error`, that will be propagated. - * - * @returns A `LazyIterator` of elements passed through from upstream, - * possibly filtering or terminating on upstream `next()` calls that - * throw an `Error`. - */ - handleErrors(handler) { - return new ErrorHandlingLazyIterator(this, handler); - } - // TODO(soergel): Implement reduce() etc. - /** - * Filters this stream according to `predicate`. - * - * @param predicate A function mapping a stream element to a boolean or a - * `Promise` for one. - * - * @returns A `LazyIterator` of elements for which the predicate was true. - */ - filter(predicate) { - return new FilterIterator(this, predicate); - } - /** - * Maps this stream through a 1-to-1 transform. - * - * @param transform A function mapping a stream element to a transformed - * element. - * - * @returns A `LazyIterator` of transformed elements. - */ - map(transform) { - return new MapIterator(this, transform); - } - /** - * Maps this stream through an async 1-to-1 transform. - * - * @param transform A function mapping a stream element to a `Promise` for a - * transformed stream element. - * - * @returns A `LazyIterator` of transformed elements. - */ - mapAsync(transform) { - return new AsyncMapIterator(this, transform); - } - /** - * Maps this stream through a 1-to-1 transform, forcing serial execution. - * - * @param transform A function mapping a stream element to a transformed - * element. - * - * @returns A `LazyIterator` of transformed elements. - */ - serialMapAsync(transform) { - return new AsyncMapIterator(this, transform).serial(); - } - /** - * Maps this stream through a 1-to-many transform. - * - * @param transform A function mapping a stream element to an array of - * transformed elements. - * - * @returns A `DataStream` of transformed elements. - */ - flatmap(transform) { - return new FlatmapIterator(this, transform); - } - /** - * Apply a function to every element of the stream. - * - * @param f A function to apply to each stream element. - */ - async forEachAsync(f) { - return this.map(f).resolveFully(); - } - /** - * Apply a function to every element of the stream, forcing serial execution. - * - * @param f A function to apply to each stream element. Should return 'true' - * to indicate that the stream should continue, or 'false' to cause it to - * terminate. - */ - async serialForEach(f) { - return this.serialMapAsync(f).resolveWhile(x => (x === true)); - } - /** - * Groups elements into batches, represented as arrays of elements. - * - * We can think of the elements of this iterator as 'rows' (even if they are - * nested structures). By the same token, consecutive values for a given - * key within the elements form a 'column'. This matches the usual sense of - * 'row' and 'column' when processing tabular data (e.g., parsing a CSV). - * - * Thus, "Row-major" means that the resulting batch is simply a collection of - * rows: `[row1, row2, row3, ...]`. This is contrast to the column-major - * form, which is needed for vectorized computation. - * - * @param batchSize The number of elements desired per batch. - * @param smallLastBatch Whether to emit the final batch when it has fewer - * than batchSize elements. Default true. - * @returns A `LazyIterator` of batches of elements, represented as arrays - * of the original element type. - */ - rowMajorBatch(batchSize, smallLastBatch = true) { - return new RowMajorBatchIterator(this, batchSize, smallLastBatch); - } - /** - * Groups elements into batches, represented in column-major form. - * - * We can think of the elements of this iterator as 'rows' (even if they are - * nested structures). By the same token, consecutive values for a given - * key within the elements form a 'column'. This matches the usual sense of - * 'row' and 'column' when processing tabular data (e.g., parsing a CSV). - * - * Thus, "column-major" means that the resulting batch is a (potentially - * nested) structure representing the columns. Each column entry, then, - * contains a collection of the values found in that column for a range of - * input elements. This representation allows for vectorized computation, in - * contrast to the row-major form. - * - * The inputs should all have the same nested structure (i.e., of arrays and - * dicts). The result is a single object with the same nested structure, - * where the leaves are arrays collecting the values of the inputs at that - * location (or, optionally, the result of a custom function applied to those - * arrays). - * - * @param batchSize The number of elements desired per batch. - * @param smallLastBatch Whether to emit the final batch when it has fewer - * than batchSize elements. Default true. - * @param zipFn: (optional) A function that expects an array of elements at a - * single node of the object tree, and returns a `DeepMapResult`. The - * `DeepMapResult` either provides a result value for that node (i.e., - * representing the subtree), or indicates that the node should be processed - * recursively. The default zipFn recurses as far as possible and places - * arrays at the leaves. - * @returns A `LazyIterator` of batches of elements, represented as an object - * with collections at the leaves. - */ - columnMajorBatch(batchSize, smallLastBatch = true, - // tslint:disable-next-line:no-any - zipFn = zipToList) { - // First collect the desired number of input elements as a row-major batch. - const rowBatches = this.rowMajorBatch(batchSize, smallLastBatch); - // Now 'rotate' or 'pivot' the data, collecting all values from each column - // in the batch (i.e., for each key within the elements) into an array. - return rowBatches.map(x => deepZip(x, zipFn)); - } - /** - * Concatenate this `LazyIterator` with another. - * - * @param iterator A `LazyIterator` to be concatenated onto this one. - * @param baseErrorHandler An optional function that can intercept `Error`s - * raised during a `next()` call on the base stream. This function can - * decide whether the error should be propagated, whether the error should - * be ignored, or whether the base stream should be terminated. - * @returns A `LazyIterator`. - */ - concatenate(iterator, baseErrorHandler) { - return new ChainedIterator(iteratorFromItems([this, iterator]), baseErrorHandler); - } - /** - * Limits this stream to return at most `count` items. - * - * @param count The maximum number of items to provide from the stream. If - * a negative or undefined value is given, the entire stream is returned - * unaltered. - */ - take(count) { - if (count < 0 || count == null) { - return this; - } - return new TakeIterator(this, count); - } - /** - * Skips the first `count` items in this stream. - * - * @param count The number of items to skip. If a negative or undefined - * value is given, the entire stream is returned unaltered. - */ - skip(count) { - if (count < 0 || count == null) { - return this; - } - return new SkipIterator(this, count); - } - /** - * Prefetch the first `bufferSize` items in this stream. - * - * Note this prefetches Promises, but makes no guarantees about when those - * Promises resolve. - * - * @param bufferSize: An integer specifying the number of elements to be - * prefetched. - */ - prefetch(bufferSize) { - return new PrefetchIterator(this, bufferSize); - } - // TODO(soergel): deep sharded shuffle, where supported - /** - * Randomly shuffles the elements of this stream. - * - * @param bufferSize: An integer specifying the number of elements from - * this stream from which the new stream will sample. - * @param seed: (Optional.) An integer specifying the random seed that - * will be used to create the distribution. - */ - shuffle(windowSize, seed) { - return new ShuffleIterator(this, windowSize, seed); - } - /** - * Force an iterator to execute serially: each next() call will await the - * prior one, so that they cannot execute concurrently. - */ - serial() { - return new SerialIterator(this); - } - } - // ============================================================================ - // The following private classes serve to implement the chainable methods - // on LazyIterator. Unfortunately they can't be placed in separate files, - // due to resulting trouble with circular imports. - // ============================================================================ - // Iterators that just extend LazyIterator directly - // ============================================================================ - class ArrayIterator extends LazyIterator { - constructor(items) { - super(); - this.items = items; - this.trav = 0; - } - summary() { - return `Array of ${this.items.length} items`; - } - async next() { - if (this.trav >= this.items.length) { - return { value: null, done: true }; - } - const item = this.items[this.trav]; - this.trav++; - return { value: deepClone(item), done: false }; - } - } - class FunctionCallIterator extends LazyIterator { - constructor(nextFn) { - super(); - this.nextFn = nextFn; - } - summary() { - return `Function call`; - } - async next() { - try { - return this.nextFn(); - } - catch (e) { - // Modify the error message but leave the stack trace intact - e.message = - `Error thrown while iterating through a dataset: ${e.message}`; - throw e; - } - } - } - class SerialIterator extends LazyIterator { - constructor(upstream) { - super(); - this.upstream = upstream; - this.lastRead = Promise.resolve({ value: null, done: false }); - } - summary() { - return `${this.upstream.summary()} -> Serial`; - } - async next() { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(() => this.serialNext()); - return this.lastRead; - } - async serialNext() { - return this.upstream.next(); - } - } - class SkipIterator extends LazyIterator { - constructor(upstream, maxCount) { - super(); - this.upstream = upstream; - this.maxCount = maxCount; - // Local state that should not be clobbered by out-of-order execution. - this.count = 0; - this.lastRead = Promise.resolve({ value: null, done: false }); - } - summary() { - return `${this.upstream.summary()} -> Skip`; - } - async next() { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(() => this.serialNext()); - return this.lastRead; - } - async serialNext() { - // TODO(soergel): consider tradeoffs of reading in parallel, eg. - // collecting next() promises in an Array and then waiting for - // Promise.all() of those. Benefit: pseudo-parallel execution. Drawback: - // maybe delayed GC. - while (this.count++ < this.maxCount) { - const skipped = await this.upstream.next(); - // short-circuit if upstream is already empty - if (skipped.done) { - return skipped; - } - tf.dispose(skipped.value); - } - return this.upstream.next(); - } - } - class TakeIterator extends LazyIterator { - constructor(upstream, maxCount) { - super(); - this.upstream = upstream; - this.maxCount = maxCount; - this.count = 0; - } - summary() { - return `${this.upstream.summary()} -> Take`; - } - async next() { - if (this.count++ >= this.maxCount) { - return { value: null, done: true }; - } - return this.upstream.next(); - } - } - // Note this batch just groups items into row-wise element arrays. - // Rotating these to a column-wise representation happens only at the dataset - // level. - class RowMajorBatchIterator extends LazyIterator { - constructor(upstream, batchSize, enableSmallLastBatch = true) { - super(); - this.upstream = upstream; - this.batchSize = batchSize; - this.enableSmallLastBatch = enableSmallLastBatch; - this.lastRead = Promise.resolve({ value: null, done: false }); - } - summary() { - return `${this.upstream.summary()} -> RowMajorBatch`; - } - async next() { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(() => this.serialNext()); - return this.lastRead; - } - async serialNext() { - const batch = []; - while (batch.length < this.batchSize) { - const item = await this.upstream.next(); - if (item.done) { - if (this.enableSmallLastBatch && batch.length > 0) { - return { value: batch, done: false }; - } - return { value: null, done: true }; - } - batch.push(item.value); - } - return { value: batch, done: false }; - } - } - class FilterIterator extends LazyIterator { - constructor(upstream, predicate) { - super(); - this.upstream = upstream; - this.predicate = predicate; - this.lastRead = Promise.resolve({ value: null, done: false }); - } - summary() { - return `${this.upstream.summary()} -> Filter`; - } - async next() { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(() => this.serialNext()); - return this.lastRead; - } - async serialNext() { - while (true) { - const item = await this.upstream.next(); - if (item.done || this.predicate(item.value)) { - return item; - } - tf.dispose(item.value); - } - } - } - class MapIterator extends LazyIterator { - constructor(upstream, transform) { - super(); - this.upstream = upstream; - this.transform = transform; - } - summary() { - return `${this.upstream.summary()} -> Map`; - } - async next() { - const item = await this.upstream.next(); - if (item.done) { - return { value: null, done: true }; - } - const inputTensors = tf.tensor_util.getTensorsInContainer(item.value); - // Careful: the transform may mutate the item in place. - // That's why we have to remember the input Tensors above, and then - // below dispose only those that were not passed through to the output. - // Note too that the transform function is responsible for tidying - // any intermediate Tensors. Here we are concerned only about the - // inputs. - const mapped = this.transform(item.value); - const outputTensors = tf.tensor_util.getTensorsInContainer(mapped); - // TODO(soergel) faster intersection - // TODO(soergel) move to tf.disposeExcept(in, out)? - for (const t of inputTensors) { - if (!tf.tensor_util.isTensorInList(t, outputTensors)) { - t.dispose(); - } - } - return { value: mapped, done: false }; - } - } - class ErrorHandlingLazyIterator extends LazyIterator { - constructor(upstream, handler) { - super(); - this.upstream = upstream; - this.handler = handler; - this.count = 0; - this.lastRead = Promise.resolve({ value: null, done: false }); - } - summary() { - return `${this.upstream.summary()} -> handleErrors`; - } - async next() { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(() => this.serialNext()); - return this.lastRead; - } - async serialNext() { - while (true) { - try { - return await this.upstream.next(); - } - catch (e) { - if (!this.handler(e)) { - return { value: null, done: true }; - } - // If the handler returns true, loop and fetch the next upstream item. - // If the upstream iterator throws an endless stream of errors, and if - // the handler says to ignore them, then we loop forever here. That is - // the correct behavior-- it's up to the handler to decide when to stop. - } - } - } - } - class AsyncMapIterator extends LazyIterator { - constructor(upstream, transform) { - super(); - this.upstream = upstream; - this.transform = transform; - } - summary() { - return `${this.upstream.summary()} -> AsyncMap`; - } - async next() { - const item = await this.upstream.next(); - if (item.done) { - return { value: null, done: true }; - } - const inputTensors = tf.tensor_util.getTensorsInContainer(item.value); - // Careful: the transform may mutate the item in place. - // That's why we have to remember the input Tensors above, and then - // below dispose only those that were not passed through to the output. - // Note too that the transform function is responsible for tidying - // any intermediate Tensors. Here we are concerned only about the - // inputs. - const mapped = await this.transform(item.value); - const outputTensors = tf.tensor_util.getTensorsInContainer(mapped); - // TODO(soergel) faster intersection - // TODO(soergel) move to tf.disposeExcept(in, out)? - for (const t of inputTensors) { - if (!tf.tensor_util.isTensorInList(t, outputTensors)) { - t.dispose(); - } - } - return { value: mapped, done: false }; - } - } - // Iterators that maintain a queue of pending items - // ============================================================================ - /** - * A base class for transforming streams that operate by maintaining an - * output queue of elements that are ready to return via next(). This is - * commonly required when the transformation is 1-to-many: A call to next() - * may trigger a call to the underlying stream, which will produce many - * mapped elements of this stream-- of which we need to return only one, so - * we have to queue the rest. - */ - class OneToManyIterator extends LazyIterator { - constructor() { - super(); - this.outputQueue = new GrowingRingBuffer(); - this.lastRead = Promise.resolve({ value: null, done: false }); - } - async next() { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(() => this.serialNext()); - return this.lastRead; - } - async serialNext() { - // Fetch so that the queue contains at least one item if possible. - // If the upstream source is exhausted, AND there are no items left in - // the output queue, then this stream is also exhausted. - while (this.outputQueue.length() === 0) { - // TODO(soergel): consider parallel reads. - if (!await this.pump()) { - return { value: null, done: true }; - } - } - return { value: this.outputQueue.shift(), done: false }; - } - } - class FlatmapIterator extends OneToManyIterator { - constructor(upstream, transform) { - super(); - this.upstream = upstream; - this.transform = transform; - } - summary() { - return `${this.upstream.summary()} -> Flatmap`; - } - async pump() { - const item = await this.upstream.next(); - if (item.done) { - return false; - } - const inputTensors = tf.tensor_util.getTensorsInContainer(item.value); - // Careful: the transform may mutate the item in place. - // that's why we have to remember the input Tensors above, and then - // below dispose only those that were not passed through to the output. - // Note too that the transform function is responsible for tidying any - // intermediate Tensors. Here we are concerned only about the inputs. - const mappedArray = this.transform(item.value); - const outputTensors = tf.tensor_util.getTensorsInContainer(mappedArray); - this.outputQueue.pushAll(mappedArray); - // TODO(soergel) faster intersection, and deduplicate outputTensors - // TODO(soergel) move to tf.disposeExcept(in, out)? - for (const t of inputTensors) { - if (!tf.tensor_util.isTensorInList(t, outputTensors)) { - t.dispose(); - } - } - return true; - } - } - /** - * Provides a `LazyIterator` that concatenates a stream of underlying - * streams. - * - * Doing this in a concurrency-safe way requires some trickery. In - * particular, we want this stream to return the elements from the - * underlying streams in the correct order according to when next() was - * called, even if the resulting Promises resolve in a different order. - */ - class ChainedIterator extends LazyIterator { - constructor(iterators, baseErrorHandler) { - super(); - this.baseErrorHandler = baseErrorHandler; - // Strict Promise execution order: - // a next() call may not even begin until the previous one completes. - this.lastRead = null; - // Local state that should not be clobbered by out-of-order execution. - this.iterator = null; - this.moreIterators = iterators; - } - summary() { - const upstreamSummaries = 'TODO: fill in upstream of chained summaries'; - return `${upstreamSummaries} -> Chained`; - } - async next() { - this.lastRead = this.readFromChain(this.lastRead); - return this.lastRead; - } - async readFromChain(lastRead) { - // Must await on the previous read since the previous read may have advanced - // the stream of streams, from which we need to read. - // This is unfortunate since we can't parallelize reads. Which means - // prefetching of chained streams is a no-op. - // One solution is to prefetch immediately upstream of this. - await lastRead; - if (this.iterator == null) { - const iteratorResult = await this.moreIterators.next(); - if (iteratorResult.done) { - // No more streams to stream from. - return { value: null, done: true }; - } - this.iterator = iteratorResult.value; - if (this.baseErrorHandler != null) { - this.iterator = this.iterator.handleErrors(this.baseErrorHandler); - } - } - const itemResult = await this.iterator.next(); - if (itemResult.done) { - this.iterator = null; - return this.readFromChain(lastRead); - } - return itemResult; - } - } - var ZipMismatchMode; - (function (ZipMismatchMode) { - ZipMismatchMode[ZipMismatchMode["FAIL"] = 0] = "FAIL"; - ZipMismatchMode[ZipMismatchMode["SHORTEST"] = 1] = "SHORTEST"; - ZipMismatchMode[ZipMismatchMode["LONGEST"] = 2] = "LONGEST"; // use nulls for exhausted streams; use up the longest stream. - })(ZipMismatchMode || (ZipMismatchMode = {})); - /** - * Provides a `LazyIterator` that zips together an array, dict, or nested - * structure of `LazyIterator`s (and perhaps additional constants). - * - * The underlying streams must provide elements in a consistent order such - * that they correspond. - * - * Typically, the underlying streams should have the same number of - * elements. If they do not, the behavior is determined by the - * `mismatchMode` argument. - * - * The nested structure of the `iterators` argument determines the - * structure of elements in the resulting iterator. - * - * Doing this in a concurrency-safe way requires some trickery. In - * particular, we want this stream to return the elements from the - * underlying streams in the correct order according to when next() was - * called, even if the resulting Promises resolve in a different order. - * - * @param iterators: An array or object containing LazyIterators at the - * leaves. - * @param mismatchMode: Determines what to do when one underlying iterator - * is exhausted before the others. `ZipMismatchMode.FAIL` (the default) - * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST` - * causes the zipped iterator to terminate with the furst underlying - * streams, so elements remaining on the longer streams are ignored. - * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling - * in nulls for the exhausted streams, until all streams are exhausted. - */ - class ZipIterator extends LazyIterator { - constructor(iterators, mismatchMode = ZipMismatchMode.FAIL) { - super(); - this.iterators = iterators; - this.mismatchMode = mismatchMode; - this.count = 0; - this.currentPromise = null; - } - summary() { - const upstreamSummaries = 'TODO: fill in upstream of zip summaries'; - return `{${upstreamSummaries}} -> Zip`; - } - async nextState(afterState) { - // This chaining ensures that the underlying next() are not even called - // before the previous ones have resolved. - await afterState; - // Collect underlying iterator "done" signals as a side effect in - // getNext() - let numIterators = 0; - let iteratorsDone = 0; - function getNext(container) { - if (container instanceof LazyIterator) { - const result = container.next(); - return { - value: result.then(x => { - numIterators++; - if (x.done) { - iteratorsDone++; - } - return x.value; - }), - recurse: false - }; - } - else { - return { value: null, recurse: true }; - } - } - const mapped = await deepMapAndAwaitAll(this.iterators, getNext); - if (numIterators === iteratorsDone) { - // The streams have all ended. - return { value: null, done: true }; - } - if (iteratorsDone > 0) { - switch (this.mismatchMode) { - case ZipMismatchMode.FAIL: - throw new Error('Zipped streams should have the same length. ' + - `Mismatched at element ${this.count}.`); - case ZipMismatchMode.SHORTEST: - return { value: null, done: true }; - case ZipMismatchMode.LONGEST: - // Continue. The exhausted streams already produced value: null. - } - } - this.count++; - return { value: mapped, done: false }; - } - async next() { - this.currentPromise = this.nextState(this.currentPromise); - return this.currentPromise; - } - } - // Iterators that maintain a ring buffer of pending promises - // ============================================================================ - /** - * A stream that prefetches a given number of items from an upstream source, - * returning them in FIFO order. - * - * Note this prefetches Promises, but makes no guarantees about when those - * Promises resolve. - */ - class PrefetchIterator extends LazyIterator { - constructor(upstream, bufferSize) { - super(); - this.upstream = upstream; - this.bufferSize = bufferSize; - this.buffer = new RingBuffer(bufferSize); - } - summary() { - return `${this.upstream.summary()} -> Prefetch`; - } - /** - * Refill the prefetch buffer. Returns only after the buffer is full, or - * the upstream source is exhausted. - */ - refill() { - while (!this.buffer.isFull()) { - const v = this.upstream.next(); - this.buffer.push(v); - } - } - next() { - this.refill(); - // This shift will never throw an error because the buffer is always - // full after a refill. If the stream is exhausted, the buffer will be - // full of Promises that will resolve to the end-of-stream signal. - return this.buffer.shift(); - } - } - /** - * A stream that performs a sliding-window random shuffle on an upstream - * source. This is like a `PrefetchIterator` except that the items are - * returned in randomized order. Mixing naturally improves as the buffer - * size increases. - */ - class ShuffleIterator extends PrefetchIterator { - constructor(upstream, windowSize, seed) { - super(upstream, windowSize); - this.upstream = upstream; - this.windowSize = windowSize; - // Local state that should not be clobbered by out-of-order execution. - this.upstreamExhausted = false; - this.random = seedrandom_1(seed || tf.util.now().toString()); - this.lastRead = Promise.resolve({ value: null, done: false }); - } - async next() { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(() => this.serialNext()); - return this.lastRead; - } - randomInt(max) { - return Math.floor(this.random() * max); - } - chooseIndex() { - return this.randomInt(this.buffer.length()); - } - async serialNext() { - // TODO(soergel): consider performance - if (!this.upstreamExhausted) { - this.refill(); - } - while (!this.buffer.isEmpty()) { - const chosenIndex = this.chooseIndex(); - const result = await this.buffer.shuffleExcise(chosenIndex); - if (result.done) { - this.upstreamExhausted = true; - } - else { - this.refill(); - return result; - } - } - return { value: null, done: true }; - } - } - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - // TODO(soergel): consider vectorized operations within the pipeline. - /** - * Represents a potentially large list of independent data elements (typically - * 'samples' or 'examples'). - * - * A 'data example' may be a primitive, an array, a map from string keys to - * values, or any nested structure of these. - * - * A `Dataset` represents an ordered collection of elements, together with a - * chain of transformations to be performed on those elements. Each - * transformation is a method of `Dataset` that returns another `Dataset`, so - * these may be chained, e.g. - * `const processedDataset = rawDataset.filter(...).map(...).batch(...)`. - * - * Data loading and transformation is done in a lazy, streaming fashion. The - * dataset may be iterated over multiple times; each iteration starts the data - * loading anew and recapitulates the transformations. - * - * A `Dataset` is typically processed as a stream of unbatched examples --i.e., - * its transformations are applied one example at a time. Batching produces a - * new `Dataset` where each element is a batch. Batching should usually come - * last in a pipeline, because data transformations are easier to express on a - * per-example basis than on a per-batch basis. - * - * The following code examples are calling `await dataset.forEachAsync(...)` to - * iterate once over the entire dataset in order to print out the data. - * - * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'} - */ - class Dataset { - constructor() { - this.size = null; - } - // TODO(soergel): Make Datasets report whether repeated iterator() calls - // produce the same result (e.g., reading from a file) or different results - // (e.g., from the webcam). Currently we don't make this distinction but it - // could be important for the user to know. - // abstract isDeterministic(): boolean; - /** - * Groups elements into batches. - * - * It is assumed that each of the incoming dataset elements has the same - * structure-- i.e. the same set of keys at each location in an object - * hierarchy. For each key, the resulting `Dataset` provides a batched - * element collecting all of the incoming values for that key. - * - * * Incoming primitives are grouped into a 1-D Tensor. - * * Incoming Tensors are grouped into a new Tensor where the 0'th axis is - * the batch dimension. - * * Incoming arrays are converted to Tensor and then batched. - * * A nested array is interpreted as an n-D Tensor, so the batched result - * has n+1 dimensions. - * * An array that cannot be converted to Tensor produces an error. - * - * If an array should not be batched as a unit, it should first be converted - * to an object with integer keys. - * - * Here are a few examples: - * - * Batch a dataset of numbers: - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8]).batch(4); - * await a.forEachAsync(e => e.print()); - * ``` - * - * Batch a dataset of arrays: - * ```js - * const b = tf.data.array([[1], [2], [3], [4], [5], [6], [7], [8]]).batch(4); - * await b.forEachAsync(e => e.print()); - * ``` - * - * Batch a dataset of objects: - * ```js - * const c = tf.data.array([{a: 1, b: 11}, {a: 2, b: 12}, {a: 3, b: 13}, - * {a: 4, b: 14}, {a: 5, b: 15}, {a: 6, b: 16}, {a: 7, b: 17}, - * {a: 8, b: 18}]).batch(4); - * await c.forEachAsync(e => { - * console.log('{'); - * for(var key in e) { - * console.log(key+':'); - * e[key].print(); - * } - * console.log('}'); - * }) - * ``` - * - * @param batchSize The number of elements desired per batch. - * @param smallLastBatch Whether to emit the final batch when it has fewer - * than batchSize elements. Default true. - * @returns A `Dataset`, from which a stream of batches can be obtained. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - batch(batchSize, smallLastBatch = true) { - const base = this; - tf.util.assert(batchSize > 0, () => `batchSize needs to be positive, but it is - ${batchSize}`); - let size; - if (this.size === Infinity || this.size == null) { - // If the size of this dataset is infinity or null, the new size keeps the - // same. - size = this.size; - } - else if (smallLastBatch) { - // If the size of this dataset is known and include small last batch, the - // new size is full batch count plus last batch. - size = Math.ceil(this.size / batchSize); - } - else { - // If the size of this dataset is known and not include small last batch, - // the new size is full batch count. - size = Math.floor(this.size / batchSize); - } - return datasetFromIteratorFn(async () => { - return (await base.iterator()) - .columnMajorBatch(batchSize, smallLastBatch, deepBatchConcat); - }, size); - } - /** - * Concatenates this `Dataset` with another. - * - * ```js - * const a = tf.data.array([1, 2, 3]); - * const b = tf.data.array([4, 5, 6]); - * const c = a.concatenate(b); - * await c.forEachAsync(e => console.log(e)); - * ``` - * - * @param dataset A `Dataset` to be concatenated onto this one. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - concatenate(dataset) { - const base = this; - let size; - if (this.size === Infinity || dataset.size === Infinity) { - // If the size of any of these two dataset is infinity, new size is - // infinity. - size = Infinity; - } - else if (this.size != null && dataset.size != null) { - // If the size of both datasets are known and not infinity, new size is - // sum the size of these two datasets. - size = this.size + dataset.size; - } - else { - // If neither of these two datasets has infinite size and any of these two - // datasets' size is null, the new size is null. - size = null; - } - return datasetFromIteratorFn(async () => (await base.iterator()).concatenate(await dataset.iterator()), size); - } - /** - * Filters this dataset according to `predicate`. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) - * .filter(x => x%2 === 0); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param predicate A function mapping a dataset element to a boolean or a - * `Promise` for one. - * - * @returns A `Dataset` of elements for which the predicate was true. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - filter(predicate) { - const base = this; - let size; - if (this.size === Infinity) { - // If the size of this dataset is infinity, new size is infinity - size = Infinity; - } - else { - // If this dataset has limited elements, new size is null because it might - // exhausted randomly. - size = null; - } - return datasetFromIteratorFn(async () => { - return (await base.iterator()).filter(x => tf.tidy(() => predicate(x))); - }, size); - } - /** - * Apply a function to every element of the dataset. - * - * After the function is applied to a dataset element, any Tensors contained - * within that element are disposed. - * - * ```js - * const a = tf.data.array([1, 2, 3]); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param f A function to apply to each dataset element. - * @returns A `Promise` that resolves after all elements have been processed. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - async forEachAsync(f) { - return (await this.iterator()).forEachAsync(f); - } - /** - * Maps this dataset through a 1-to-1 transform. - * - * ```js - * const a = tf.data.array([1, 2, 3]).map(x => x*x); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param transform A function mapping a dataset element to a transformed - * dataset element. - * - * @returns A `Dataset` of transformed elements. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - map(transform) { - const base = this; - return datasetFromIteratorFn(async () => { - return (await base.iterator()).map(x => tf.tidy(() => transform(x))); - }, this.size); - } - /** - * Maps this dataset through an async 1-to-1 transform. - * - * ```js - * const a = - * tf.data.array([1, 2, 3]).mapAsync(x => new Promise(function(resolve){ - * setTimeout(() => { - * resolve(x * x); - * }, Math.random()*1000 + 500); - * })); - * console.log(await a.toArray()); - * ``` - * - * @param transform A function mapping a dataset element to a `Promise` for a - * transformed dataset element. This transform is responsible for disposing - * any intermediate `Tensor`s, i.e. by wrapping its computation in - * `tf.tidy()`; that cannot be automated here (as it is in the synchronous - * `map()` case). - * - * @returns A `Dataset` of transformed elements. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - mapAsync(transform) { - const base = this; - return datasetFromIteratorFn(async () => { - return (await base.iterator()).mapAsync(transform); - }, this.size); - } - /** - * Creates a `Dataset` that prefetches elements from this dataset. - * - * @param bufferSize: An integer specifying the number of elements to be - * prefetched. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - prefetch(bufferSize) { - if (bufferSize == null) { - throw new RangeError('`Dataset.prefetch()` requires bufferSize to be specified.'); - } - const base = this; - return datasetFromIteratorFn(async () => (await base.iterator()).prefetch(bufferSize), this.size); - } - /** - * Repeats this dataset `count` times. - * - * NOTE: If this dataset is a function of global state (e.g. a random number - * generator), then different repetitions may produce different elements. - * - * ```js - * const a = tf.data.array([1, 2, 3]).repeat(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param count: (Optional) An integer, representing the number of times - * the dataset should be repeated. The default behavior (if `count` is - * `undefined` or negative) is for the dataset be repeated indefinitely. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - repeat(count) { - const base = this; - let size; - if (this.size != null && count > 0) { - // If this dataset has size and count is positive, new size is current - // size multiply count. This also covers the case that current size is - // infinity. - size = this.size * count; - } - else if (count === 0) { - // If count is 0, new size is 0. - size = 0; - } - else if (this.size != null && (count === undefined || count < 0)) { - // If this dataset has size and count is undefined or negative, the - // dataset will be repeated indefinitely and new size is infinity. - size = Infinity; - } - else { - // If the size of this dataset is null, the new dataset's size is null. - size = null; - } - return datasetFromIteratorFn(async () => { - const iteratorIterator = iteratorFromFunction(async () => ({ value: await base.iterator(), done: false })); - return iteratorFromConcatenated(iteratorIterator.take(count)); - }, size); - } - /** - * Creates a `Dataset` that skips `count` initial elements from this dataset. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]).skip(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param count: The number of elements of this dataset that should be skipped - * to form the new dataset. If `count` is greater than the size of this - * dataset, the new dataset will contain no elements. If `count` - * is `undefined` or negative, skips the entire dataset. - * - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - skip(count) { - const base = this; - let size; - if (this.size != null && count >= 0 && this.size >= count) { - // If the size of this dataset is greater than count, the new dataset's - // size is current size minus skipped size.This also covers the case that - // current size is infinity. - size = this.size - count; - } - else if (this.size != null && - (this.size < count || count === undefined || count < 0)) { - // If the size of this dataset is smaller than count, or count is - // undefined or negative, skips the entire dataset and the new size is 0. - size = 0; - } - else { - // If the size of this dataset is null, the new dataset's size is null. - size = null; - } - return datasetFromIteratorFn(async () => (await base.iterator()).skip(count), size); - } - /** - * Pseudorandomly shuffles the elements of this dataset. This is done in a - * streaming manner, by sampling from a given number of prefetched elements. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]).shuffle(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param bufferSize: An integer specifying the number of elements from this - * dataset from which the new dataset will sample. - * @param seed: (Optional) An integer specifying the random seed that will - * be used to create the distribution. - * @param reshuffleEachIteration: (Optional) A boolean, which if true - * indicates that the dataset should be pseudorandomly reshuffled each time - * it is iterated over. If false, elements will be returned in the same - * shuffled order on each iteration. (Defaults to `true`.) - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - shuffle(bufferSize, seed, reshuffleEachIteration = true) { - if (bufferSize == null || bufferSize < 0) { - if (this.size == null) { - throw new RangeError('`Dataset.shuffle()` requires bufferSize to be specified.'); - } - else { - throw new RangeError('`Dataset.shuffle()` requires bufferSize to be specified. ' + - 'If your data fits in main memory (for regular JS objects), ' + - 'and/or GPU memory (for `tf.Tensor`s), consider setting ' + - `bufferSize to the dataset size (${this.size} elements)`); - } - } - const base = this; - const random = seedrandom_1(seed || tf.util.now().toString()); - return datasetFromIteratorFn(async () => { - let seed2 = random.int32(); - if (reshuffleEachIteration) { - seed2 += random.int32(); - } - return (await base.iterator()).shuffle(bufferSize, seed2.toString()); - }, this.size); - } - /** - * Creates a `Dataset` with at most `count` initial elements from this - * dataset. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]).take(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param count: The number of elements of this dataset that should be taken - * to form the new dataset. If `count` is `undefined` or negative, or if - * `count` is greater than the size of this dataset, the new dataset will - * contain all elements of this dataset. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - take(count) { - const base = this; - let size; - if (this.size != null && this.size > count) { - // If the size of this dataset is greater than count, the new dataset's - // size is count. - size = count; - } - else if (this.size != null && this.size <= count) { - // If the size of this dataset is equal or smaller than count, the new - // dataset's size is the size of this dataset. - size = this.size; - } - else { - // If the size of this dataset is null, the new dataset's size is null. - size = null; - } - return datasetFromIteratorFn(async () => (await base.iterator()).take(count), size); - } - /** - * Collect all elements of this dataset into an array. - * - * Obviously this will succeed only for small datasets that fit in memory. - * Useful for testing and generally should be avoided if possible. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]); - * console.log(await a.toArray()); - * ``` - * - * @returns A Promise for an array of elements, which will resolve - * when a new stream has been obtained and fully consumed. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - async toArray() { - if (this.size === Infinity) { - throw new Error('Can not convert infinite data stream to array.'); - } - return (await this.iterator()).toArray(); - } - /** - * 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. - */ - async toArrayForTest() { - if (this.size === Infinity) { - throw new Error('Can not convert infinite data stream to array.'); - } - return (await this.iterator()).toArrayForTest(); - } - } - // TODO(soergel): deep sharded shuffle, where supported - Dataset.MAX_BUFFER_SIZE = 10000; - /** - * Create a `Dataset` defined by a provided iterator() function. - * - * ```js - * let i = -1; - * const func = () => - * ++i < 5 ? {value: i, done: false} : {value: null, done: true}; - * const iter = tf.data.iteratorFromFunction(func); - * const ds = tf.data.datasetFromIteratorFn(iter); - * await ds.forEachAsync(e => console.log(e)); - * ``` - */ - function datasetFromIteratorFn(iteratorFn, size = null) { - return new class extends Dataset { - constructor() { - super(...arguments); - this.size = size; - } - /* - * Provide a new stream of elements. Note this will also start new streams - * from any underlying `Dataset`s. - */ - async iterator() { - return iteratorFn(); - } - }(); - } - /** - * Create a `Dataset` from an array of elements. - * - * Create a Dataset from an array of objects: - * ```js - * const a = tf.data.array([{'item': 1}, {'item': 2}, {'item': 3}]); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * Create a Dataset from an array of numbers: - * ```js - * const a = tf.data.array([4, 5, 6]); - * await a.forEachAsync(e => console.log(e)); - * ``` - * @param items An array of elements that will be parsed as items in a dataset. - * - * @doc {heading: 'Data', subheading: 'Creation', namespace: 'data'} - */ - function array(items) { - return datasetFromIteratorFn(async () => iteratorFromItems(items), items.length); - } - /** - * Create a `Dataset` by zipping together an array, dict, or nested - * structure of `Dataset`s (and perhaps additional constants). - * The underlying datasets must provide elements in a consistent order such that - * they correspond. - * - * The number of elements in the resulting dataset is the same as the size of - * the smallest dataset in datasets. - * - * The nested structure of the `datasets` argument determines the - * structure of elements in the resulting iterator. - * - * Note this means that, given an array of two datasets that produce dict - * elements, the result is a dataset that produces elements that are arrays - * of two dicts: - * - * Zip an array of datasets: - * ```js - * console.log('Zip two datasets of objects:'); - * const ds1 = tf.data.array([{a: 1}, {a: 2}, {a: 3}]); - * const ds2 = tf.data.array([{b: 4}, {b: 5}, {b: 6}]); - * const ds3 = tf.data.zip([ds1, ds2]); - * await ds3.forEachAsync(e => console.log(JSON.stringify(e))); - * - * // If the goal is to merge the dicts in order to produce elements like - * // {a: ..., b: ...}, this requires a second step such as: - * console.log('Merge the objects:'); - * const ds4 = ds3.map(x => {return {a: x[0].a, b: x[1].b}}); - * await ds4.forEachAsync(e => console.log(e)); - * ``` - * - * Zip a dict of datasets: - * ```js - * const a = tf.data.array([{a: 1}, {a: 2}, {a: 3}]); - * const b = tf.data.array([{b: 4}, {b: 5}, {b: 6}]); - * const c = tf.data.zip({c: a, d: b}); - * await c.forEachAsync(e => console.log(JSON.stringify(e))); - * ``` - * - * @doc {heading: 'Data', subheading: 'Operations', namespace: 'data'} - */ - function zip(datasets) { - // manually type-check the argument for JS users - if (!isIterable(datasets)) { - throw new Error('The argument to zip() must be an object or array.'); - } - let size; - if (Array.isArray(datasets)) { - for (let i = 0; i < datasets.length; i++) { - size = size == null ? datasets[i].size : - Math.min(size, datasets[i].size); - } - } - else if (datasets instanceof Object) { - for (const ds in datasets) { - size = size == null ? datasets[ds].size : - Math.min(size, datasets[ds].size); - } - } - return datasetFromIteratorFn(async () => { - const streams = await deepMapAndAwaitAll(datasets, d => { - if (d instanceof Dataset) { - return { value: d.iterator(), recurse: false }; - } - else if (isIterable(d)) { - return { value: null, recurse: true }; - } - else { - throw new Error('Leaves of the structure passed to zip() must be Datasets, ' + - 'not primitives.'); - } - }); - return iteratorFromZipped(streams, ZipMismatchMode.SHORTEST); - }, size); - } - /** - * A zip function for use with deepZip, passed via the columnMajorBatch call. - * - * Accepts an array of identically-structured nested elements and either batches - * them (if they are primitives, numeric arrays, or Tensors) or requests - * recursion (if not). - */ - // tslint:disable-next-line:no-any - function deepBatchConcat(rows) { - if (rows === null) { - return null; - } - // use the first item to decide whether to recurse or batch here. - const exampleRow = rows[0]; - if (canTensorify(exampleRow)) { - // rows is an array of primitives, Tensors, or arrays. Batch them. - const value = batchConcat(rows); - return { value, recurse: false }; - } - // the example row is an object, so recurse into it. - return { value: null, recurse: true }; - } - /** - * Assembles a list of same-shaped numbers, number arrays, or Tensors - * into a single new Tensor where axis 0 is the batch dimension. - */ - function batchConcat(arrays) { - if (arrays.length === 0) { - // We can't return an empty Tensor because we don't know the element shape. - throw new Error('Can\'t make a batch of zero elements.'); - } - if (arrays[0] instanceof tf.Tensor) { - // Input is an array of Tensors - return tf.stack(arrays); - } - else { - // Input is a possibly-nested array of numbers. - return tf.tensor(arrays); - } - } - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /** - * Represents a potentially large collection of text lines. - * - * The results are not batched. - */ - class TextLineDataset extends Dataset { - /** - * Create a `TextLineDataset`. - * - * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream. - */ - constructor(input) { - super(); - this.input = input; - } - async iterator() { - const inputIterator = await this.input.iterator(); - const utf8Iterator = inputIterator.decodeUTF8(); - const lineIterator = utf8Iterator.split('\n').map(line => { - // Windows/DOS format text file has extra line breaker at the end of line. - if (line.endsWith('\r')) { - line = line.slice(0, -1); - } - return line; - }); - return lineIterator; - } - } - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - const CODE_QUOTE = '"'; - const STATE_OUT = Symbol('out'); - const STATE_FIELD = Symbol('field'); - const STATE_QUOTE = Symbol('quote'); - const STATE_QUOTE_AFTER_QUOTE = Symbol('quoteafterquote'); - const STATE_WITHIN_QUOTE_IN_QUOTE = Symbol('quoteinquote'); - /** - * Represents a potentially large collection of delimited text records. - * - * The produced `TensorContainer`s each contain one key-value pair for - * every column of the table. When a field is empty in the incoming data, the - * resulting value is `undefined`, or throw error if it is required. Values - * that can be parsed as numbers are emitted as type `number`, other values - * are parsed as `string`. - * - * The results are not batched. - * - * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'} - */ - class CSVDataset extends Dataset { - /** - * Create a `CSVDataset`. - * - * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream. - * @param csvConfig (Optional) A CSVConfig object that contains configurations - * of reading and decoding from CSV file(s). - * - * hasHeader: (Optional) A boolean value that indicates whether the first - * row of provided CSV file is a header line with column names, and should - * not be included in the data. Defaults to `true`. - * - * columnNames: (Optional) A list of strings that corresponds to - * the CSV column names, in order. If provided, it ignores the column - * names inferred from the header row. If not provided, infers the column - * names from the first row of the records. If hasHeader is false and - * columnNames is not provided, this method throws an error. - * - * columnConfigs: (Optional) A dictionary whose key is column names, value - * is an object stating if this column is required, column's data type, - * default value, and if this column is label. If provided, keys must - * correspond to names provided in columnNames or inferred from the file - * header lines. If isLabel is true any column, returns an array of two - * items: the first item is a dict of features key/value pairs, the second - * item is a dict of labels key/value pairs. If no feature is marked as - * label, returns a dict of features only. - * - * configuredColumnsOnly (Optional) If true, only columns provided in - * columnConfigs will be parsed and provided during iteration. - * - * delimiter (Optional) The string used to parse each line of the input - * file. Defaults to `,`. - */ - constructor(input, csvConfig) { - super(); - this.input = input; - this.hasHeader = true; - this.fullColumnNames = null; - this.columnNamesValidated = false; - this.columnConfigs = null; - this.configuredColumnsOnly = false; - this.delimiter = ','; - this.delimWhitespace = false; - this.base = new TextLineDataset(input); - if (!csvConfig) { - csvConfig = {}; - } - this.hasHeader = csvConfig.hasHeader === false ? false : true; - this.fullColumnNames = csvConfig.columnNames; - this.columnConfigs = csvConfig.columnConfigs; - this.configuredColumnsOnly = csvConfig.configuredColumnsOnly; - if (csvConfig.delimWhitespace) { - tf.util.assert(csvConfig.delimiter == null, () => 'Delimiter should not be provided when delimWhitespace is true.'); - this.delimWhitespace = true; - this.delimiter = ' '; - } - else { - this.delimiter = csvConfig.delimiter ? csvConfig.delimiter : ','; - } - } - /** - * Returns column names of the csv dataset. If `configuredColumnsOnly` is - * true, return column names in `columnConfigs`. If `configuredColumnsOnly` is - * false and `columnNames` is provided, `columnNames`. If - * `configuredColumnsOnly` is false and `columnNames` is not provided, return - * all column names parsed from the csv file. For example usage please go to - * `tf.data.csv`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - async columnNames() { - if (!this.columnNamesValidated) { - await this.setColumnNames(); - } - return this.configuredColumnsOnly ? Object.keys(this.columnConfigs) : - this.fullColumnNames; - } - /* 1) If `columnNames` is provided as string[], use this string[] as output - * keys in corresponding order. The length must match the number of inferred - * columns if `hasHeader` is true . - * 2) If `columnNames` is not provided, parse header line as `columnNames` if - * hasHeader is true. If `hasHeader` is false, throw an error. - * 3) If `columnConfigs` is provided, all the keys in `columnConfigs` must - * exist in parsed `columnNames`. - */ - async setColumnNames() { - const columnNamesFromFile = await this.maybeReadHeaderLine(); - if (!this.fullColumnNames && !columnNamesFromFile) { - // Throw an error if columnNames is not provided and no header line. - throw new Error('Column names must be provided if there is no header line.'); - } - else if (this.fullColumnNames && columnNamesFromFile) { - // Check provided columnNames match header line. - tf.util.assert(columnNamesFromFile.length === this.fullColumnNames.length, () => 'The length of provided columnNames (' + - this.fullColumnNames.length.toString() + - ') does not match the length of the header line read from ' + - 'file (' + columnNamesFromFile.length.toString() + ').'); - } - if (!this.fullColumnNames) { - this.fullColumnNames = columnNamesFromFile; - } - // Check if there are duplicate column names. - const counts = this.fullColumnNames.reduce((countAcc, name) => { - countAcc[name] = (countAcc[name] + 1) || 1; - return countAcc; - }, {}); - const duplicateNames = Object.keys(counts).filter((name) => (counts[name] > 1)); - tf.util.assert(duplicateNames.length === 0, () => 'Duplicate column names found: ' + duplicateNames.toString()); - // Check if keys in columnConfigs match columnNames. - if (this.columnConfigs) { - for (const key of Object.keys(this.columnConfigs)) { - const index = this.fullColumnNames.indexOf(key); - if (index === -1) { - throw new Error('The key "' + key + - '" provided in columnConfigs does not match any of the column ' + - 'names (' + this.fullColumnNames.toString() + ').'); - } - } - } - this.columnNamesValidated = true; - } - async maybeReadHeaderLine() { - if (this.hasHeader) { - const iter = await this.base.iterator(); - const firstElement = await iter.next(); - if (firstElement.done) { - throw new Error('No data was found for CSV parsing.'); - } - const firstLine = firstElement.value; - const headers = this.parseRow(firstLine, false); - return headers; - } - else { - return null; - } - } - async iterator() { - if (!this.columnNamesValidated) { - await this.setColumnNames(); - } - let lines = await this.base.iterator(); - if (this.hasHeader) { - // We previously read the first line to get the columnNames. - // Now that we're providing data, skip it. - lines = lines.skip(1); - } - return lines.map(x => this.makeDataElement(x)); - } - makeDataElement(line) { - const values = this.parseRow(line); - const features = {}; - const labels = {}; - for (let i = 0; i < this.fullColumnNames.length; i++) { - const key = this.fullColumnNames[i]; - const config = this.columnConfigs ? this.columnConfigs[key] : null; - if (this.configuredColumnsOnly && !config) { - // This column is not selected. - continue; - } - else { - const value = values[i]; - let parsedValue = null; - if (value === '') { - // If default value is provided, use it. If default value is not - // provided, set as undefined. - if (config && config.default !== undefined) { - parsedValue = config.default; - } - else if (config && (config.required || config.isLabel)) { - throw new Error(`Required column ${key} is empty in this line: ${line}`); - } - else { - parsedValue = undefined; - } - } - else { - // A value is present, so parse it based on type - const valueAsNum = Number(value); - if (isNaN(valueAsNum)) { - // The value is a string and this column is declared as boolean - // in config, parse it as boolean. - if (config && config.dtype === 'bool') { - parsedValue = this.getBoolean(value); - } - else { - // Set value as string - parsedValue = value; - } - } - else if (!config || !config.dtype) { - // If this value is a number and no type config is provided, return - // it as number. - parsedValue = valueAsNum; - } - else { - // If this value is a number and data type is provided, parse it - // according to provided data type. - switch (config.dtype) { - case 'float32': - parsedValue = valueAsNum; - break; - case 'int32': - parsedValue = Math.floor(valueAsNum); - break; - case 'bool': - parsedValue = this.getBoolean(value); - break; - default: - parsedValue = valueAsNum; - } - } - } - // Check if this column is label. - (config && config.isLabel) ? labels[key] = parsedValue : - features[key] = parsedValue; - } - } - // If label exists, return an object of features and labels as {xs:features, - // ys:labels}, otherwise return features only. - if (Object.keys(labels).length === 0) { - return features; - } - else { - return { xs: features, ys: labels }; - } - } - getBoolean(value) { - if (value === '1' || value.toLowerCase() === 'true') { - return 1; - } - else { - return 0; - } - } - // adapted from https://beta.observablehq.com/@mbostock/streaming-csv - parseRow(line, validateElementCount = true) { - const result = []; - let readOffset = 0; - const readLength = line.length; - let currentState = STATE_OUT; - // Goes through the line to parse quote. - for (let i = 0; i < readLength; i++) { - switch (currentState) { - // Before enter a new field - case STATE_OUT: - switch (line.charAt(i)) { - // Enter a quoted field - case CODE_QUOTE: - readOffset = i + 1; - currentState = STATE_QUOTE; - break; - // Read an empty field - case this.delimiter: - readOffset = i + 1; - // If delimiter is white space and configured to collapse - // multiple white spaces, ignore this white space. - if (this.delimiter === ' ' && this.delimWhitespace) { - break; - } - result.push(''); - currentState = STATE_OUT; - break; - // Enter an unquoted field - default: - currentState = STATE_FIELD; - readOffset = i; - break; - } - break; - // In an unquoted field - case STATE_FIELD: - switch (line.charAt(i)) { - // Exit an unquoted field, add it to result - case this.delimiter: - result.push(line.substring(readOffset, i)); - currentState = STATE_OUT; - readOffset = i + 1; - break; - } - break; - // In a quoted field - case STATE_QUOTE: - switch (line.charAt(i)) { - // Read a quote after a quote - case CODE_QUOTE: - currentState = STATE_QUOTE_AFTER_QUOTE; - break; - } - break; - // This state means it's right after a second quote in a field - case STATE_QUOTE_AFTER_QUOTE: - switch (line.charAt(i)) { - // Finished a quoted field - case this.delimiter: - result.push(line.substring(readOffset, i - 1)); - currentState = STATE_OUT; - readOffset = i + 1; - break; - // Finished a quoted part in a quoted field - case CODE_QUOTE: - currentState = STATE_QUOTE; - break; - // In a quoted part in a quoted field - default: - currentState = STATE_WITHIN_QUOTE_IN_QUOTE; - break; - } - break; - case STATE_WITHIN_QUOTE_IN_QUOTE: - switch (line.charAt(i)) { - // Exit a quoted part in a quoted field - case CODE_QUOTE: - currentState = STATE_QUOTE; - break; - } - break; - } - } - // Adds last item based on if it is quoted. - if (currentState === STATE_QUOTE_AFTER_QUOTE) { - result.push(line.substring(readOffset, readLength - 1)); - } - else { - result.push(line.substring(readOffset)); - } - // Check if each row has the same number of elements as column names. - if (validateElementCount && result.length !== this.fullColumnNames.length) { - throw new Error(`Invalid row in csv file. Should have ${this.fullColumnNames.length} elements in a row, but got ${result}`); - } - return result; - } - } - // TODO(soergel): add more basic datasets for parity with tf.data - // tf.data.FixedLengthRecordDataset() - // tf.data.TFRecordDataset() - - /** - * @license - * Copyright 2019 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /** - * Provide a stream of tensors from microphone audio stream. The tensors are - * representing audio data as frequency-domain spectrogram generated with - * browser's native FFT. Tensors representing time-domain waveform is available - * based on configuration. Only works in browser environment. - */ - class MicrophoneIterator extends LazyIterator { - constructor(microphoneConfig) { - super(); - this.microphoneConfig = microphoneConfig; - this.isClosed = false; - this.fftSize = microphoneConfig.fftSize || 1024; - const fftSizeLog2 = Math.log2(this.fftSize); - if (this.fftSize < 0 || fftSizeLog2 < 4 || fftSizeLog2 > 14 || - !Number.isInteger(fftSizeLog2)) { - throw new Error(`Invalid fftSize: it must be a power of 2 between ` + - `2 to 4 and 2 to 14, but got ${this.fftSize}`); - } - this.numFrames = microphoneConfig.numFramesPerSpectrogram || 43; - this.sampleRateHz = microphoneConfig.sampleRateHz; - this.columnTruncateLength = - microphoneConfig.columnTruncateLength || this.fftSize; - this.audioTrackConstraints = microphoneConfig.audioTrackConstraints; - this.smoothingTimeConstant = microphoneConfig.smoothingTimeConstant || 0; - this.includeSpectrogram = - microphoneConfig.includeSpectrogram === false ? false : true; - this.includeWaveform = - microphoneConfig.includeWaveform === true ? true : false; - if (!this.includeSpectrogram && !this.includeWaveform) { - throw new Error('Both includeSpectrogram and includeWaveform are false. ' + - 'At least one type of data should be returned.'); - } - } - summary() { - return `microphone`; - } - // Construct a MicrophoneIterator and start the audio stream. - static async create(microphoneConfig = {}) { - if (tf.env().get('IS_NODE')) { - throw new Error('microphone API is only supported in browser environment.'); - } - const microphoneIterator = new MicrophoneIterator(microphoneConfig); - // Call async function start() to initialize the audio stream. - await microphoneIterator.start(); - return microphoneIterator; - } - // Start the audio stream and FFT. - async start() { - try { - this.stream = await navigator.mediaDevices.getUserMedia({ - audio: this.audioTrackConstraints == null ? true : - this.audioTrackConstraints, - video: false - }); - } - catch (e) { - throw new Error(`Error thrown while initializing video stream: ${e.message}`); - } - if (!this.stream) { - throw new Error('Could not obtain audio from microphone.'); - } - const ctxConstructor = - // tslint:disable-next-line:no-any - window.AudioContext || window.webkitAudioContext; - this.audioContext = new ctxConstructor(); - if (!this.sampleRateHz) { - // If sample rate is not provided, use the available sample rate on - // device. - this.sampleRateHz = this.audioContext.sampleRate; - } - else if (this.audioContext.sampleRate !== this.sampleRateHz) { - throw new Error(`Mismatch in sampling rate: ` + - `Expected: ${this.sampleRateHz}; ` + - `Actual: ${this.audioContext.sampleRate}`); - } - const streamSource = this.audioContext.createMediaStreamSource(this.stream); - this.analyser = this.audioContext.createAnalyser(); - this.analyser.fftSize = this.fftSize * 2; - this.analyser.smoothingTimeConstant = this.smoothingTimeConstant; - streamSource.connect(this.analyser); - this.freqData = new Float32Array(this.fftSize); - this.timeData = new Float32Array(this.fftSize); - return; - } - async next() { - if (this.isClosed) { - return { value: null, done: true }; - } - let spectrogramTensor; - let waveformTensor; - const audioDataQueue = await this.getAudioData(); - if (this.includeSpectrogram) { - const freqData = this.flattenQueue(audioDataQueue.freqDataQueue); - spectrogramTensor = this.getTensorFromAudioDataArray(freqData, [this.numFrames, this.columnTruncateLength, 1]); - } - if (this.includeWaveform) { - const timeData = this.flattenQueue(audioDataQueue.timeDataQueue); - waveformTensor = this.getTensorFromAudioDataArray(timeData, [this.numFrames * this.fftSize, 1]); - } - return { - value: { 'spectrogram': spectrogramTensor, 'waveform': waveformTensor }, - done: false - }; - } - // Capture one result from the audio stream, and extract the value from - // iterator.next() result. - async capture() { - return (await this.next()).value; - } - async getAudioData() { - const freqDataQueue = []; - const timeDataQueue = []; - let currentFrames = 0; - return new Promise(resolve => { - const intervalID = setInterval(() => { - if (this.includeSpectrogram) { - this.analyser.getFloatFrequencyData(this.freqData); - // If the audio stream is initializing, return empty queue. - if (this.freqData[0] === -Infinity) { - resolve({ freqDataQueue, timeDataQueue }); - } - freqDataQueue.push(this.freqData.slice(0, this.columnTruncateLength)); - } - if (this.includeWaveform) { - this.analyser.getFloatTimeDomainData(this.timeData); - timeDataQueue.push(this.timeData.slice()); - } - // Clean interval and return when all frames have been collected - if (++currentFrames === this.numFrames) { - clearInterval(intervalID); - resolve({ freqDataQueue, timeDataQueue }); - } - }, this.fftSize / this.sampleRateHz * 1e3); - }); - } - // Stop the audio stream and pause the iterator. - stop() { - if (!this.isClosed) { - this.isClosed = true; - this.analyser.disconnect(); - this.audioContext.close(); - if (this.stream != null && this.stream.getTracks().length > 0) { - this.stream.getTracks()[0].stop(); - } - } - } - // Override toArray() function to prevent collecting. - toArray() { - throw new Error('Can not convert infinite audio stream to array.'); - } - // Return audio sampling rate in Hz - getSampleRate() { - return this.sampleRateHz; - } - flattenQueue(queue) { - const frameSize = queue[0].length; - const freqData = new Float32Array(queue.length * frameSize); - queue.forEach((data, i) => freqData.set(data, i * frameSize)); - return freqData; - } - getTensorFromAudioDataArray(freqData, shape) { - const vals = new Float32Array(tf.util.sizeFromShape(shape)); - // If the data is less than the output shape, the rest is padded with zeros. - vals.set(freqData, vals.length - freqData.length); - return tf.tensor(vals, shape); - } - } - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /** - * Provide a stream of image tensors from webcam video stream. Only works in - * browser environment. - */ - class WebcamIterator extends LazyIterator { - constructor(webcamVideoElement, webcamConfig) { - super(); - this.webcamVideoElement = webcamVideoElement; - this.webcamConfig = webcamConfig; - this.isClosed = true; - this.resize = false; - if (this.needToResize()) { - this.resize = true; - this.cropSize = - [this.webcamConfig.resizeHeight, this.webcamConfig.resizeWidth]; - this.cropBoxInd = tf.tensor1d([0], 'int32'); - if (this.webcamConfig.centerCrop) { - // Calculate the box based on resizing shape. - const widthCroppingRatio = this.webcamConfig.resizeWidth * 1.0 / this.webcamVideoElement.width; - const heightCroppingRatio = this.webcamConfig.resizeHeight * 1.0 / - this.webcamVideoElement.height; - const widthCropStart = (1 - widthCroppingRatio) / 2; - const heightCropStart = (1 - heightCroppingRatio) / 2; - const widthCropEnd = widthCropStart + widthCroppingRatio; - const heightCropEnd = heightCroppingRatio + heightCropStart; - this.cropBox = tf.tensor2d([heightCropStart, widthCropStart, heightCropEnd, widthCropEnd], [1, 4]); - } - else { - this.cropBox = tf.tensor2d([0, 0, 1, 1], [1, 4]); - } - } - } - summary() { - return `webcam`; - } - // Construct a WebcamIterator and start it's video stream. - static async create(webcamVideoElement, webcamConfig = {}) { - if (tf.env().get('IS_NODE')) { - throw new Error('tf.data.webcam is only supported in browser environment.'); - } - if (!webcamVideoElement) { - // If webcam video element is not provided, create a hidden video element - // with provided width and height. - webcamVideoElement = document.createElement('video'); - if (!webcamConfig.resizeWidth || !webcamConfig.resizeHeight) { - throw new Error('Please provide webcam video element, or resizeWidth and ' + - 'resizeHeight to create a hidden video element.'); - } - webcamVideoElement.width = webcamConfig.resizeWidth; - webcamVideoElement.height = webcamConfig.resizeHeight; - } - const webcamIterator = new WebcamIterator(webcamVideoElement, webcamConfig); - // Call async function to initialize the video stream. - await webcamIterator.start(); - return webcamIterator; - } - // Async function to start video stream. - async start() { - if (this.webcamConfig.facingMode) { - tf.util.assert((this.webcamConfig.facingMode === 'user') || - (this.webcamConfig.facingMode === 'environment'), () => `Invalid webcam facing mode: ${this.webcamConfig.facingMode}. ` + - `Please provide 'user' or 'environment'`); - } - try { - this.stream = await navigator.mediaDevices.getUserMedia({ - video: { - deviceId: this.webcamConfig.deviceId, - facingMode: this.webcamConfig.facingMode ? - this.webcamConfig.facingMode : - 'user', - width: this.webcamVideoElement.width, - height: this.webcamVideoElement.height - } - }); - } - catch (e) { - // Modify the error message but leave the stack trace intact - e.message = `Error thrown while initializing video stream: ${e.message}`; - throw e; - } - if (!this.stream) { - throw new Error('Could not obtain video from webcam.'); - } - // Older browsers may not have srcObject - try { - this.webcamVideoElement.srcObject = this.stream; - } - catch (error) { - console.log(error); - this.webcamVideoElement.src = window.URL.createObjectURL(this.stream); - } - // Start the webcam video stream - this.webcamVideoElement.play(); - this.isClosed = false; - return new Promise(resolve => { - // Add event listener to make sure the webcam has been fully initialized. - this.webcamVideoElement.onloadedmetadata = () => { - resolve(); - }; - }); - } - async next() { - if (this.isClosed) { - return { value: null, done: true }; - } - let img; - try { - img = tf.browser.fromPixels(this.webcamVideoElement); - } - catch (e) { - throw new Error(`Error thrown converting video to pixels: ${JSON.stringify(e)}`); - } - if (this.resize) { - try { - return { value: this.cropAndResizeFrame(img), done: false }; - } - catch (e) { - throw new Error(`Error thrown cropping the video: ${e.message}`); - } - finally { - img.dispose(); - } - } - else { - return { value: img, done: false }; - } - } - needToResize() { - // If resizeWidth and resizeHeight are provided, and different from the - // width and height of original HTMLVideoElement, then resizing and cropping - // is required. - if (this.webcamConfig.resizeWidth && this.webcamConfig.resizeHeight && - (this.webcamVideoElement.width !== this.webcamConfig.resizeWidth || - this.webcamVideoElement.height !== this.webcamConfig.resizeHeight)) { - return true; - } - return false; - } - // Cropping and resizing each frame based on config - cropAndResizeFrame(img) { - return tf.tidy(() => { - const expandedImage = tf.expandDims(tf.cast(img, 'float32'), (0)); - let resizedImage; - resizedImage = tf.image.cropAndResize(expandedImage, this.cropBox, this.cropBoxInd, this.cropSize, 'bilinear'); - // Extract image from batch cropping. - const shape = resizedImage.shape; - return tf.reshape(resizedImage, shape.slice(1)); - }); - } - // Capture one frame from the video stream, and extract the value from - // iterator.next() result. - async capture() { - return (await this.next()).value; - } - // Stop the video stream and pause webcam iterator. - stop() { - const tracks = this.stream.getTracks(); - tracks.forEach(track => track.stop()); - try { - this.webcamVideoElement.srcObject = null; - } - catch (error) { - console.log(error); - this.webcamVideoElement.src = null; - } - this.isClosed = true; - } - // Override toArray() function to prevent collecting. - toArray() { - throw new Error('Can not convert infinite video stream to array.'); - } - } - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /** - * Represents a data source readable as a stream of binary data chunks. - * - * Because `Dataset`s can be read repeatedly (via `Dataset.iterator()`), this - * provides a means to repeatedly create streams from the underlying data - * sources. - */ - class DataSource { - } - // TODO(soergel): consider convenience factory functions here - // in combination with chainable source->dataset above, e.g.: - // tf.data.url(...).asCsvDataset().shuffle().batch() - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - class StringIterator extends LazyIterator { - /** - * Splits a string stream on a given separator. - * - * It is assumed that the incoming chunk boundaries have no semantic meaning, - * so conceptually the incoming stream is treated simply as the concatenation - * of its elements. - * - * The outgoing stream provides chunks corresponding to the results of the - * standard string split() operation (even if such a chunk spanned incoming - * chunks). The separators are not included. - * - * A typical usage is to split a text file (represented as a stream with - * arbitrary chunk boundaries) into lines. - * - * @param upstream A readable stream of strings that can be treated as - * concatenated. - * @param separator A character to split on. - */ - split(separator) { - return new SplitIterator(this, separator); - } - } - // ============================================================================ - // The following private classes serve to implement the chainable methods - // on StringIterator. Unfortunately they can't be placed in separate files, due - // to resulting trouble with circular imports. - // ============================================================================ - // We wanted multiple inheritance, e.g. - // class SplitIterator extends QueueIterator, StringIterator - // but the TypeScript mixin approach is a bit hacky, so we take this adapter - // approach instead. - class SplitIterator extends StringIterator { - constructor(upstream, separator) { - super(); - this.upstream = upstream; - this.impl = new SplitIteratorImpl(upstream, separator); - } - summary() { - return this.impl.summary(); - } - async next() { - return this.impl.next(); - } - } - class SplitIteratorImpl extends OneToManyIterator { - constructor(upstream, separator) { - super(); - this.upstream = upstream; - this.separator = separator; - // A partial string at the end of an upstream chunk - this.carryover = ''; - } - summary() { - return `${this.upstream.summary()} -> Split('${this.separator}')`; - } - async pump() { - const chunkResult = await this.upstream.next(); - if (chunkResult.done) { - if (this.carryover === '') { - return false; - } - // Pretend that the pump succeeded in order to emit the small last batch. - // The next pump() call will actually fail. - this.outputQueue.push(this.carryover); - this.carryover = ''; - return true; - } - const lines = chunkResult.value.split(this.separator); - // Note the behavior: " ab ".split(' ') === ['', 'ab', ''] - // Thus the carryover may be '' if the separator falls on a chunk - // boundary; this produces the correct result. - lines[0] = this.carryover + lines[0]; - for (const line of lines.slice(0, -1)) { - this.outputQueue.push(line); - } - this.carryover = lines[lines.length - 1]; - return true; - } - } - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - class ByteChunkIterator extends LazyIterator { - /** - * Decode a stream of UTF8-encoded byte arrays to a stream of strings. - * - * The byte arrays producetd from the ByteChunkIterator on which this is - * called will be interpreted as concatenated. No assumptions are made about - * the boundaries of the incoming chunks, so a multi-byte UTF8 encoding of a - * character may span the boundary between chunks. This naturally happens, - * for instance, when reading fixed-size byte arrays from a file. - */ - decodeUTF8() { - return new Utf8Iterator(this); - } - } - // ============================================================================ - // The following private classes serve to implement the chainable methods - // on ByteChunkIterator. Unfortunately they can't be placed in separate files, - // due to resulting trouble with circular imports. - // ============================================================================ - // We wanted multiple inheritance, e.g. - // class Utf8Iterator extends QueueIterator, StringIterator - // but the TypeScript mixin approach is a bit hacky, so we take this adapter - // approach instead. - class Utf8Iterator extends StringIterator { - constructor(upstream) { - super(); - this.upstream = upstream; - this.impl = new Utf8IteratorImpl(upstream); - } - summary() { - return this.impl.summary(); - } - async next() { - return this.impl.next(); - } - } - /** - * Decode a stream of UTF8-encoded byte arrays to a stream of strings. - * - * This is tricky because the incoming byte array boundaries may disrupt a - * multi-byte UTF8 character. Thus any incomplete character data at the end of - * a chunk must be carried over and prepended to the next chunk before - * decoding. Luckily with native decoder, TextDecoder in browser and - * string_decoder in node, byte array boundaries are handled automatically. - * - * In the context of an input pipeline for machine learning, UTF8 decoding is - * needed to parse text files containing training examples or prediction - * requests (e.g., formatted as CSV or JSON). We cannot use the built-in - * decoding provided by FileReader.readAsText() because here we are in a - * streaming context, which FileReader does not support. - * - * @param upstream A `LazyIterator` of `Uint8Arrays` containing UTF8-encoded - * text, which should be interpreted as concatenated. No assumptions are - * made about the boundaries of the incoming chunks, so a multi-byte UTF8 - * encoding of a character may span the boundary between chunks. This - * naturally happens, for instance, when reading fixed-size byte arrays from a - * file. - */ - class Utf8IteratorImpl extends OneToManyIterator { - constructor(upstream) { - super(); - this.upstream = upstream; - if (tf.env().get('IS_BROWSER')) { - this.decoder = new TextDecoder('utf-8'); - } - else { - // tslint:disable-next-line:no-require-imports - const { StringDecoder } = require('string_decoder'); - this.decoder = new StringDecoder('utf8'); - } - } - summary() { - return `${this.upstream.summary()} -> Utf8`; - } - async pump() { - const chunkResult = await this.upstream.next(); - let chunk; - if (chunkResult.done) { - return false; - } - else { - chunk = chunkResult.value; - } - let text; - if (tf.env().get('IS_BROWSER')) { - text = this.decoder.decode(chunk, { stream: true }); - } - else { - text = this.decoder.write(Buffer.from(chunk.buffer)); - } - this.outputQueue.push(text); - return true; - } - } - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /** - * Provide a stream of chunks from a File, Blob, or Uint8Array. - * @param file The source File, Blob or Uint8Array. - * @param options Optional settings controlling file reading. - * @returns a lazy Iterator of Uint8Arrays containing sequential chunks of the - * input File, Blob or Uint8Array. - */ - class FileChunkIterator extends ByteChunkIterator { - constructor(file, options = {}) { - super(); - this.file = file; - this.options = options; - tf.util.assert((file instanceof Uint8Array) || - (tf.env().get('IS_BROWSER') ? - (file instanceof File || file instanceof Blob) : - false), () => 'FileChunkIterator only supports File, Blob and Uint8Array ' + - 'right now.'); - this.offset = options.offset || 0; - // default 1MB chunk has tolerable perf on large files - this.chunkSize = options.chunkSize || 1024 * 1024; - } - summary() { - return `FileChunks ${this.file}`; - } - async next() { - if (this.offset >= ((this.file instanceof Uint8Array) ? - this.file.byteLength : - this.file.size)) { - return { value: null, done: true }; - } - const chunk = new Promise((resolve, reject) => { - const end = this.offset + this.chunkSize; - if (this.file instanceof Uint8Array) { - // Note if end > this.uint8Array.byteLength, we just get a small last - // chunk. - resolve(new Uint8Array(this.file.slice(this.offset, end))); - } - else { - // This branch assumes that this.file type is File or Blob, which - // means it is in the browser environment. - // TODO(soergel): is this a performance issue? - const fileReader = new FileReader(); - fileReader.onload = (event) => { - let data = fileReader.result; - // Not sure we can trust the return type of - // FileReader.readAsArrayBuffer See e.g. - // https://github.com/node-file-api/FileReader/issues/2 - if (data instanceof ArrayBuffer) { - data = new Uint8Array(data); - } - if (!(data instanceof Uint8Array)) { - return reject(new TypeError('FileReader returned unknown type.')); - } - resolve(data); - }; - fileReader.onabort = (event) => { - return reject(new Error('Aborted')); - }; - fileReader.onerror = (event) => { - return reject(new Error(event.type)); - }; - // TODO(soergel): better handle onabort, onerror - // Note if end > this.file.size, we just get a small last chunk. - const slice = this.file.slice(this.offset, end); - // We can't use readAsText here (even if we know the file is text) - // because the slice boundary may fall within a multi-byte character. - fileReader.readAsArrayBuffer(slice); - } - this.offset = end; - }); - return { value: (await chunk), done: false }; - } - } - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /** - * Provide a stream of chunks from a URL. - * - * Note this class first downloads the entire file into memory before providing - * the first element from the stream. This is because the Fetch API does not - * yet reliably provide a reader stream for the response body. - */ - async function urlChunkIterator(url, options = {}) { - let urlString; - let requestInit; - if ((typeof url) === 'string') { - urlString = url; - } - else { - urlString = url.url; - requestInit = getRequestInitFromRequest(url); - } - const response = await tf.util.fetch(urlString, requestInit); - if (response.ok) { - const uint8Array = new Uint8Array(await response.arrayBuffer()); - return new FileChunkIterator(uint8Array, options); - } - else { - throw new Error(response.statusText); - } - } - // Generate RequestInit from Request to match tf.util.fetch signature. - const getRequestInitFromRequest = (request) => { - const init = { - method: request.method, - headers: request.headers, - body: request.body, - mode: request.mode, - credentials: request.credentials, - cache: request.cache, - redirect: request.redirect, - referrer: request.referrer, - integrity: request.integrity, - }; - return init; - }; - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - // Skip tslint any type check cause this method is aiming to check type of - // input. - // tslint:disable-next-line:no-any - function isLocalPath(source) { - return (typeof source === 'string') && source.substr(0, 7) === 'file://'; - } - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /** - * Represents a file, blob, or Uint8Array readable as a stream of binary data - * chunks. - */ - class FileDataSource extends DataSource { - /** - * Create a `FileDataSource`. - * - * @param input Local file path, or `File`/`Blob`/`Uint8Array` object to - * read. Local file only works in node environment. - * @param options Options passed to the underlying `FileChunkIterator`s, - * such as {chunksize: 1024}. - */ - constructor(input, options = {}) { - super(); - this.input = input; - this.options = options; - } - async iterator() { - if (isLocalPath(this.input) && tf.env().get('IS_NODE')) { - // tslint:disable-next-line:no-require-imports - const fs = require('fs'); - this.input = fs.readFileSync(this.input.substr(7)); - } - // TODO(kangyizhang): Add LocalFileChunkIterator to split local streaming - // with file in browser. - return new FileChunkIterator(this.input, this.options); - } - } - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /* - * Represents a URL readable as a stream of binary data chunks. - */ - class URLDataSource extends DataSource { - /** - * Create a `URLDataSource`. - * - * @param url A source URL string, or a `Request` object. - * @param options Options passed to the underlying `FileChunkIterator`s, - * such as {chunksize: 1024}. - */ - constructor(url, fileOptions = {}) { - super(); - this.url = url; - this.fileOptions = fileOptions; - } - // TODO(soergel): provide appropriate caching options. Currently this - // will download the URL anew for each call to iterator(). Since we have - // to treat the downloaded file as a blob/buffer anyway, we may as well retain - // it-- but that raises GC issues. Also we may want a persistent disk cache. - async iterator() { - if (isLocalPath(this.url)) { - return (new FileDataSource(this.url, this.fileOptions)) - .iterator(); - } - else { - return urlChunkIterator(this.url, this.fileOptions); - } - } - } - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /** - * Create a `CSVDataset` by reading and decoding CSV file(s) from provided URL - * or local path if it's in Node environment. - * - * Note: If isLabel in columnConfigs is `true` for at least one column, the - * element in returned `CSVDataset` will be an object of - * `{xs:features, ys:labels}`: xs is a dict of features key/value pairs, ys - * is a dict of labels key/value pairs. If no column is marked as label, - * returns a dict of features only. - * - * ```js - * const csvUrl = - * 'https://storage.googleapis.com/tfjs-examples/multivariate-linear-regression/data/boston-housing-train.csv'; - * - * async function run() { - * // We want to predict the column "medv", which represents a median value of - * // a home (in $1000s), so we mark it as a label. - * const csvDataset = tf.data.csv( - * csvUrl, { - * columnConfigs: { - * medv: { - * isLabel: true - * } - * } - * }); - * - * // Number of features is the number of column names minus one for the label - * // column. - * const numOfFeatures = (await csvDataset.columnNames()).length - 1; - * - * // Prepare the Dataset for training. - * const flattenedDataset = - * csvDataset - * .map(({xs, ys}) => - * { - * // Convert xs(features) and ys(labels) from object form (keyed by - * // column name) to array form. - * return {xs:Object.values(xs), ys:Object.values(ys)}; - * }) - * .batch(10); - * - * // Define the model. - * const model = tf.sequential(); - * model.add(tf.layers.dense({ - * inputShape: [numOfFeatures], - * units: 1 - * })); - * model.compile({ - * optimizer: tf.train.sgd(0.000001), - * loss: 'meanSquaredError' - * }); - * - * // Fit the model using the prepared Dataset - * return model.fitDataset(flattenedDataset, { - * epochs: 10, - * callbacks: { - * onEpochEnd: async (epoch, logs) => { - * console.log(epoch + ':' + logs.loss); - * } - * } - * }); - * } - * - * await run(); - * ``` - * - * @param source URL or local path to get CSV file. If it's a local path, it - * must have prefix `file://` and it only works in node environment. - * @param csvConfig (Optional) A CSVConfig object that contains configurations - * of reading and decoding from CSV file(s). - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * configParamIndices: [1] - * } - */ - function csv(source, csvConfig = {}) { - return new CSVDataset(new URLDataSource(source), csvConfig); - } - /** - * Create a `Dataset` that produces each element by calling a provided function. - * - * Note that repeated iterations over this `Dataset` may produce different - * results, because the function will be called anew for each element of each - * iteration. - * - * Also, beware that the sequence of calls to this function may be out of order - * in time with respect to the logical order of the Dataset. This is due to the - * asynchronous lazy nature of stream processing, and depends on downstream - * transformations (e.g. .shuffle()). If the provided function is pure, this is - * no problem, but if it is a closure over a mutable state (e.g., a traversal - * pointer), then the order of the produced elements may be scrambled. - * - * ```js - * let i = -1; - * const func = () => - * ++i < 5 ? {value: i, done: false} : {value: null, done: true}; - * const ds = tf.data.func(func); - * await ds.forEachAsync(e => console.log(e)); - * ``` - * - * @param f A function that produces one data element on each call. - */ - function func(f) { - const iter = iteratorFromFunction(f); - return datasetFromIteratorFn(async () => iter); - } - /** - * Create a `Dataset` that produces each element from provided JavaScript - * generator, which is a function* - * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions), - * or a function that returns an - * iterator - * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions). - * - * The returned iterator should have `.next()` function that returns element in - * format of `{value: TensorContainer, done:boolean}`. - * - * Example of creating a dataset from an iterator factory: - * ```js - * function makeIterator() { - * const numElements = 10; - * let index = 0; - * - * const iterator = { - * next: () => { - * let result; - * if (index < numElements) { - * result = {value: index, done: false}; - * index++; - * return result; - * } - * return {value: index, done: true}; - * } - * }; - * return iterator; - * } - * const ds = tf.data.generator(makeIterator); - * await ds.forEachAsync(e => console.log(e)); - * ``` - * - * Example of creating a dataset from a generator: - * ```js - * function* dataGenerator() { - * const numElements = 10; - * let index = 0; - * while (index < numElements) { - * const x = index; - * index++; - * yield x; - * } - * } - * - * const ds = tf.data.generator(dataGenerator); - * await ds.forEachAsync(e => console.log(e)); - * ``` - * - * @param generator A Javascript generator function that returns a JavaScript - * iterator. - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * configParamIndices: [1] - * } - */ - function generator(generator) { - return datasetFromIteratorFn(async () => { - const gen = await generator(); - return iteratorFromFunction(() => gen.next()); - }); - } - /** - * Create an iterator that generate `Tensor`s from webcam video stream. This API - * only works in Browser environment when the device has webcam. - * - * Note: this code snippet only works when the device has a webcam. It will - * request permission to open the webcam when running. - * ```js - * const videoElement = document.createElement('video'); - * videoElement.width = 100; - * videoElement.height = 100; - * const cam = await tf.data.webcam(videoElement); - * const img = await cam.capture(); - * img.print(); - * cam.stop(); - * ``` - * - * @param webcamVideoElement A `HTMLVideoElement` used to play video from - * webcam. If this element is not provided, a hidden `HTMLVideoElement` will - * be created. In that case, `resizeWidth` and `resizeHeight` must be - * provided to set the generated tensor shape. - * @param webcamConfig A `WebcamConfig` object that contains configurations of - * reading and manipulating data from webcam video stream. - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * ignoreCI: true - * } - */ - async function webcam(webcamVideoElement, webcamConfig) { - return WebcamIterator.create(webcamVideoElement, webcamConfig); - } - /** - * Create an iterator that generate frequency-domain spectrogram `Tensor`s from - * microphone audio stream with browser's native FFT. This API only works in - * browser environment when the device has microphone. - * - * Note: this code snippet only works when the device has a microphone. It will - * request permission to open the microphone when running. - * ```js - * const mic = await tf.data.microphone({ - * fftSize: 1024, - * columnTruncateLength: 232, - * numFramesPerSpectrogram: 43, - * sampleRateHz:44100, - * includeSpectrogram: true, - * includeWaveform: true - * }); - * const audioData = await mic.capture(); - * const spectrogramTensor = audioData.spectrogram; - * spectrogramTensor.print(); - * const waveformTensor = audioData.waveform; - * waveformTensor.print(); - * mic.stop(); - * ``` - * - * @param microphoneConfig A `MicrophoneConfig` object that contains - * configurations of reading audio data from microphone. - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * ignoreCI: true - * } - */ - async function microphone(microphoneConfig) { - return MicrophoneIterator.create(microphoneConfig); - } - - /** @license See the LICENSE file. */ - // This code is auto-generated, do not modify this file! - const version = '3.6.0'; - - exports.CSVDataset = CSVDataset; - exports.Dataset = Dataset; - exports.FileDataSource = FileDataSource; - exports.TextLineDataset = TextLineDataset; - exports.URLDataSource = URLDataSource; - exports.array = array; - exports.csv = csv; - exports.func = func; - exports.generator = generator; - exports.microphone = microphone; - exports.version_data = version; - exports.webcam = webcam; - exports.zip = zip; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}))); -//# sourceMappingURL=tf-data.es2017.js.map diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.es2017.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.es2017.js.map deleted file mode 100644 index 685ef4a31..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.es2017.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tf-data.es2017.js","sources":["../node_modules/seedrandom/lib/alea.js","../node_modules/seedrandom/lib/xor128.js","../node_modules/seedrandom/lib/xorwow.js","../node_modules/seedrandom/lib/xorshift7.js","../node_modules/seedrandom/lib/xor4096.js","../node_modules/seedrandom/lib/tychei.js","../node_modules/seedrandom/seedrandom.js","../node_modules/seedrandom/index.js","../src/util/deep_map.ts","../src/util/deep_clone.ts","../src/util/ring_buffer.ts","../src/util/growing_ring_buffer.ts","../src/iterators/lazy_iterator.ts","../src/dataset.ts","../src/datasets/text_line_dataset.ts","../src/datasets/csv_dataset.ts","../src/iterators/microphone_iterator.ts","../src/iterators/webcam_iterator.ts","../src/datasource.ts","../src/iterators/string_iterator.ts","../src/iterators/byte_chunk_iterator.ts","../src/iterators/file_chunk_iterator.ts","../src/iterators/url_chunk_iterator.ts","../src/util/source_util.ts","../src/sources/file_data_source.ts","../src/sources/url_data_source.ts","../src/readers.ts","../src/version.ts"],"sourcesContent":["// A port of an algorithm by Johannes Baagøe , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baagøe \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xorshift7\" algorithm by\n// François Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n","// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n","// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","/*\nCopyright 2014 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\nvar global = this,\n width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\nmath['seed' + rngname] = seedrandom;\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n}\n\n// End anonymous scope, and pass initial values.\n})(\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n","// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by François Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\n\n// tslint:disable:no-any\n\n/**\n * A return value for a mapping function that can be applied via deepMap.\n *\n * If recurse is true, the value should be empty, and iteration will continue\n * into the object or array.\n */\nexport type DeepMapResult = {\n value: any,\n recurse: boolean\n};\n\n/**\n * Apply a mapping function to a nested structure in a recursive manner.\n *\n * The result of the mapping is an object with the same nested structure (i.e.,\n * of arrays and dicts) as the input, except that some subtrees are replaced,\n * according to the results of the mapping function.\n *\n * Mappings are memoized. Thus, if the nested structure contains the same\n * object in multiple positions, the output will contain the same mapped object\n * in those positions. Cycles are not supported, however.\n *\n * @param input: The object to which to apply the mapping function.\n * @param mapFn: A function that expects a single node of the object tree, and\n * returns a `DeepMapResult`. The `DeepMapResult` either provides a\n * replacement value for that node (i.e., replacing the subtree), or indicates\n * that the node should be processed recursively.\n */\nexport function deepMap(input: any, mapFn: (x: any) => DeepMapResult): any|\n any[] {\n return deepMapInternal(input, mapFn);\n}\n\n/**\n * @param seen: A Map of known object mappings (i.e., memoized results of\n * `mapFn()`)\n * @param containedIn: An set containing objects on the reference path currently\n * being processed (used to detect cycles).\n */\nfunction deepMapInternal(\n input: any, mapFn: (x: any) => DeepMapResult,\n seen: Map = new Map(), containedIn: Set<{}> = new Set()): any|\n any[] {\n if (input == null) {\n return null;\n }\n if (containedIn.has(input)) {\n throw new Error('Circular references are not supported.');\n }\n if (seen.has(input)) {\n return seen.get(input);\n }\n const result = mapFn(input);\n\n if (result.recurse && result.value !== null) {\n throw new Error(\n 'A deep map function may not return both a value and recurse=true.');\n }\n\n if (!result.recurse) {\n seen.set(input, result.value);\n return result.value;\n } else if (isIterable(input)) {\n // tslint:disable-next-line:no-any\n const mappedIterable: any|any[] = Array.isArray(input) ? [] : {};\n containedIn.add(input);\n for (const k in input) {\n const child = input[k];\n const childResult = deepMapInternal(child, mapFn, seen, containedIn);\n mappedIterable[k] = childResult;\n }\n containedIn.delete(input);\n return mappedIterable;\n } else {\n throw new Error(`Can't recurse into non-iterable type: ${input}`);\n }\n}\n\n// TODO(soergel, kangyizhang) Reconsider naming of deepZip() to avoid confusion\n// with zip()\n\n/**\n * Zip nested structures together in a recursive manner.\n *\n * This has the effect of transposing or pivoting data, e.g. converting it from\n * a row-major representation to a column-major representation.\n *\n * For example, `deepZip([{a: 1, b: 2}, {a: 3, b: 4}])` returns\n * `{a: [1, 3], b: [2, 4]}`.\n *\n * The inputs should all have the same nested structure (i.e., of arrays and\n * dicts). The result is a single object with the same nested structure, where\n * the leaves are arrays collecting the values of the inputs at that location\n * (or, optionally, the result of a custom function applied to those arrays).\n *\n * @param inputs: An array of the objects to zip together.\n * @param zipFn: (optional) A function that expects an array of elements at a\n * single node of the object tree, and returns a `DeepMapResult`. The\n * `DeepMapResult` either provides a result value for that node (i.e.,\n * representing the subtree), or indicates that the node should be processed\n * recursively. The default zipFn recurses as far as possible and places\n * arrays at the leaves.\n */\nexport function deepZip(\n inputs: any[], zipFn: (xs: any[]) => DeepMapResult = zipToList): any|any[] {\n return deepZipInternal(inputs, zipFn);\n}\n\n/**\n * @param containedIn: An set containing objects on the reference path currently\n * being processed (used to detect cycles).\n */\nfunction deepZipInternal(\n inputs: any[], zipFn: (xs: any[]) => DeepMapResult,\n containedIn: Set<{}> = new Set()): any|any[] {\n // The recursion follows the structure of input 0; it's assumed that all the\n // other inputs have the same structure.\n const input = inputs[0];\n if (containedIn.has(input)) {\n throw new Error('Circular references are not supported.');\n }\n const result = zipFn(inputs);\n\n if (result.recurse && result.value !== null) {\n throw new Error(\n 'A deep zip function may not return both a value and recurse=true.');\n }\n\n if (!result.recurse) {\n return result.value;\n } else if (isIterable(input)) {\n // tslint:disable-next-line:no-any\n const mappedIterable: any|any[] = Array.isArray(input) ? [] : {};\n containedIn.add(input);\n for (const k in input) {\n const children = inputs.map(x => x[k]);\n const childResult = deepZipInternal(children, zipFn, containedIn);\n mappedIterable[k] = childResult;\n }\n containedIn.delete(input);\n return mappedIterable;\n } else {\n throw new Error(`Can't recurse into non-iterable type: ${input}`);\n }\n}\n\n// tslint:disable-next-line:no-any\nexport function zipToList(x: any[]): DeepMapResult {\n if (x === null) {\n return null;\n }\n // TODO(soergel): validate array type?\n\n if (isIterable(x[0])) {\n return {value: null, recurse: true};\n } else {\n return {value: x, recurse: false};\n }\n}\n\n/**\n * A return value for an async map function for use with deepMapAndAwaitAll.\n *\n * If recurse is true, the value should be empty, and iteration will continue\n * into the object or array.\n */\nexport type DeepMapAsyncResult = {\n value: Promise,\n recurse: boolean\n};\n\n/**\n * Apply an async mapping function to a nested structure in a recursive manner.\n *\n * This first creates a nested structure of Promises, and then awaits all of\n * those, resulting in a single Promise for a resolved nested structure.\n *\n * The result of the mapping is an object with the same nested structure (i.e.,\n * of arrays and dicts) as the input, except that some subtrees are replaced,\n * according to the results of the mapping function.\n *\n * Mappings are memoized. Thus, if the nested structure contains the same\n * object in multiple positions, the output will contain the same mapped object\n * in those positions. Cycles are not supported, however.\n *\n * @param input: The object to which to apply the mapping function.\n * @param mapFn: A function that expects a single node of the object tree, and\n * returns a `DeepMapAsyncResult`. The `DeepMapAsyncResult` either provides\n * a `Promise` for a replacement value for that node (i.e., replacing the\n * subtree), or indicates that the node should be processed recursively. Note\n * that the decision whether or not to recurse must be made immediately; only\n * the mapped value may be promised.\n */\nexport async function deepMapAndAwaitAll(\n input: any, mapFn: (x: any) => DeepMapAsyncResult): Promise {\n const seen: Map> = new Map();\n\n // First do a normal deepMap, collecting Promises in 'seen' as a side effect.\n deepMapInternal(input, mapFn, seen);\n\n // Replace the Promises in 'seen' in place.\n // Note TypeScript provides no async map iteration, and regular map iteration\n // is broken too, so sadly we have to do Array.from() to make it work.\n // (There's no advantage to Promise.all(), and that would be tricky anyway.)\n for (const key of Array.from(seen.keys())) {\n const value = seen.get(key);\n if (tf.util.isPromise(value)) {\n const mappedValue = await value;\n seen.set(key, mappedValue);\n }\n }\n\n // Normal deepMap again, this time filling in the resolved values.\n // It's unfortunate that we have to do two passes.\n // TODO(soergel): test performance and think harder about a fast solution.\n const result = deepMapInternal(input, mapFn, seen);\n return result;\n}\n\n/**\n * Determine whether the argument is iterable.\n *\n * @returns true if the argument is an array or any non-Tensor object.\n */\n// tslint:disable-next-line:no-any\nexport function isIterable(obj: any): boolean {\n return obj != null && (!ArrayBuffer.isView(obj)) &&\n (Array.isArray(obj) ||\n (typeof obj === 'object' && !(obj instanceof tf.Tensor)));\n}\n\n/**\n * Determine whether the argument can be converted to Tensor.\n *\n * Tensors, primitives, arrays, and TypedArrays all qualify; anything else does\n * not.\n *\n * @returns true if the argument can be converted to Tensor.\n */\n// tslint:disable-next-line:no-any\nexport function canTensorify(obj: any): boolean {\n return obj == null || isPrimitive(obj) || Array.isArray(obj) ||\n (typeof obj === 'object' && (obj instanceof tf.Tensor)) ||\n tf.util.isTypedArray(obj);\n}\n\n/**\n * Returns true if the given `value` is a primitive type. Otherwise returns\n * false. This is equivalant to node util.isPrimitive\n */\nfunction isPrimitive(value: any): boolean {\n return (\n value === null ||\n (typeof value !== 'object' && typeof value !== 'function'));\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport {deepMap, DeepMapResult, isIterable} from './deep_map';\n\nexport function deepClone(container: T): T {\n return deepMap(container, cloneIfTensor);\n}\n\n// tslint:disable-next-line: no-any\nfunction cloneIfTensor(item: any): DeepMapResult {\n if (item instanceof tf.Tensor) {\n return ({value: item.clone(), recurse: false});\n } else if (isIterable(item)) {\n return {value: null, recurse: true};\n } else {\n return {value: item, recurse: false};\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\n/**\n * A ring buffer, providing O(1) FIFO, LIFO, and related operations.\n */\nexport class RingBuffer {\n // Note we store the indices in the range 0 <= index < 2*capacity.\n // This allows us to distinguish the full from the empty case.\n // See https://www.snellman.net/blog/archive/2016-12-13-ring-buffers/\n protected begin = 0; // inclusive\n protected end = 0; // exclusive\n protected doubledCapacity: number;\n\n protected data: T[];\n\n /**\n * Constructs a `RingBuffer`.\n * @param capacity The number of items that the buffer can accomodate.\n */\n constructor(public capacity: number) {\n if (capacity == null) {\n throw new RangeError('Can\\'t create a ring buffer of unknown capacity.');\n }\n if (capacity < 1) {\n throw new RangeError('Can\\'t create ring buffer of capacity < 1.');\n }\n this.data = new Array(capacity);\n this.doubledCapacity = 2 * capacity;\n }\n\n /**\n * Map any index into the range 0 <= index < 2*capacity.\n */\n protected wrap(index: number) {\n // don't trust % on negative numbers\n while (index < 0) {\n index += this.doubledCapacity;\n }\n return index % this.doubledCapacity;\n }\n\n protected get(index: number) {\n if (index < 0) {\n throw new RangeError('Can\\'t get item at a negative index.');\n }\n return this.data[index % this.capacity];\n }\n\n protected set(index: number, value: T) {\n if (index < 0) {\n throw new RangeError('Can\\'t set item at a negative index.');\n }\n this.data[index % this.capacity] = value;\n }\n\n /**\n * Returns the current number of items in the buffer.\n */\n length(): number {\n let length = this.end - this.begin;\n if (length < 0) {\n length = this.doubledCapacity + length;\n }\n return length;\n }\n\n /**\n * Reports whether the buffer is full.\n * @returns true if the number of items in the buffer equals its capacity, and\n * false otherwise.\n */\n isFull() {\n return this.length() === this.capacity;\n }\n\n /**\n * Reports whether the buffer is empty.\n * @returns true if the number of items in the buffer equals zero, and\n * false otherwise.\n */\n isEmpty() {\n return this.length() === 0;\n }\n\n /**\n * Adds an item to the end of the buffer.\n */\n push(value: T) {\n if (this.isFull()) {\n throw new RangeError('Ring buffer is full.');\n }\n this.set(this.end, value);\n this.end = this.wrap(this.end + 1);\n }\n\n /**\n * Adds many items to the end of the buffer, in order.\n */\n pushAll(values: T[]) {\n for (const value of values) {\n this.push(value);\n }\n }\n\n /**\n * Removes and returns the last item in the buffer.\n */\n pop(): T {\n if (this.isEmpty()) {\n throw new RangeError('Ring buffer is empty.');\n }\n this.end = this.wrap(this.end - 1);\n const result = this.get(this.end);\n this.set(this.end, undefined);\n return result;\n }\n\n /**\n * Adds an item to the beginning of the buffer.\n */\n unshift(value: T) {\n if (this.isFull()) {\n throw new RangeError('Ring buffer is full.');\n }\n this.begin = this.wrap(this.begin - 1);\n this.set(this.begin, value);\n }\n\n /**\n * Removes and returns the first item in the buffer.\n */\n shift(): T {\n if (this.isEmpty()) {\n throw new RangeError('Ring buffer is empty.');\n }\n const result = this.get(this.begin);\n this.set(this.begin, undefined);\n this.begin = this.wrap(this.begin + 1);\n return result;\n }\n\n /**\n * Removes and returns a specific item in the buffer, and moves the last item\n * to the vacated slot. This is useful for implementing a shuffling stream.\n * Note that this operation necessarily scrambles the original order.\n *\n * @param relativeIndex: the index of the item to remove, relative to the\n * first item in the buffer (e.g., hiding the ring nature of the underlying\n * storage).\n */\n shuffleExcise(relativeIndex: number): T {\n if (this.isEmpty()) {\n throw new RangeError('Ring buffer is empty.');\n }\n const index = this.wrap(this.begin + relativeIndex);\n const result = this.get(index);\n this.set(index, this.pop());\n return result;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {RingBuffer} from './ring_buffer';\n\nexport class GrowingRingBuffer extends RingBuffer {\n private static INITIAL_CAPACITY = 32;\n\n /**\n * Constructs a `GrowingRingBuffer`.\n */\n constructor() {\n super(GrowingRingBuffer.INITIAL_CAPACITY);\n }\n\n isFull() {\n return false;\n }\n\n push(value: T) {\n if (super.isFull()) {\n this.expand();\n }\n super.push(value);\n }\n\n unshift(value: T) {\n if (super.isFull()) {\n this.expand();\n }\n super.unshift(value);\n }\n\n /**\n * Doubles the capacity of the buffer.\n */\n private expand() {\n const newCapacity = this.capacity * 2;\n const newData = new Array(newCapacity);\n const len = this.length();\n\n // Rotate the buffer to start at index 0 again, since we can't just\n // allocate more space at the end.\n for (let i = 0; i < len; i++) {\n newData[i] = this.get(this.wrap(this.begin + i));\n }\n\n this.data = newData;\n this.capacity = newCapacity;\n this.doubledCapacity = 2 * this.capacity;\n this.begin = 0;\n this.end = len;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport * as seedrandom from 'seedrandom';\n\nimport {Container} from '../types';\nimport {deepClone} from '../util/deep_clone';\nimport {deepMapAndAwaitAll, DeepMapAsyncResult, DeepMapResult, deepZip, zipToList} from '../util/deep_map';\nimport {GrowingRingBuffer} from '../util/growing_ring_buffer';\nimport {RingBuffer} from '../util/ring_buffer';\n\n/**\n * A nested structure of LazyIterators, used as the input to zip().\n */\nexport type IteratorContainer = Container>;\n\n// Here we implement a simple asynchronous iterator.\n// This lets us avoid using either third-party stream libraries or\n// recent TypeScript language support requiring polyfills.\n\n/**\n * Create a `LazyIterator` from an array of items.\n */\nexport function iteratorFromItems(items: T[]): LazyIterator {\n return new ArrayIterator(items);\n}\n\n/**\n * Create a `LazyIterator` of incrementing integers.\n */\nexport function iteratorFromIncrementing(start: number): LazyIterator {\n let i = start;\n return iteratorFromFunction(() => ({value: i++, done: false}));\n}\n\n/**\n * Create a `LazyIterator` from a function.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const iter = tf.data.iteratorFromFunction(func);\n * await iter.forEachAsync(e => console.log(e));\n * ```\n *\n * @param func A function that produces data on each call.\n */\nexport function iteratorFromFunction(\n func: () =>\n IteratorResult| Promise>): LazyIterator {\n return new FunctionCallIterator(func);\n}\n\n/**\n * Create a `LazyIterator` by concatenating underlying streams, which are\n * themselves provided as a stream.\n *\n * This can also be thought of as a \"stream flatten\" operation.\n *\n * @param baseIterators A stream of streams to be concatenated.\n * @param baseErrorHandler An optional function that can intercept `Error`s\n * raised during a `next()` call on the base stream. This function can decide\n * whether the error should be propagated, whether the error should be\n * ignored, or whether the base stream should be terminated.\n */\nexport function iteratorFromConcatenated(\n baseIterators: LazyIterator>,\n baseErrorHandler?: (e: Error) => boolean): LazyIterator {\n return new ChainedIterator(baseIterators, baseErrorHandler);\n}\n\n/**\n * Create a `LazyIterator` by concatenating streams produced by calling a\n * stream-generating function a given number of times.\n *\n * Since a `LazyIterator` is read-once, it cannot be repeated, but this\n * function can be used to achieve a similar effect:\n *\n * LazyIterator.ofConcatenatedFunction(() => new MyIterator(), 6);\n *\n * @param iteratorFunc: A function that produces a new stream on each call.\n * @param count: The number of times to call the function.\n * @param baseErrorHandler An optional function that can intercept `Error`s\n * raised during a `next()` call on the base stream. This function can decide\n * whether the error should be propagated, whether the error should be\n * ignored, or whether the base stream should be terminated.\n */\nexport function iteratorFromConcatenatedFunction(\n iteratorFunc: () => IteratorResult>, count: number,\n baseErrorHandler?: (e: Error) => boolean): LazyIterator {\n return iteratorFromConcatenated(\n iteratorFromFunction(iteratorFunc).take(count), baseErrorHandler);\n}\n\n/**\n * Create a `LazyIterator` by zipping together an array, dict, or nested\n * structure of `LazyIterator`s (and perhaps additional constants).\n *\n * The underlying streams must provide elements in a consistent order such\n * that they correspond.\n *\n * Typically, the underlying streams should have the same number of\n * elements. If they do not, the behavior is determined by the\n * `mismatchMode` argument.\n *\n * The nested structure of the `iterators` argument determines the\n * structure of elements in the resulting iterator.\n *\n * @param iterators: An array or object containing LazyIterators at the\n * leaves.\n * @param mismatchMode: Determines what to do when one underlying iterator\n * is exhausted before the others. `ZipMismatchMode.FAIL` (the default)\n * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST`\n * causes the zipped iterator to terminate with the furst underlying\n * streams, so elements remaining on the longer streams are ignored.\n * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling\n * in nulls for the exhausted streams, until all streams are exhausted.\n */\nexport function iteratorFromZipped(\n iterators: IteratorContainer,\n mismatchMode: ZipMismatchMode = ZipMismatchMode.FAIL): LazyIterator {\n return new ZipIterator(iterators, mismatchMode);\n}\n\n/**\n * An asynchronous iterator, providing lazy access to a potentially\n * unbounded stream of elements.\n *\n * Iterator can be obtained from a dataset:\n * `const iter = await dataset.iterator();`\n */\nexport abstract class LazyIterator {\n // This class implements AsyncIterator, but we have not yet set the\n // TypeScript --downlevelIteration flag to enable that.\n\n abstract summary(): string;\n\n /**\n * Returns a `Promise` for the next element in the stream.\n *\n * When an item can be provided successfully, the return value is\n * `{value:T, done:false}`.\n *\n * Calling next() on a closed stream returns `{value:null, done:true}`.\n */\n abstract async next(): Promise>;\n\n /**\n * Collect all remaining elements of a bounded stream into an array.\n * Obviously this will succeed only for small streams that fit in memory.\n * Useful for testing.\n *\n * @returns A Promise for an array of stream elements, which will resolve\n * when the stream is exhausted.\n */\n async toArray(): Promise {\n const result: T[] = [];\n let x = await this.next();\n while (!x.done) {\n result.push(x.value);\n x = await this.next();\n }\n return result;\n }\n\n /**\n * Collect all elements of this dataset into an array with prefetching 100\n * elements. This is useful for testing, because the prefetch changes the\n * order in which the Promises are resolved along the processing pipeline.\n * This may help expose bugs where results are dependent on the order of\n * Promise resolution rather than on the logical order of the stream (i.e.,\n * due to hidden mutable state).\n *\n * @returns A Promise for an array of stream elements, which will resolve\n * when the stream is exhausted.\n */\n async toArrayForTest(): Promise {\n const stream = this.prefetch(100);\n const result: T[] = [];\n let x = await stream.next();\n while (!x.done) {\n result.push(x.value);\n x = await stream.next();\n }\n return result;\n }\n\n /**\n * Draw items from the stream until it is exhausted.\n *\n * This can be useful when the stream has side effects but no output. In\n * that case, calling this function guarantees that the stream will be\n * fully processed.\n */\n async resolveFully(): Promise {\n let x = await this.next();\n while (!x.done) {\n x = await this.next();\n }\n }\n\n /**\n * Draw items from the stream until it is exhausted, or a predicate fails.\n *\n * This can be useful when the stream has side effects but no output. In\n * that case, calling this function guarantees that the stream will be\n * fully processed.\n */\n async resolveWhile(predicate: (r: T) => boolean): Promise {\n let x = await this.next();\n let shouldContinue = predicate(x.value);\n while ((!x.done) && shouldContinue) {\n x = await this.next();\n shouldContinue = predicate(x.value);\n }\n }\n\n /**\n * Handles errors thrown on this stream using a provided handler function.\n *\n * @param handler A function that handles any `Error` thrown during a `next()`\n * call and returns true if the stream should continue (dropping the failed\n * call) or false if the stream should quietly terminate. If the handler\n * itself throws (or rethrows) an `Error`, that will be propagated.\n *\n * @returns A `LazyIterator` of elements passed through from upstream,\n * possibly filtering or terminating on upstream `next()` calls that\n * throw an `Error`.\n */\n handleErrors(handler: (error: Error) => boolean): LazyIterator {\n return new ErrorHandlingLazyIterator(this, handler);\n }\n\n // TODO(soergel): Implement reduce() etc.\n\n /**\n * Filters this stream according to `predicate`.\n *\n * @param predicate A function mapping a stream element to a boolean or a\n * `Promise` for one.\n *\n * @returns A `LazyIterator` of elements for which the predicate was true.\n */\n filter(predicate: (value: T) => boolean): LazyIterator {\n return new FilterIterator(this, predicate);\n }\n\n /**\n * Maps this stream through a 1-to-1 transform.\n *\n * @param transform A function mapping a stream element to a transformed\n * element.\n *\n * @returns A `LazyIterator` of transformed elements.\n */\n map(transform: (value: T) => O): LazyIterator {\n return new MapIterator(this, transform);\n }\n\n /**\n * Maps this stream through an async 1-to-1 transform.\n *\n * @param transform A function mapping a stream element to a `Promise` for a\n * transformed stream element.\n *\n * @returns A `LazyIterator` of transformed elements.\n */\n mapAsync(transform: (value: T) => Promise): LazyIterator {\n return new AsyncMapIterator(this, transform);\n }\n\n /**\n * Maps this stream through a 1-to-1 transform, forcing serial execution.\n *\n * @param transform A function mapping a stream element to a transformed\n * element.\n *\n * @returns A `LazyIterator` of transformed elements.\n */\n serialMapAsync(transform: (value: T) => Promise): LazyIterator {\n return new AsyncMapIterator(this, transform).serial();\n }\n\n /**\n * Maps this stream through a 1-to-many transform.\n *\n * @param transform A function mapping a stream element to an array of\n * transformed elements.\n *\n * @returns A `DataStream` of transformed elements.\n */\n flatmap(transform: (value: T) => O[]): LazyIterator {\n return new FlatmapIterator(this, transform);\n }\n\n /**\n * Apply a function to every element of the stream.\n *\n * @param f A function to apply to each stream element.\n */\n async forEachAsync(f: (value: T) => void): Promise {\n return this.map(f).resolveFully();\n }\n\n /**\n * Apply a function to every element of the stream, forcing serial execution.\n *\n * @param f A function to apply to each stream element. Should return 'true'\n * to indicate that the stream should continue, or 'false' to cause it to\n * terminate.\n */\n async serialForEach(f: (value: T) => Promise): Promise {\n return this.serialMapAsync(f).resolveWhile(x => (x === true));\n }\n\n /**\n * Groups elements into batches, represented as arrays of elements.\n *\n * We can think of the elements of this iterator as 'rows' (even if they are\n * nested structures). By the same token, consecutive values for a given\n * key within the elements form a 'column'. This matches the usual sense of\n * 'row' and 'column' when processing tabular data (e.g., parsing a CSV).\n *\n * Thus, \"Row-major\" means that the resulting batch is simply a collection of\n * rows: `[row1, row2, row3, ...]`. This is contrast to the column-major\n * form, which is needed for vectorized computation.\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @returns A `LazyIterator` of batches of elements, represented as arrays\n * of the original element type.\n */\n rowMajorBatch(batchSize: number, smallLastBatch = true): LazyIterator {\n return new RowMajorBatchIterator(this, batchSize, smallLastBatch);\n }\n\n /**\n * Groups elements into batches, represented in column-major form.\n *\n * We can think of the elements of this iterator as 'rows' (even if they are\n * nested structures). By the same token, consecutive values for a given\n * key within the elements form a 'column'. This matches the usual sense of\n * 'row' and 'column' when processing tabular data (e.g., parsing a CSV).\n *\n * Thus, \"column-major\" means that the resulting batch is a (potentially\n * nested) structure representing the columns. Each column entry, then,\n * contains a collection of the values found in that column for a range of\n * input elements. This representation allows for vectorized computation, in\n * contrast to the row-major form.\n *\n * The inputs should all have the same nested structure (i.e., of arrays and\n * dicts). The result is a single object with the same nested structure,\n * where the leaves are arrays collecting the values of the inputs at that\n * location (or, optionally, the result of a custom function applied to those\n * arrays).\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @param zipFn: (optional) A function that expects an array of elements at a\n * single node of the object tree, and returns a `DeepMapResult`. The\n * `DeepMapResult` either provides a result value for that node (i.e.,\n * representing the subtree), or indicates that the node should be processed\n * recursively. The default zipFn recurses as far as possible and places\n * arrays at the leaves.\n * @returns A `LazyIterator` of batches of elements, represented as an object\n * with collections at the leaves.\n */\n columnMajorBatch(\n batchSize: number, smallLastBatch = true,\n // tslint:disable-next-line:no-any\n zipFn: (xs: any[]) => DeepMapResult = zipToList):\n LazyIterator {\n // First collect the desired number of input elements as a row-major batch.\n const rowBatches = this.rowMajorBatch(batchSize, smallLastBatch);\n // Now 'rotate' or 'pivot' the data, collecting all values from each column\n // in the batch (i.e., for each key within the elements) into an array.\n return rowBatches.map(x => deepZip(x, zipFn));\n }\n\n /**\n * Concatenate this `LazyIterator` with another.\n *\n * @param iterator A `LazyIterator` to be concatenated onto this one.\n * @param baseErrorHandler An optional function that can intercept `Error`s\n * raised during a `next()` call on the base stream. This function can\n * decide whether the error should be propagated, whether the error should\n * be ignored, or whether the base stream should be terminated.\n * @returns A `LazyIterator`.\n */\n concatenate(\n iterator: LazyIterator,\n baseErrorHandler?: (e: Error) => boolean): LazyIterator {\n return new ChainedIterator(\n iteratorFromItems([this, iterator]), baseErrorHandler);\n }\n\n /**\n * Limits this stream to return at most `count` items.\n *\n * @param count The maximum number of items to provide from the stream. If\n * a negative or undefined value is given, the entire stream is returned\n * unaltered.\n */\n take(count: number): LazyIterator {\n if (count < 0 || count == null) {\n return this;\n }\n return new TakeIterator(this, count);\n }\n\n /**\n * Skips the first `count` items in this stream.\n *\n * @param count The number of items to skip. If a negative or undefined\n * value is given, the entire stream is returned unaltered.\n */\n skip(count: number): LazyIterator {\n if (count < 0 || count == null) {\n return this;\n }\n return new SkipIterator(this, count);\n }\n\n /**\n * Prefetch the first `bufferSize` items in this stream.\n *\n * Note this prefetches Promises, but makes no guarantees about when those\n * Promises resolve.\n *\n * @param bufferSize: An integer specifying the number of elements to be\n * prefetched.\n */\n prefetch(bufferSize: number): LazyIterator {\n return new PrefetchIterator(this, bufferSize);\n }\n\n // TODO(soergel): deep sharded shuffle, where supported\n\n /**\n * Randomly shuffles the elements of this stream.\n *\n * @param bufferSize: An integer specifying the number of elements from\n * this stream from which the new stream will sample.\n * @param seed: (Optional.) An integer specifying the random seed that\n * will be used to create the distribution.\n */\n shuffle(windowSize: number, seed?: string): LazyIterator {\n return new ShuffleIterator(this, windowSize, seed);\n }\n\n /**\n * Force an iterator to execute serially: each next() call will await the\n * prior one, so that they cannot execute concurrently.\n */\n serial(): LazyIterator {\n return new SerialIterator(this);\n }\n}\n\n// ============================================================================\n// The following private classes serve to implement the chainable methods\n// on LazyIterator. Unfortunately they can't be placed in separate files,\n// due to resulting trouble with circular imports.\n// ============================================================================\n\n// Iterators that just extend LazyIterator directly\n// ============================================================================\n\nclass ArrayIterator extends LazyIterator {\n private trav = 0;\n constructor(protected items: T[]) {\n super();\n }\n\n summary() {\n return `Array of ${this.items.length} items`;\n }\n\n async next(): Promise> {\n if (this.trav >= this.items.length) {\n return {value: null, done: true};\n }\n const item = this.items[this.trav];\n this.trav++;\n return {value: deepClone(item), done: false};\n }\n}\n\nclass FunctionCallIterator extends LazyIterator {\n constructor(\n protected nextFn: () => IteratorResult| Promise>) {\n super();\n }\n\n summary() {\n return `Function call`;\n }\n\n async next(): Promise> {\n try {\n return this.nextFn();\n } catch (e) {\n // Modify the error message but leave the stack trace intact\n e.message =\n `Error thrown while iterating through a dataset: ${e.message}`;\n throw e;\n }\n }\n}\n\nclass SerialIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n constructor(protected upstream: LazyIterator) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> Serial`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n return this.upstream.next();\n }\n}\n\nclass SkipIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n // Local state that should not be clobbered by out-of-order execution.\n count = 0;\n\n constructor(protected upstream: LazyIterator, protected maxCount: number) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> Skip`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n // TODO(soergel): consider tradeoffs of reading in parallel, eg.\n // collecting next() promises in an Array and then waiting for\n // Promise.all() of those. Benefit: pseudo-parallel execution. Drawback:\n // maybe delayed GC.\n while (this.count++ < this.maxCount) {\n const skipped = await this.upstream.next();\n // short-circuit if upstream is already empty\n if (skipped.done) {\n return skipped;\n }\n tf.dispose(skipped.value as {});\n }\n return this.upstream.next();\n }\n}\n\nclass TakeIterator extends LazyIterator {\n count = 0;\n constructor(protected upstream: LazyIterator, protected maxCount: number) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Take`;\n }\n\n async next(): Promise> {\n if (this.count++ >= this.maxCount) {\n return {value: null, done: true};\n }\n return this.upstream.next();\n }\n}\n\n// Note this batch just groups items into row-wise element arrays.\n// Rotating these to a column-wise representation happens only at the dataset\n// level.\nclass RowMajorBatchIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n constructor(\n protected upstream: LazyIterator, protected batchSize: number,\n protected enableSmallLastBatch = true) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> RowMajorBatch`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n const batch: T[] = [];\n while (batch.length < this.batchSize) {\n const item = await this.upstream.next();\n if (item.done) {\n if (this.enableSmallLastBatch && batch.length > 0) {\n return {value: batch, done: false};\n }\n return {value: null, done: true};\n }\n batch.push(item.value);\n }\n return {value: batch, done: false};\n }\n}\n\nclass FilterIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n constructor(\n protected upstream: LazyIterator,\n protected predicate: (value: T) => boolean) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> Filter`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n while (true) {\n const item = await this.upstream.next();\n if (item.done || this.predicate(item.value)) {\n return item;\n }\n tf.dispose(item.value as {});\n }\n }\n}\n\nclass MapIterator extends LazyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected transform: (value: I) => O) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Map`;\n }\n\n async next(): Promise> {\n const item = await this.upstream.next();\n if (item.done) {\n return {value: null, done: true};\n }\n const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {});\n // Careful: the transform may mutate the item in place.\n // That's why we have to remember the input Tensors above, and then\n // below dispose only those that were not passed through to the output.\n // Note too that the transform function is responsible for tidying\n // any intermediate Tensors. Here we are concerned only about the\n // inputs.\n const mapped = this.transform(item.value);\n const outputTensors = tf.tensor_util.getTensorsInContainer(mapped as {});\n\n // TODO(soergel) faster intersection\n // TODO(soergel) move to tf.disposeExcept(in, out)?\n for (const t of inputTensors) {\n if (!tf.tensor_util.isTensorInList(t, outputTensors)) {\n t.dispose();\n }\n }\n return {value: mapped, done: false};\n }\n}\n\nclass ErrorHandlingLazyIterator extends LazyIterator {\n count = 0;\n constructor(\n protected upstream: LazyIterator,\n protected handler: (error: Error) => boolean) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> handleErrors`;\n }\n\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n async serialNext(): Promise> {\n while (true) {\n try {\n return await this.upstream.next();\n } catch (e) {\n if (!this.handler(e)) {\n return {value: null, done: true};\n }\n // If the handler returns true, loop and fetch the next upstream item.\n\n // If the upstream iterator throws an endless stream of errors, and if\n // the handler says to ignore them, then we loop forever here. That is\n // the correct behavior-- it's up to the handler to decide when to stop.\n }\n }\n }\n}\n\nclass AsyncMapIterator extends LazyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected transform: (value: I) => Promise) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> AsyncMap`;\n }\n\n async next(): Promise> {\n const item = await this.upstream.next();\n if (item.done) {\n return {value: null, done: true};\n }\n const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {});\n // Careful: the transform may mutate the item in place.\n // That's why we have to remember the input Tensors above, and then\n // below dispose only those that were not passed through to the output.\n // Note too that the transform function is responsible for tidying\n // any intermediate Tensors. Here we are concerned only about the\n // inputs.\n const mapped = await this.transform(item.value);\n const outputTensors = tf.tensor_util.getTensorsInContainer(mapped as {});\n\n // TODO(soergel) faster intersection\n // TODO(soergel) move to tf.disposeExcept(in, out)?\n for (const t of inputTensors) {\n if (!tf.tensor_util.isTensorInList(t, outputTensors)) {\n t.dispose();\n }\n }\n return {value: mapped, done: false};\n }\n}\n\n// Iterators that maintain a queue of pending items\n// ============================================================================\n\n/**\n * A base class for transforming streams that operate by maintaining an\n * output queue of elements that are ready to return via next(). This is\n * commonly required when the transformation is 1-to-many: A call to next()\n * may trigger a call to the underlying stream, which will produce many\n * mapped elements of this stream-- of which we need to return only one, so\n * we have to queue the rest.\n */\nexport abstract class OneToManyIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n // Local state that should not be clobbered by out-of-order execution.\n protected outputQueue: RingBuffer;\n\n constructor() {\n super();\n this.outputQueue = new GrowingRingBuffer();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n /**\n * Read one or more chunks from upstream and process them, possibly\n * reading or writing a carryover, and adding processed items to the\n * output queue. Note it's possible that no items are added to the queue\n * on a given pump() call, even if the upstream stream is not closed\n * (e.g., because items are filtered).\n *\n * @return `true` if any action was taken, i.e. fetching items from the\n * upstream source OR adding items to the output queue. `false` if the\n * upstream source is exhausted AND nothing was added to the queue\n * (i.e., any remaining carryover).\n */\n protected abstract async pump(): Promise;\n\n async serialNext(): Promise> {\n // Fetch so that the queue contains at least one item if possible.\n // If the upstream source is exhausted, AND there are no items left in\n // the output queue, then this stream is also exhausted.\n while (this.outputQueue.length() === 0) {\n // TODO(soergel): consider parallel reads.\n if (!await this.pump()) {\n return {value: null, done: true};\n }\n }\n return {value: this.outputQueue.shift(), done: false};\n }\n}\nclass FlatmapIterator extends OneToManyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected transform: (value: I) => O[]) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Flatmap`;\n }\n\n async pump(): Promise {\n const item = await this.upstream.next();\n if (item.done) {\n return false;\n }\n const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {});\n // Careful: the transform may mutate the item in place.\n // that's why we have to remember the input Tensors above, and then\n // below dispose only those that were not passed through to the output.\n // Note too that the transform function is responsible for tidying any\n // intermediate Tensors. Here we are concerned only about the inputs.\n const mappedArray = this.transform(item.value);\n const outputTensors =\n tf.tensor_util.getTensorsInContainer(mappedArray as {});\n this.outputQueue.pushAll(mappedArray);\n\n // TODO(soergel) faster intersection, and deduplicate outputTensors\n // TODO(soergel) move to tf.disposeExcept(in, out)?\n for (const t of inputTensors) {\n if (!tf.tensor_util.isTensorInList(t, outputTensors)) {\n t.dispose();\n }\n }\n\n return true;\n }\n}\n\n/**\n * Provides a `LazyIterator` that concatenates a stream of underlying\n * streams.\n *\n * Doing this in a concurrency-safe way requires some trickery. In\n * particular, we want this stream to return the elements from the\n * underlying streams in the correct order according to when next() was\n * called, even if the resulting Promises resolve in a different order.\n */\nexport class ChainedIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise> = null;\n\n // Local state that should not be clobbered by out-of-order execution.\n private iterator: LazyIterator = null;\n private moreIterators: LazyIterator>;\n\n constructor(\n iterators: LazyIterator>,\n private readonly baseErrorHandler?: (e: Error) => boolean) {\n super();\n this.moreIterators = iterators;\n }\n\n summary() {\n const upstreamSummaries = 'TODO: fill in upstream of chained summaries';\n return `${upstreamSummaries} -> Chained`;\n }\n\n async next(): Promise> {\n this.lastRead = this.readFromChain(this.lastRead);\n return this.lastRead;\n }\n\n private async readFromChain(lastRead: Promise>):\n Promise> {\n // Must await on the previous read since the previous read may have advanced\n // the stream of streams, from which we need to read.\n // This is unfortunate since we can't parallelize reads. Which means\n // prefetching of chained streams is a no-op.\n // One solution is to prefetch immediately upstream of this.\n await lastRead;\n if (this.iterator == null) {\n const iteratorResult = await this.moreIterators.next();\n if (iteratorResult.done) {\n // No more streams to stream from.\n return {value: null, done: true};\n }\n this.iterator = iteratorResult.value;\n if (this.baseErrorHandler != null) {\n this.iterator = this.iterator.handleErrors(this.baseErrorHandler);\n }\n }\n const itemResult = await this.iterator.next();\n if (itemResult.done) {\n this.iterator = null;\n return this.readFromChain(lastRead);\n }\n return itemResult;\n }\n}\n\nexport enum ZipMismatchMode {\n FAIL, // require zipped streams to have the same length\n SHORTEST, // terminate zip when the first stream is exhausted\n LONGEST // use nulls for exhausted streams; use up the longest stream.\n}\n\n/**\n * Provides a `LazyIterator` that zips together an array, dict, or nested\n * structure of `LazyIterator`s (and perhaps additional constants).\n *\n * The underlying streams must provide elements in a consistent order such\n * that they correspond.\n *\n * Typically, the underlying streams should have the same number of\n * elements. If they do not, the behavior is determined by the\n * `mismatchMode` argument.\n *\n * The nested structure of the `iterators` argument determines the\n * structure of elements in the resulting iterator.\n *\n * Doing this in a concurrency-safe way requires some trickery. In\n * particular, we want this stream to return the elements from the\n * underlying streams in the correct order according to when next() was\n * called, even if the resulting Promises resolve in a different order.\n *\n * @param iterators: An array or object containing LazyIterators at the\n * leaves.\n * @param mismatchMode: Determines what to do when one underlying iterator\n * is exhausted before the others. `ZipMismatchMode.FAIL` (the default)\n * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST`\n * causes the zipped iterator to terminate with the furst underlying\n * streams, so elements remaining on the longer streams are ignored.\n * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling\n * in nulls for the exhausted streams, until all streams are exhausted.\n */\nclass ZipIterator extends LazyIterator {\n private count = 0;\n private currentPromise: Promise> = null;\n\n constructor(\n protected readonly iterators: IteratorContainer,\n protected readonly mismatchMode: ZipMismatchMode = ZipMismatchMode.FAIL) {\n super();\n }\n\n summary() {\n const upstreamSummaries = 'TODO: fill in upstream of zip summaries';\n return `{${upstreamSummaries}} -> Zip`;\n }\n\n private async nextState(afterState: Promise>):\n Promise> {\n // This chaining ensures that the underlying next() are not even called\n // before the previous ones have resolved.\n await afterState;\n\n // Collect underlying iterator \"done\" signals as a side effect in\n // getNext()\n let numIterators = 0;\n let iteratorsDone = 0;\n\n function getNext(container: IteratorContainer): DeepMapAsyncResult {\n if (container instanceof LazyIterator) {\n const result = container.next();\n return {\n value: result.then(x => {\n numIterators++;\n if (x.done) {\n iteratorsDone++;\n }\n return x.value;\n }),\n recurse: false\n };\n } else {\n return {value: null, recurse: true};\n }\n }\n\n const mapped: O = await deepMapAndAwaitAll(this.iterators, getNext);\n\n if (numIterators === iteratorsDone) {\n // The streams have all ended.\n return {value: null, done: true};\n }\n if (iteratorsDone > 0) {\n switch (this.mismatchMode) {\n case ZipMismatchMode.FAIL:\n throw new Error(\n 'Zipped streams should have the same length. ' +\n `Mismatched at element ${this.count}.`);\n case ZipMismatchMode.SHORTEST:\n return {value: null, done: true};\n case ZipMismatchMode.LONGEST:\n default:\n // Continue. The exhausted streams already produced value: null.\n }\n }\n\n this.count++;\n return {value: mapped, done: false};\n }\n\n async next(): Promise> {\n this.currentPromise = this.nextState(this.currentPromise);\n return this.currentPromise;\n }\n}\n\n// Iterators that maintain a ring buffer of pending promises\n// ============================================================================\n\n/**\n * A stream that prefetches a given number of items from an upstream source,\n * returning them in FIFO order.\n *\n * Note this prefetches Promises, but makes no guarantees about when those\n * Promises resolve.\n */\nexport class PrefetchIterator extends LazyIterator {\n protected buffer: RingBuffer>>;\n\n constructor(\n protected upstream: LazyIterator, protected bufferSize: number) {\n super();\n this.buffer = new RingBuffer>>(bufferSize);\n }\n\n summary() {\n return `${this.upstream.summary()} -> Prefetch`;\n }\n\n /**\n * Refill the prefetch buffer. Returns only after the buffer is full, or\n * the upstream source is exhausted.\n */\n protected refill() {\n while (!this.buffer.isFull()) {\n const v = this.upstream.next();\n this.buffer.push(v);\n }\n }\n\n next(): Promise> {\n this.refill();\n // This shift will never throw an error because the buffer is always\n // full after a refill. If the stream is exhausted, the buffer will be\n // full of Promises that will resolve to the end-of-stream signal.\n return this.buffer.shift();\n }\n}\n\n/**\n * A stream that performs a sliding-window random shuffle on an upstream\n * source. This is like a `PrefetchIterator` except that the items are\n * returned in randomized order. Mixing naturally improves as the buffer\n * size increases.\n */\nexport class ShuffleIterator extends PrefetchIterator {\n private readonly random: seedrandom.prng;\n\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n // Local state that should not be clobbered by out-of-order execution.\n private upstreamExhausted = false;\n\n constructor(\n protected upstream: LazyIterator, protected windowSize: number,\n seed?: string) {\n super(upstream, windowSize);\n this.random = seedrandom.alea(seed || tf.util.now().toString());\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private randomInt(max: number) {\n return Math.floor(this.random() * max);\n }\n\n protected chooseIndex(): number {\n return this.randomInt(this.buffer.length());\n }\n\n async serialNext(): Promise> {\n // TODO(soergel): consider performance\n if (!this.upstreamExhausted) {\n this.refill();\n }\n while (!this.buffer.isEmpty()) {\n const chosenIndex = this.chooseIndex();\n const result = await this.buffer.shuffleExcise(chosenIndex);\n if (result.done) {\n this.upstreamExhausted = true;\n } else {\n this.refill();\n return result;\n }\n }\n return {value: null, done: true};\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport {TensorContainer, TensorLike} from '@tensorflow/tfjs-core';\nimport * as seedrandom from 'seedrandom';\n\nimport {iteratorFromConcatenated, iteratorFromFunction, iteratorFromItems, iteratorFromZipped, LazyIterator, ZipMismatchMode} from './iterators/lazy_iterator';\nimport {Container} from './types';\nimport {canTensorify, deepMapAndAwaitAll, DeepMapResult, isIterable} from './util/deep_map';\n\n/**\n * A nested structure of Datasets, used as the input to zip().\n */\nexport type DatasetContainer = Container>;\n\n// TODO(soergel): consider vectorized operations within the pipeline.\n\n/**\n * Represents a potentially large list of independent data elements (typically\n * 'samples' or 'examples').\n *\n * A 'data example' may be a primitive, an array, a map from string keys to\n * values, or any nested structure of these.\n *\n * A `Dataset` represents an ordered collection of elements, together with a\n * chain of transformations to be performed on those elements. Each\n * transformation is a method of `Dataset` that returns another `Dataset`, so\n * these may be chained, e.g.\n * `const processedDataset = rawDataset.filter(...).map(...).batch(...)`.\n *\n * Data loading and transformation is done in a lazy, streaming fashion. The\n * dataset may be iterated over multiple times; each iteration starts the data\n * loading anew and recapitulates the transformations.\n *\n * A `Dataset` is typically processed as a stream of unbatched examples --i.e.,\n * its transformations are applied one example at a time. Batching produces a\n * new `Dataset` where each element is a batch. Batching should usually come\n * last in a pipeline, because data transformations are easier to express on a\n * per-example basis than on a per-batch basis.\n *\n * The following code examples are calling `await dataset.forEachAsync(...)` to\n * iterate once over the entire dataset in order to print out the data.\n *\n * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'}\n */\nexport abstract class Dataset {\n /*\n * Provide a new stream of elements. Note this will also start new streams\n * from any underlying `Dataset`s.\n *\n * CAUTION: Any Tensors contained within the elements returned from\n * this stream *must* be manually disposed to avoid a GPU memory leak.\n * The tf.tidy() approach cannot be used in an asynchronous context.\n */\n abstract async iterator(): Promise>;\n\n readonly size: number = null;\n\n // TODO(soergel): Make Datasets report whether repeated iterator() calls\n // produce the same result (e.g., reading from a file) or different results\n // (e.g., from the webcam). Currently we don't make this distinction but it\n // could be important for the user to know.\n // abstract isDeterministic(): boolean;\n\n /**\n * Groups elements into batches.\n *\n * It is assumed that each of the incoming dataset elements has the same\n * structure-- i.e. the same set of keys at each location in an object\n * hierarchy. For each key, the resulting `Dataset` provides a batched\n * element collecting all of the incoming values for that key.\n *\n * * Incoming primitives are grouped into a 1-D Tensor.\n * * Incoming Tensors are grouped into a new Tensor where the 0'th axis is\n * the batch dimension.\n * * Incoming arrays are converted to Tensor and then batched.\n * * A nested array is interpreted as an n-D Tensor, so the batched result\n * has n+1 dimensions.\n * * An array that cannot be converted to Tensor produces an error.\n *\n * If an array should not be batched as a unit, it should first be converted\n * to an object with integer keys.\n *\n * Here are a few examples:\n *\n * Batch a dataset of numbers:\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8]).batch(4);\n * await a.forEachAsync(e => e.print());\n * ```\n *\n * Batch a dataset of arrays:\n * ```js\n * const b = tf.data.array([[1], [2], [3], [4], [5], [6], [7], [8]]).batch(4);\n * await b.forEachAsync(e => e.print());\n * ```\n *\n * Batch a dataset of objects:\n * ```js\n * const c = tf.data.array([{a: 1, b: 11}, {a: 2, b: 12}, {a: 3, b: 13},\n * {a: 4, b: 14}, {a: 5, b: 15}, {a: 6, b: 16}, {a: 7, b: 17},\n * {a: 8, b: 18}]).batch(4);\n * await c.forEachAsync(e => {\n * console.log('{');\n * for(var key in e) {\n * console.log(key+':');\n * e[key].print();\n * }\n * console.log('}');\n * })\n * ```\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @returns A `Dataset`, from which a stream of batches can be obtained.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n batch(batchSize: number, smallLastBatch = true): Dataset {\n const base = this;\n tf.util.assert(\n batchSize > 0, () => `batchSize needs to be positive, but it is\n ${batchSize}`);\n let size;\n if (this.size === Infinity || this.size == null) {\n // If the size of this dataset is infinity or null, the new size keeps the\n // same.\n size = this.size;\n } else if (smallLastBatch) {\n // If the size of this dataset is known and include small last batch, the\n // new size is full batch count plus last batch.\n size = Math.ceil(this.size / batchSize);\n } else {\n // If the size of this dataset is known and not include small last batch,\n // the new size is full batch count.\n size = Math.floor(this.size / batchSize);\n }\n return datasetFromIteratorFn(async () => {\n return (await base.iterator())\n .columnMajorBatch(batchSize, smallLastBatch, deepBatchConcat);\n }, size);\n }\n\n /**\n * Concatenates this `Dataset` with another.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]);\n * const b = tf.data.array([4, 5, 6]);\n * const c = a.concatenate(b);\n * await c.forEachAsync(e => console.log(e));\n * ```\n *\n * @param dataset A `Dataset` to be concatenated onto this one.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n concatenate(dataset: Dataset): Dataset {\n const base = this;\n let size;\n if (this.size === Infinity || dataset.size === Infinity) {\n // If the size of any of these two dataset is infinity, new size is\n // infinity.\n size = Infinity;\n } else if (this.size != null && dataset.size != null) {\n // If the size of both datasets are known and not infinity, new size is\n // sum the size of these two datasets.\n size = this.size + dataset.size;\n } else {\n // If neither of these two datasets has infinite size and any of these two\n // datasets' size is null, the new size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () =>\n (await base.iterator()).concatenate(await dataset.iterator()),\n size);\n }\n\n /**\n * Filters this dataset according to `predicate`.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])\n * .filter(x => x%2 === 0);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param predicate A function mapping a dataset element to a boolean or a\n * `Promise` for one.\n *\n * @returns A `Dataset` of elements for which the predicate was true.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n filter(predicate: (value: T) => boolean): Dataset {\n const base = this;\n let size;\n if (this.size === Infinity) {\n // If the size of this dataset is infinity, new size is infinity\n size = Infinity;\n } else {\n // If this dataset has limited elements, new size is null because it might\n // exhausted randomly.\n size = null;\n }\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).filter(x => tf.tidy(() => predicate(x)));\n }, size);\n }\n\n /**\n * Apply a function to every element of the dataset.\n *\n * After the function is applied to a dataset element, any Tensors contained\n * within that element are disposed.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param f A function to apply to each dataset element.\n * @returns A `Promise` that resolves after all elements have been processed.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async forEachAsync(f: (input: T) => void): Promise {\n return (await this.iterator()).forEachAsync(f);\n }\n\n /**\n * Maps this dataset through a 1-to-1 transform.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]).map(x => x*x);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param transform A function mapping a dataset element to a transformed\n * dataset element.\n *\n * @returns A `Dataset` of transformed elements.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n map(transform: (value: T) => O): Dataset {\n const base = this;\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).map(x => tf.tidy(() => transform(x)));\n }, this.size);\n }\n\n /**\n * Maps this dataset through an async 1-to-1 transform.\n *\n * ```js\n * const a =\n * tf.data.array([1, 2, 3]).mapAsync(x => new Promise(function(resolve){\n * setTimeout(() => {\n * resolve(x * x);\n * }, Math.random()*1000 + 500);\n * }));\n * console.log(await a.toArray());\n * ```\n *\n * @param transform A function mapping a dataset element to a `Promise` for a\n * transformed dataset element. This transform is responsible for disposing\n * any intermediate `Tensor`s, i.e. by wrapping its computation in\n * `tf.tidy()`; that cannot be automated here (as it is in the synchronous\n * `map()` case).\n *\n * @returns A `Dataset` of transformed elements.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n mapAsync(transform: (value: T) => Promise):\n Dataset {\n const base = this;\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).mapAsync(transform);\n }, this.size);\n }\n\n /**\n * Creates a `Dataset` that prefetches elements from this dataset.\n *\n * @param bufferSize: An integer specifying the number of elements to be\n * prefetched.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n prefetch(bufferSize: number): Dataset {\n if (bufferSize == null) {\n throw new RangeError(\n '`Dataset.prefetch()` requires bufferSize to be specified.');\n }\n\n const base = this;\n return datasetFromIteratorFn(\n async () => (await base.iterator()).prefetch(bufferSize), this.size);\n }\n\n /**\n * Repeats this dataset `count` times.\n *\n * NOTE: If this dataset is a function of global state (e.g. a random number\n * generator), then different repetitions may produce different elements.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]).repeat(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: (Optional) An integer, representing the number of times\n * the dataset should be repeated. The default behavior (if `count` is\n * `undefined` or negative) is for the dataset be repeated indefinitely.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n repeat(count?: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && count > 0) {\n // If this dataset has size and count is positive, new size is current\n // size multiply count. This also covers the case that current size is\n // infinity.\n size = this.size * count;\n } else if (count === 0) {\n // If count is 0, new size is 0.\n size = 0;\n } else if (this.size != null && (count === undefined || count < 0)) {\n // If this dataset has size and count is undefined or negative, the\n // dataset will be repeated indefinitely and new size is infinity.\n size = Infinity;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(async () => {\n const iteratorIterator = iteratorFromFunction(\n async () => ({value: await base.iterator(), done: false}));\n return iteratorFromConcatenated(iteratorIterator.take(count));\n }, size);\n }\n\n /**\n * Creates a `Dataset` that skips `count` initial elements from this dataset.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).skip(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: The number of elements of this dataset that should be skipped\n * to form the new dataset. If `count` is greater than the size of this\n * dataset, the new dataset will contain no elements. If `count`\n * is `undefined` or negative, skips the entire dataset.\n *\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n skip(count: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && count >= 0 && this.size >= count) {\n // If the size of this dataset is greater than count, the new dataset's\n // size is current size minus skipped size.This also covers the case that\n // current size is infinity.\n size = this.size - count;\n } else if (\n this.size != null &&\n (this.size < count || count === undefined || count < 0)) {\n // If the size of this dataset is smaller than count, or count is\n // undefined or negative, skips the entire dataset and the new size is 0.\n size = 0;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () => (await base.iterator()).skip(count), size);\n }\n\n // TODO(soergel): deep sharded shuffle, where supported\n\n static readonly MAX_BUFFER_SIZE = 10000;\n\n /**\n * Pseudorandomly shuffles the elements of this dataset. This is done in a\n * streaming manner, by sampling from a given number of prefetched elements.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).shuffle(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param bufferSize: An integer specifying the number of elements from this\n * dataset from which the new dataset will sample.\n * @param seed: (Optional) An integer specifying the random seed that will\n * be used to create the distribution.\n * @param reshuffleEachIteration: (Optional) A boolean, which if true\n * indicates that the dataset should be pseudorandomly reshuffled each time\n * it is iterated over. If false, elements will be returned in the same\n * shuffled order on each iteration. (Defaults to `true`.)\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n shuffle(bufferSize: number, seed?: string, reshuffleEachIteration = true):\n Dataset {\n if (bufferSize == null || bufferSize < 0) {\n if (this.size == null) {\n throw new RangeError(\n '`Dataset.shuffle()` requires bufferSize to be specified.');\n } else {\n throw new RangeError(\n '`Dataset.shuffle()` requires bufferSize to be specified. ' +\n 'If your data fits in main memory (for regular JS objects), ' +\n 'and/or GPU memory (for `tf.Tensor`s), consider setting ' +\n `bufferSize to the dataset size (${this.size} elements)`);\n }\n }\n const base = this;\n const random = seedrandom.alea(seed || tf.util.now().toString());\n return datasetFromIteratorFn(async () => {\n let seed2 = random.int32();\n if (reshuffleEachIteration) {\n seed2 += random.int32();\n }\n return (await base.iterator()).shuffle(bufferSize, seed2.toString());\n }, this.size);\n }\n\n /**\n * Creates a `Dataset` with at most `count` initial elements from this\n * dataset.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).take(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: The number of elements of this dataset that should be taken\n * to form the new dataset. If `count` is `undefined` or negative, or if\n * `count` is greater than the size of this dataset, the new dataset will\n * contain all elements of this dataset.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n take(count: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && this.size > count) {\n // If the size of this dataset is greater than count, the new dataset's\n // size is count.\n size = count;\n } else if (this.size != null && this.size <= count) {\n // If the size of this dataset is equal or smaller than count, the new\n // dataset's size is the size of this dataset.\n size = this.size;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () => (await base.iterator()).take(count), size);\n }\n\n /**\n * Collect all elements of this dataset into an array.\n *\n * Obviously this will succeed only for small datasets that fit in memory.\n * Useful for testing and generally should be avoided if possible.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]);\n * console.log(await a.toArray());\n * ```\n *\n * @returns A Promise for an array of elements, which will resolve\n * when a new stream has been obtained and fully consumed.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async toArray() {\n if (this.size === Infinity) {\n throw new Error('Can not convert infinite data stream to array.');\n }\n return (await this.iterator()).toArray();\n }\n\n /**\n * Collect all elements of this dataset into an array with prefetching 100\n * elements. This is useful for testing, because the prefetch changes the\n * order in which the Promises are resolved along the processing pipeline.\n * This may help expose bugs where results are dependent on the order of\n * Promise resolution rather than on the logical order of the stream (i.e.,\n * due to hidden mutable state).\n *\n * @returns A Promise for an array of elements, which will resolve\n * when a new stream has been obtained and fully consumed.\n */\n async toArrayForTest() {\n if (this.size === Infinity) {\n throw new Error('Can not convert infinite data stream to array.');\n }\n return (await this.iterator()).toArrayForTest();\n }\n}\n\n/**\n * Create a `Dataset` defined by a provided iterator() function.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const iter = tf.data.iteratorFromFunction(func);\n * const ds = tf.data.datasetFromIteratorFn(iter);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n */\nexport function datasetFromIteratorFn(\n iteratorFn: () => Promise>,\n size: number = null): Dataset {\n return new class extends Dataset {\n size = size;\n\n /*\n * Provide a new stream of elements. Note this will also start new streams\n * from any underlying `Dataset`s.\n */\n async iterator(): Promise> {\n return iteratorFn();\n }\n }\n ();\n}\n\n/**\n * Create a `Dataset` from an array of elements.\n *\n * Create a Dataset from an array of objects:\n * ```js\n * const a = tf.data.array([{'item': 1}, {'item': 2}, {'item': 3}]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * Create a Dataset from an array of numbers:\n * ```js\n * const a = tf.data.array([4, 5, 6]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n * @param items An array of elements that will be parsed as items in a dataset.\n *\n * @doc {heading: 'Data', subheading: 'Creation', namespace: 'data'}\n */\nexport function array(items: T[]): Dataset {\n return datasetFromIteratorFn(\n async () => iteratorFromItems(items), items.length);\n}\n\n/**\n * Create a `Dataset` by zipping together an array, dict, or nested\n * structure of `Dataset`s (and perhaps additional constants).\n * The underlying datasets must provide elements in a consistent order such that\n * they correspond.\n *\n * The number of elements in the resulting dataset is the same as the size of\n * the smallest dataset in datasets.\n *\n * The nested structure of the `datasets` argument determines the\n * structure of elements in the resulting iterator.\n *\n * Note this means that, given an array of two datasets that produce dict\n * elements, the result is a dataset that produces elements that are arrays\n * of two dicts:\n *\n * Zip an array of datasets:\n * ```js\n * console.log('Zip two datasets of objects:');\n * const ds1 = tf.data.array([{a: 1}, {a: 2}, {a: 3}]);\n * const ds2 = tf.data.array([{b: 4}, {b: 5}, {b: 6}]);\n * const ds3 = tf.data.zip([ds1, ds2]);\n * await ds3.forEachAsync(e => console.log(JSON.stringify(e)));\n *\n * // If the goal is to merge the dicts in order to produce elements like\n * // {a: ..., b: ...}, this requires a second step such as:\n * console.log('Merge the objects:');\n * const ds4 = ds3.map(x => {return {a: x[0].a, b: x[1].b}});\n * await ds4.forEachAsync(e => console.log(e));\n * ```\n *\n * Zip a dict of datasets:\n * ```js\n * const a = tf.data.array([{a: 1}, {a: 2}, {a: 3}]);\n * const b = tf.data.array([{b: 4}, {b: 5}, {b: 6}]);\n * const c = tf.data.zip({c: a, d: b});\n * await c.forEachAsync(e => console.log(JSON.stringify(e)));\n * ```\n *\n * @doc {heading: 'Data', subheading: 'Operations', namespace: 'data'}\n */\nexport function zip(datasets: DatasetContainer):\n Dataset {\n // manually type-check the argument for JS users\n if (!isIterable(datasets)) {\n throw new Error('The argument to zip() must be an object or array.');\n }\n let size;\n if (Array.isArray(datasets)) {\n for (let i = 0; i < datasets.length; i++) {\n size = size == null ? (datasets[i] as Dataset).size :\n Math.min(size, (datasets[i] as Dataset).size);\n }\n } else if (datasets instanceof Object) {\n for (const ds in datasets) {\n size = size == null ? (datasets[ds] as Dataset).size :\n Math.min(size, (datasets[ds] as Dataset).size);\n }\n }\n return datasetFromIteratorFn(async () => {\n const streams = await deepMapAndAwaitAll(datasets, d => {\n if (d instanceof Dataset) {\n return {value: d.iterator(), recurse: false};\n } else if (isIterable(d)) {\n return {value: null, recurse: true};\n } else {\n throw new Error(\n 'Leaves of the structure passed to zip() must be Datasets, ' +\n 'not primitives.');\n }\n });\n return iteratorFromZipped(streams, ZipMismatchMode.SHORTEST);\n }, size);\n}\n\n/**\n * A zip function for use with deepZip, passed via the columnMajorBatch call.\n *\n * Accepts an array of identically-structured nested elements and either batches\n * them (if they are primitives, numeric arrays, or Tensors) or requests\n * recursion (if not).\n */\n// tslint:disable-next-line:no-any\nfunction deepBatchConcat(rows: any[]): DeepMapResult {\n if (rows === null) {\n return null;\n }\n\n // use the first item to decide whether to recurse or batch here.\n const exampleRow = rows[0];\n\n if (canTensorify(exampleRow)) {\n // rows is an array of primitives, Tensors, or arrays. Batch them.\n const value = batchConcat(rows);\n return {value, recurse: false};\n }\n\n // the example row is an object, so recurse into it.\n return {value: null, recurse: true};\n}\n\n/**\n * Assembles a list of same-shaped numbers, number arrays, or Tensors\n * into a single new Tensor where axis 0 is the batch dimension.\n */\nfunction batchConcat(arrays: T[]):\n tf.Tensor {\n if (arrays.length === 0) {\n // We can't return an empty Tensor because we don't know the element shape.\n throw new Error('Can\\'t make a batch of zero elements.');\n }\n\n if (arrays[0] instanceof tf.Tensor) {\n // Input is an array of Tensors\n return tf.stack(arrays as tf.Tensor[]);\n } else {\n // Input is a possibly-nested array of numbers.\n return tf.tensor(arrays as TensorLike);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {Dataset} from '../dataset';\nimport {DataSource} from '../datasource';\nimport {LazyIterator} from '../iterators/lazy_iterator';\n\n/**\n * Represents a potentially large collection of text lines.\n *\n * The results are not batched.\n */\nexport class TextLineDataset extends Dataset {\n /**\n * Create a `TextLineDataset`.\n *\n * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream.\n */\n constructor(protected readonly input: DataSource) {\n super();\n }\n\n async iterator(): Promise> {\n const inputIterator = await this.input.iterator();\n const utf8Iterator = inputIterator.decodeUTF8();\n const lineIterator = utf8Iterator.split('\\n').map(line => {\n // Windows/DOS format text file has extra line breaker at the end of line.\n if (line.endsWith('\\r')) {\n line = line.slice(0, -1);\n }\n return line;\n });\n return lineIterator;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {TensorContainer, util} from '@tensorflow/tfjs-core';\nimport {Dataset} from '../dataset';\nimport {DataSource} from '../datasource';\nimport {LazyIterator} from '../iterators/lazy_iterator';\nimport {ColumnConfig, CSVConfig} from '../types';\nimport {TextLineDataset} from './text_line_dataset';\n\nconst CODE_QUOTE = '\"';\nconst STATE_OUT = Symbol('out');\nconst STATE_FIELD = Symbol('field');\nconst STATE_QUOTE = Symbol('quote');\nconst STATE_QUOTE_AFTER_QUOTE = Symbol('quoteafterquote');\nconst STATE_WITHIN_QUOTE_IN_QUOTE = Symbol('quoteinquote');\n\n/**\n * Represents a potentially large collection of delimited text records.\n *\n * The produced `TensorContainer`s each contain one key-value pair for\n * every column of the table. When a field is empty in the incoming data, the\n * resulting value is `undefined`, or throw error if it is required. Values\n * that can be parsed as numbers are emitted as type `number`, other values\n * are parsed as `string`.\n *\n * The results are not batched.\n *\n * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'}\n */\nexport class CSVDataset extends Dataset {\n base: TextLineDataset;\n private hasHeader = true;\n private fullColumnNames: string[] = null;\n private columnNamesValidated = false;\n private columnConfigs: {[key: string]: ColumnConfig} = null;\n private configuredColumnsOnly = false;\n private delimiter = ',';\n private delimWhitespace = false;\n\n /**\n * Returns column names of the csv dataset. If `configuredColumnsOnly` is\n * true, return column names in `columnConfigs`. If `configuredColumnsOnly` is\n * false and `columnNames` is provided, `columnNames`. If\n * `configuredColumnsOnly` is false and `columnNames` is not provided, return\n * all column names parsed from the csv file. For example usage please go to\n * `tf.data.csv`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async columnNames() {\n if (!this.columnNamesValidated) {\n await this.setColumnNames();\n }\n return this.configuredColumnsOnly ? Object.keys(this.columnConfigs) :\n this.fullColumnNames;\n }\n\n /* 1) If `columnNames` is provided as string[], use this string[] as output\n * keys in corresponding order. The length must match the number of inferred\n * columns if `hasHeader` is true .\n * 2) If `columnNames` is not provided, parse header line as `columnNames` if\n * hasHeader is true. If `hasHeader` is false, throw an error.\n * 3) If `columnConfigs` is provided, all the keys in `columnConfigs` must\n * exist in parsed `columnNames`.\n */\n private async setColumnNames() {\n const columnNamesFromFile = await this.maybeReadHeaderLine();\n if (!this.fullColumnNames && !columnNamesFromFile) {\n // Throw an error if columnNames is not provided and no header line.\n throw new Error(\n 'Column names must be provided if there is no header line.');\n } else if (this.fullColumnNames && columnNamesFromFile) {\n // Check provided columnNames match header line.\n util.assert(\n columnNamesFromFile.length === this.fullColumnNames.length,\n () => 'The length of provided columnNames (' +\n this.fullColumnNames.length.toString() +\n ') does not match the length of the header line read from ' +\n 'file (' + columnNamesFromFile.length.toString() + ').');\n }\n if (!this.fullColumnNames) {\n this.fullColumnNames = columnNamesFromFile;\n }\n // Check if there are duplicate column names.\n const counts: {[key: string]: number} = this.fullColumnNames.reduce(\n (countAcc: {[key: string]: number}, name) => {\n countAcc[name] = (countAcc[name] + 1) || 1;\n return countAcc;\n },\n {});\n const duplicateNames =\n Object.keys(counts).filter((name) => (counts[name] > 1));\n util.assert(\n duplicateNames.length === 0,\n () => 'Duplicate column names found: ' + duplicateNames.toString());\n // Check if keys in columnConfigs match columnNames.\n if (this.columnConfigs) {\n for (const key of Object.keys(this.columnConfigs)) {\n const index = this.fullColumnNames.indexOf(key);\n if (index === -1) {\n throw new Error(\n 'The key \"' + key +\n '\" provided in columnConfigs does not match any of the column ' +\n 'names (' + this.fullColumnNames.toString() + ').');\n }\n }\n }\n this.columnNamesValidated = true;\n }\n\n private async maybeReadHeaderLine() {\n if (this.hasHeader) {\n const iter = await this.base.iterator();\n const firstElement = await iter.next();\n if (firstElement.done) {\n throw new Error('No data was found for CSV parsing.');\n }\n const firstLine: string = firstElement.value;\n const headers = this.parseRow(firstLine, false);\n return headers;\n } else {\n return null;\n }\n }\n\n /**\n * Create a `CSVDataset`.\n *\n * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream.\n * @param csvConfig (Optional) A CSVConfig object that contains configurations\n * of reading and decoding from CSV file(s).\n *\n * hasHeader: (Optional) A boolean value that indicates whether the first\n * row of provided CSV file is a header line with column names, and should\n * not be included in the data. Defaults to `true`.\n *\n * columnNames: (Optional) A list of strings that corresponds to\n * the CSV column names, in order. If provided, it ignores the column\n * names inferred from the header row. If not provided, infers the column\n * names from the first row of the records. If hasHeader is false and\n * columnNames is not provided, this method throws an error.\n *\n * columnConfigs: (Optional) A dictionary whose key is column names, value\n * is an object stating if this column is required, column's data type,\n * default value, and if this column is label. If provided, keys must\n * correspond to names provided in columnNames or inferred from the file\n * header lines. If isLabel is true any column, returns an array of two\n * items: the first item is a dict of features key/value pairs, the second\n * item is a dict of labels key/value pairs. If no feature is marked as\n * label, returns a dict of features only.\n *\n * configuredColumnsOnly (Optional) If true, only columns provided in\n * columnConfigs will be parsed and provided during iteration.\n *\n * delimiter (Optional) The string used to parse each line of the input\n * file. Defaults to `,`.\n */\n constructor(protected readonly input: DataSource, csvConfig?: CSVConfig) {\n super();\n this.base = new TextLineDataset(input);\n if (!csvConfig) {\n csvConfig = {};\n }\n this.hasHeader = csvConfig.hasHeader === false ? false : true;\n this.fullColumnNames = csvConfig.columnNames;\n this.columnConfigs = csvConfig.columnConfigs;\n this.configuredColumnsOnly = csvConfig.configuredColumnsOnly;\n if (csvConfig.delimWhitespace) {\n util.assert(\n csvConfig.delimiter == null,\n () =>\n 'Delimiter should not be provided when delimWhitespace is true.');\n this.delimWhitespace = true;\n this.delimiter = ' ';\n } else {\n this.delimiter = csvConfig.delimiter ? csvConfig.delimiter : ',';\n }\n }\n\n async iterator(): Promise> {\n if (!this.columnNamesValidated) {\n await this.setColumnNames();\n }\n let lines = await this.base.iterator();\n if (this.hasHeader) {\n // We previously read the first line to get the columnNames.\n // Now that we're providing data, skip it.\n lines = lines.skip(1);\n }\n return lines.map(x => this.makeDataElement(x));\n }\n\n makeDataElement(line: string): TensorContainer {\n const values = this.parseRow(line);\n const features: {[key: string]: TensorContainer} = {};\n const labels: {[key: string]: TensorContainer} = {};\n\n for (let i = 0; i < this.fullColumnNames.length; i++) {\n const key = this.fullColumnNames[i];\n const config = this.columnConfigs ? this.columnConfigs[key] : null;\n if (this.configuredColumnsOnly && !config) {\n // This column is not selected.\n continue;\n } else {\n const value = values[i];\n let parsedValue = null;\n if (value === '') {\n // If default value is provided, use it. If default value is not\n // provided, set as undefined.\n if (config && config.default !== undefined) {\n parsedValue = config.default;\n } else if (config && (config.required || config.isLabel)) {\n throw new Error(\n `Required column ${key} is empty in this line: ${line}`);\n } else {\n parsedValue = undefined;\n }\n } else {\n // A value is present, so parse it based on type\n const valueAsNum = Number(value);\n if (isNaN(valueAsNum)) {\n // The value is a string and this column is declared as boolean\n // in config, parse it as boolean.\n if (config && config.dtype === 'bool') {\n parsedValue = this.getBoolean(value);\n } else {\n // Set value as string\n parsedValue = value;\n }\n } else if (!config || !config.dtype) {\n // If this value is a number and no type config is provided, return\n // it as number.\n parsedValue = valueAsNum;\n } else {\n // If this value is a number and data type is provided, parse it\n // according to provided data type.\n switch (config.dtype) {\n case 'float32':\n parsedValue = valueAsNum;\n break;\n case 'int32':\n parsedValue = Math.floor(valueAsNum);\n break;\n case 'bool':\n parsedValue = this.getBoolean(value);\n break;\n default:\n parsedValue = valueAsNum;\n }\n }\n }\n // Check if this column is label.\n (config && config.isLabel) ? labels[key] = parsedValue :\n features[key] = parsedValue;\n }\n }\n // If label exists, return an object of features and labels as {xs:features,\n // ys:labels}, otherwise return features only.\n if (Object.keys(labels).length === 0) {\n return features;\n\n } else {\n return {xs: features, ys: labels};\n }\n }\n\n private getBoolean(value: string): number {\n if (value === '1' || value.toLowerCase() === 'true') {\n return 1;\n } else {\n return 0;\n }\n }\n\n // adapted from https://beta.observablehq.com/@mbostock/streaming-csv\n private parseRow(line: string, validateElementCount = true): string[] {\n const result: string[] = [];\n let readOffset = 0;\n const readLength = line.length;\n let currentState = STATE_OUT;\n // Goes through the line to parse quote.\n for (let i = 0; i < readLength; i++) {\n switch (currentState) {\n // Before enter a new field\n case STATE_OUT:\n switch (line.charAt(i)) {\n // Enter a quoted field\n case CODE_QUOTE:\n readOffset = i + 1;\n currentState = STATE_QUOTE;\n break;\n // Read an empty field\n case this.delimiter:\n readOffset = i + 1;\n // If delimiter is white space and configured to collapse\n // multiple white spaces, ignore this white space.\n if (this.delimiter === ' ' && this.delimWhitespace) {\n break;\n }\n result.push('');\n currentState = STATE_OUT;\n break;\n // Enter an unquoted field\n default:\n currentState = STATE_FIELD;\n readOffset = i;\n break;\n }\n break;\n // In an unquoted field\n case STATE_FIELD:\n switch (line.charAt(i)) {\n // Exit an unquoted field, add it to result\n case this.delimiter:\n result.push(line.substring(readOffset, i));\n currentState = STATE_OUT;\n readOffset = i + 1;\n break;\n default:\n }\n break;\n // In a quoted field\n case STATE_QUOTE:\n switch (line.charAt(i)) {\n // Read a quote after a quote\n case CODE_QUOTE:\n currentState = STATE_QUOTE_AFTER_QUOTE;\n break;\n default:\n }\n break;\n // This state means it's right after a second quote in a field\n case STATE_QUOTE_AFTER_QUOTE:\n switch (line.charAt(i)) {\n // Finished a quoted field\n case this.delimiter:\n result.push(line.substring(readOffset, i - 1));\n currentState = STATE_OUT;\n readOffset = i + 1;\n break;\n // Finished a quoted part in a quoted field\n case CODE_QUOTE:\n currentState = STATE_QUOTE;\n break;\n // In a quoted part in a quoted field\n default:\n currentState = STATE_WITHIN_QUOTE_IN_QUOTE;\n break;\n }\n break;\n case STATE_WITHIN_QUOTE_IN_QUOTE:\n switch (line.charAt(i)) {\n // Exit a quoted part in a quoted field\n case CODE_QUOTE:\n currentState = STATE_QUOTE;\n break;\n default:\n }\n break;\n default:\n }\n }\n // Adds last item based on if it is quoted.\n if (currentState === STATE_QUOTE_AFTER_QUOTE) {\n result.push(line.substring(readOffset, readLength - 1));\n } else {\n result.push(line.substring(readOffset));\n }\n // Check if each row has the same number of elements as column names.\n if (validateElementCount && result.length !== this.fullColumnNames.length) {\n throw new Error(`Invalid row in csv file. Should have ${\n this.fullColumnNames.length} elements in a row, but got ${result}`);\n }\n return result;\n }\n}\n\n// TODO(soergel): add more basic datasets for parity with tf.data\n// tf.data.FixedLengthRecordDataset()\n// tf.data.TFRecordDataset()\n","/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {env, Tensor, tensor, Tensor2D, Tensor3D, TensorContainer, util} from '@tensorflow/tfjs-core';\nimport {MicrophoneConfig} from '../types';\nimport {LazyIterator} from './lazy_iterator';\n\n/**\n * Provide a stream of tensors from microphone audio stream. The tensors are\n * representing audio data as frequency-domain spectrogram generated with\n * browser's native FFT. Tensors representing time-domain waveform is available\n * based on configuration. Only works in browser environment.\n */\nexport class MicrophoneIterator extends LazyIterator {\n private isClosed = false;\n private stream: MediaStream;\n private readonly fftSize: number;\n private readonly columnTruncateLength: number;\n private freqData: Float32Array;\n private timeData: Float32Array;\n private readonly numFrames: number;\n private analyser: AnalyserNode;\n private audioContext: AudioContext;\n private sampleRateHz: number;\n private readonly audioTrackConstraints: MediaTrackConstraints;\n private readonly smoothingTimeConstant: number;\n private readonly includeSpectrogram: boolean;\n private readonly includeWaveform: boolean;\n\n private constructor(protected readonly microphoneConfig: MicrophoneConfig) {\n super();\n this.fftSize = microphoneConfig.fftSize || 1024;\n const fftSizeLog2 = Math.log2(this.fftSize);\n if (this.fftSize < 0 || fftSizeLog2 < 4 || fftSizeLog2 > 14 ||\n !Number.isInteger(fftSizeLog2)) {\n throw new Error(\n `Invalid fftSize: it must be a power of 2 between ` +\n `2 to 4 and 2 to 14, but got ${this.fftSize}`);\n }\n\n this.numFrames = microphoneConfig.numFramesPerSpectrogram || 43;\n this.sampleRateHz = microphoneConfig.sampleRateHz;\n this.columnTruncateLength =\n microphoneConfig.columnTruncateLength || this.fftSize;\n this.audioTrackConstraints = microphoneConfig.audioTrackConstraints;\n this.smoothingTimeConstant = microphoneConfig.smoothingTimeConstant || 0;\n\n this.includeSpectrogram =\n microphoneConfig.includeSpectrogram === false ? false : true;\n this.includeWaveform =\n microphoneConfig.includeWaveform === true ? true : false;\n if (!this.includeSpectrogram && !this.includeWaveform) {\n throw new Error(\n 'Both includeSpectrogram and includeWaveform are false. ' +\n 'At least one type of data should be returned.');\n }\n }\n\n summary() {\n return `microphone`;\n }\n\n // Construct a MicrophoneIterator and start the audio stream.\n static async create(microphoneConfig: MicrophoneConfig = {}) {\n if (env().get('IS_NODE')) {\n throw new Error(\n 'microphone API is only supported in browser environment.');\n }\n\n const microphoneIterator = new MicrophoneIterator(microphoneConfig);\n\n // Call async function start() to initialize the audio stream.\n await microphoneIterator.start();\n\n return microphoneIterator;\n }\n\n // Start the audio stream and FFT.\n async start(): Promise {\n try {\n this.stream = await navigator.mediaDevices.getUserMedia({\n audio: this.audioTrackConstraints == null ? true :\n this.audioTrackConstraints,\n video: false\n });\n } catch (e) {\n throw new Error(\n `Error thrown while initializing video stream: ${e.message}`);\n }\n\n if (!this.stream) {\n throw new Error('Could not obtain audio from microphone.');\n }\n\n const ctxConstructor =\n // tslint:disable-next-line:no-any\n (window as any).AudioContext || (window as any).webkitAudioContext;\n this.audioContext = new ctxConstructor();\n\n if (!this.sampleRateHz) {\n // If sample rate is not provided, use the available sample rate on\n // device.\n this.sampleRateHz = this.audioContext.sampleRate;\n } else if (this.audioContext.sampleRate !== this.sampleRateHz) {\n throw new Error(\n `Mismatch in sampling rate: ` +\n `Expected: ${this.sampleRateHz}; ` +\n `Actual: ${this.audioContext.sampleRate}`);\n }\n\n const streamSource = this.audioContext.createMediaStreamSource(this.stream);\n this.analyser = this.audioContext.createAnalyser();\n this.analyser.fftSize = this.fftSize * 2;\n this.analyser.smoothingTimeConstant = this.smoothingTimeConstant;\n streamSource.connect(this.analyser);\n this.freqData = new Float32Array(this.fftSize);\n this.timeData = new Float32Array(this.fftSize);\n return;\n }\n\n async next(): Promise> {\n if (this.isClosed) {\n return {value: null, done: true};\n }\n\n let spectrogramTensor: Tensor;\n let waveformTensor: Tensor;\n\n const audioDataQueue = await this.getAudioData();\n if (this.includeSpectrogram) {\n const freqData = this.flattenQueue(audioDataQueue.freqDataQueue);\n spectrogramTensor = this.getTensorFromAudioDataArray(\n freqData, [this.numFrames, this.columnTruncateLength, 1]);\n }\n if (this.includeWaveform) {\n const timeData = this.flattenQueue(audioDataQueue.timeDataQueue);\n waveformTensor = this.getTensorFromAudioDataArray(\n timeData, [this.numFrames * this.fftSize, 1]);\n }\n\n return {\n value: {'spectrogram': spectrogramTensor, 'waveform': waveformTensor},\n done: false\n };\n }\n\n // Capture one result from the audio stream, and extract the value from\n // iterator.next() result.\n async capture(): Promise<{spectrogram: Tensor3D, waveform: Tensor2D}> {\n return (await this.next()).value as\n {spectrogram: Tensor3D, waveform: Tensor2D};\n }\n\n private async getAudioData():\n Promise<{freqDataQueue: Float32Array[], timeDataQueue: Float32Array[]}> {\n const freqDataQueue: Float32Array[] = [];\n const timeDataQueue: Float32Array[] = [];\n let currentFrames = 0;\n return new Promise(resolve => {\n const intervalID = setInterval(() => {\n if (this.includeSpectrogram) {\n this.analyser.getFloatFrequencyData(this.freqData);\n // If the audio stream is initializing, return empty queue.\n if (this.freqData[0] === -Infinity) {\n resolve({freqDataQueue, timeDataQueue});\n }\n freqDataQueue.push(this.freqData.slice(0, this.columnTruncateLength));\n }\n if (this.includeWaveform) {\n this.analyser.getFloatTimeDomainData(this.timeData);\n timeDataQueue.push(this.timeData.slice());\n }\n\n // Clean interval and return when all frames have been collected\n if (++currentFrames === this.numFrames) {\n clearInterval(intervalID);\n resolve({freqDataQueue, timeDataQueue});\n }\n }, this.fftSize / this.sampleRateHz * 1e3);\n });\n }\n\n // Stop the audio stream and pause the iterator.\n stop(): void {\n if (!this.isClosed) {\n this.isClosed = true;\n this.analyser.disconnect();\n this.audioContext.close();\n if (this.stream != null && this.stream.getTracks().length > 0) {\n this.stream.getTracks()[0].stop();\n }\n }\n }\n\n // Override toArray() function to prevent collecting.\n toArray(): Promise {\n throw new Error('Can not convert infinite audio stream to array.');\n }\n\n // Return audio sampling rate in Hz\n getSampleRate(): number {\n return this.sampleRateHz;\n }\n\n private flattenQueue(queue: Float32Array[]): Float32Array {\n const frameSize = queue[0].length;\n const freqData = new Float32Array(queue.length * frameSize);\n queue.forEach((data, i) => freqData.set(data, i * frameSize));\n return freqData;\n }\n\n private getTensorFromAudioDataArray(freqData: Float32Array, shape: number[]):\n Tensor {\n const vals = new Float32Array(util.sizeFromShape(shape));\n // If the data is less than the output shape, the rest is padded with zeros.\n vals.set(freqData, vals.length - freqData.length);\n return tensor(vals, shape);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {browser, cast, env, expandDims, image, reshape, tensor1d, Tensor1D, tensor2d, Tensor2D, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs-core';\nimport {WebcamConfig} from '../types';\nimport {LazyIterator} from './lazy_iterator';\n\n/**\n * Provide a stream of image tensors from webcam video stream. Only works in\n * browser environment.\n */\nexport class WebcamIterator extends LazyIterator {\n private isClosed = true;\n private stream: MediaStream;\n private resize = false;\n private cropSize: [number, number];\n private cropBox: Tensor2D;\n private cropBoxInd: Tensor1D;\n\n private constructor(\n protected readonly webcamVideoElement: HTMLVideoElement,\n protected readonly webcamConfig: WebcamConfig) {\n super();\n if (this.needToResize()) {\n this.resize = true;\n this.cropSize =\n [this.webcamConfig.resizeHeight, this.webcamConfig.resizeWidth];\n this.cropBoxInd = tensor1d([0], 'int32');\n if (this.webcamConfig.centerCrop) {\n // Calculate the box based on resizing shape.\n const widthCroppingRatio =\n this.webcamConfig.resizeWidth * 1.0 / this.webcamVideoElement.width;\n const heightCroppingRatio = this.webcamConfig.resizeHeight * 1.0 /\n this.webcamVideoElement.height;\n const widthCropStart = (1 - widthCroppingRatio) / 2;\n const heightCropStart = (1 - heightCroppingRatio) / 2;\n const widthCropEnd = widthCropStart + widthCroppingRatio;\n const heightCropEnd = heightCroppingRatio + heightCropStart;\n this.cropBox = tensor2d(\n [heightCropStart, widthCropStart, heightCropEnd, widthCropEnd],\n [1, 4]);\n } else {\n this.cropBox = tensor2d([0, 0, 1, 1], [1, 4]);\n }\n }\n }\n\n summary() {\n return `webcam`;\n }\n\n // Construct a WebcamIterator and start it's video stream.\n static async create(\n webcamVideoElement?: HTMLVideoElement, webcamConfig: WebcamConfig = {}) {\n if (env().get('IS_NODE')) {\n throw new Error(\n 'tf.data.webcam is only supported in browser environment.');\n }\n\n if (!webcamVideoElement) {\n // If webcam video element is not provided, create a hidden video element\n // with provided width and height.\n webcamVideoElement = document.createElement('video');\n if (!webcamConfig.resizeWidth || !webcamConfig.resizeHeight) {\n throw new Error(\n 'Please provide webcam video element, or resizeWidth and ' +\n 'resizeHeight to create a hidden video element.');\n }\n webcamVideoElement.width = webcamConfig.resizeWidth;\n webcamVideoElement.height = webcamConfig.resizeHeight;\n }\n const webcamIterator = new WebcamIterator(webcamVideoElement, webcamConfig);\n\n // Call async function to initialize the video stream.\n await webcamIterator.start();\n\n return webcamIterator;\n }\n\n // Async function to start video stream.\n async start(): Promise {\n if (this.webcamConfig.facingMode) {\n util.assert(\n (this.webcamConfig.facingMode === 'user') ||\n (this.webcamConfig.facingMode === 'environment'),\n () =>\n `Invalid webcam facing mode: ${this.webcamConfig.facingMode}. ` +\n `Please provide 'user' or 'environment'`);\n }\n\n try {\n this.stream = await navigator.mediaDevices.getUserMedia({\n video: {\n deviceId: this.webcamConfig.deviceId,\n facingMode: this.webcamConfig.facingMode ?\n this.webcamConfig.facingMode :\n 'user',\n width: this.webcamVideoElement.width,\n height: this.webcamVideoElement.height\n }\n });\n } catch (e) {\n // Modify the error message but leave the stack trace intact\n e.message = `Error thrown while initializing video stream: ${e.message}`;\n throw e;\n }\n\n if (!this.stream) {\n throw new Error('Could not obtain video from webcam.');\n }\n\n // Older browsers may not have srcObject\n try {\n this.webcamVideoElement.srcObject = this.stream;\n } catch (error) {\n console.log(error);\n this.webcamVideoElement.src = window.URL.createObjectURL(this.stream);\n }\n // Start the webcam video stream\n this.webcamVideoElement.play();\n\n this.isClosed = false;\n\n return new Promise(resolve => {\n // Add event listener to make sure the webcam has been fully initialized.\n this.webcamVideoElement.onloadedmetadata = () => {\n resolve();\n };\n });\n }\n\n async next(): Promise> {\n if (this.isClosed) {\n return {value: null, done: true};\n }\n\n let img;\n try {\n img = browser.fromPixels(this.webcamVideoElement);\n } catch (e) {\n throw new Error(\n `Error thrown converting video to pixels: ${JSON.stringify(e)}`);\n }\n if (this.resize) {\n try {\n return {value: this.cropAndResizeFrame(img), done: false};\n } catch (e) {\n throw new Error(`Error thrown cropping the video: ${e.message}`);\n } finally {\n img.dispose();\n }\n } else {\n return {value: img, done: false};\n }\n }\n\n private needToResize() {\n // If resizeWidth and resizeHeight are provided, and different from the\n // width and height of original HTMLVideoElement, then resizing and cropping\n // is required.\n if (this.webcamConfig.resizeWidth && this.webcamConfig.resizeHeight &&\n (this.webcamVideoElement.width !== this.webcamConfig.resizeWidth ||\n this.webcamVideoElement.height !== this.webcamConfig.resizeHeight)) {\n return true;\n }\n return false;\n }\n\n // Cropping and resizing each frame based on config\n cropAndResizeFrame(img: Tensor3D): Tensor3D {\n return tidy(() => {\n const expandedImage: Tensor4D = expandDims(cast(img, 'float32'), (0));\n let resizedImage;\n resizedImage = image.cropAndResize(\n expandedImage, this.cropBox, this.cropBoxInd, this.cropSize,\n 'bilinear');\n // Extract image from batch cropping.\n const shape = resizedImage.shape;\n return reshape(resizedImage, shape.slice(1) as [number, number, number]);\n });\n }\n\n // Capture one frame from the video stream, and extract the value from\n // iterator.next() result.\n async capture(): Promise {\n return (await this.next()).value;\n }\n\n // Stop the video stream and pause webcam iterator.\n stop(): void {\n const tracks = this.stream.getTracks();\n\n tracks.forEach(track => track.stop());\n\n try {\n this.webcamVideoElement.srcObject = null;\n } catch (error) {\n console.log(error);\n this.webcamVideoElement.src = null;\n }\n this.isClosed = true;\n }\n\n // Override toArray() function to prevent collecting.\n toArray(): Promise {\n throw new Error('Can not convert infinite video stream to array.');\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {ByteChunkIterator} from './iterators/byte_chunk_iterator';\n\n/**\n * Represents a data source readable as a stream of binary data chunks.\n *\n * Because `Dataset`s can be read repeatedly (via `Dataset.iterator()`), this\n * provides a means to repeatedly create streams from the underlying data\n * sources.\n */\nexport abstract class DataSource {\n /**\n * Obtain a new stream of binary data chunks.\n *\n * Starts the new stream from the beginning of the data source, even if other\n * streams have been obtained previously.\n */\n abstract async iterator(): Promise;\n\n // TODO(soergel): consider chainable Dataset construction here\n}\n\n// TODO(soergel): consider convenience factory functions here\n// in combination with chainable source->dataset above, e.g.:\n// tf.data.url(...).asCsvDataset().shuffle().batch()\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {LazyIterator, OneToManyIterator} from './lazy_iterator';\n\nexport abstract class StringIterator extends LazyIterator {\n /**\n * Splits a string stream on a given separator.\n *\n * It is assumed that the incoming chunk boundaries have no semantic meaning,\n * so conceptually the incoming stream is treated simply as the concatenation\n * of its elements.\n *\n * The outgoing stream provides chunks corresponding to the results of the\n * standard string split() operation (even if such a chunk spanned incoming\n * chunks). The separators are not included.\n *\n * A typical usage is to split a text file (represented as a stream with\n * arbitrary chunk boundaries) into lines.\n *\n * @param upstream A readable stream of strings that can be treated as\n * concatenated.\n * @param separator A character to split on.\n */\n split(separator: string): StringIterator {\n return new SplitIterator(this, separator);\n }\n}\n\n// ============================================================================\n// The following private classes serve to implement the chainable methods\n// on StringIterator. Unfortunately they can't be placed in separate files, due\n// to resulting trouble with circular imports.\n// ============================================================================\n\n// We wanted multiple inheritance, e.g.\n// class SplitIterator extends QueueIterator, StringIterator\n// but the TypeScript mixin approach is a bit hacky, so we take this adapter\n// approach instead.\n\nclass SplitIterator extends StringIterator {\n private impl: SplitIteratorImpl;\n\n constructor(protected upstream: LazyIterator, separator: string) {\n super();\n this.impl = new SplitIteratorImpl(upstream, separator);\n }\n\n summary() {\n return this.impl.summary();\n }\n\n async next() {\n return this.impl.next();\n }\n}\n\nclass SplitIteratorImpl extends OneToManyIterator {\n // A partial string at the end of an upstream chunk\n carryover = '';\n\n constructor(\n protected upstream: LazyIterator, protected separator: string) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Split('${this.separator}')`;\n }\n\n async pump(): Promise {\n const chunkResult = await this.upstream.next();\n if (chunkResult.done) {\n if (this.carryover === '') {\n return false;\n }\n\n // Pretend that the pump succeeded in order to emit the small last batch.\n // The next pump() call will actually fail.\n this.outputQueue.push(this.carryover);\n this.carryover = '';\n return true;\n }\n const lines = chunkResult.value.split(this.separator);\n // Note the behavior: \" ab \".split(' ') === ['', 'ab', '']\n // Thus the carryover may be '' if the separator falls on a chunk\n // boundary; this produces the correct result.\n\n lines[0] = this.carryover + lines[0];\n for (const line of lines.slice(0, -1)) {\n this.outputQueue.push(line);\n }\n this.carryover = lines[lines.length - 1];\n\n return true;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {env} from '@tensorflow/tfjs-core';\nimport {LazyIterator, OneToManyIterator} from './lazy_iterator';\nimport {StringIterator} from './string_iterator';\n\nexport abstract class ByteChunkIterator extends LazyIterator {\n /**\n * Decode a stream of UTF8-encoded byte arrays to a stream of strings.\n *\n * The byte arrays producetd from the ByteChunkIterator on which this is\n * called will be interpreted as concatenated. No assumptions are made about\n * the boundaries of the incoming chunks, so a multi-byte UTF8 encoding of a\n * character may span the boundary between chunks. This naturally happens,\n * for instance, when reading fixed-size byte arrays from a file.\n */\n decodeUTF8(): StringIterator {\n return new Utf8Iterator(this);\n }\n}\n\n// ============================================================================\n// The following private classes serve to implement the chainable methods\n// on ByteChunkIterator. Unfortunately they can't be placed in separate files,\n// due to resulting trouble with circular imports.\n// ============================================================================\n\n// We wanted multiple inheritance, e.g.\n// class Utf8Iterator extends QueueIterator, StringIterator\n// but the TypeScript mixin approach is a bit hacky, so we take this adapter\n// approach instead.\n\nclass Utf8Iterator extends StringIterator {\n private impl: Utf8IteratorImpl;\n\n constructor(protected upstream: LazyIterator) {\n super();\n this.impl = new Utf8IteratorImpl(upstream);\n }\n\n summary() {\n return this.impl.summary();\n }\n\n async next() {\n return this.impl.next();\n }\n}\n\n/**\n * Decode a stream of UTF8-encoded byte arrays to a stream of strings.\n *\n * This is tricky because the incoming byte array boundaries may disrupt a\n * multi-byte UTF8 character. Thus any incomplete character data at the end of\n * a chunk must be carried over and prepended to the next chunk before\n * decoding. Luckily with native decoder, TextDecoder in browser and\n * string_decoder in node, byte array boundaries are handled automatically.\n *\n * In the context of an input pipeline for machine learning, UTF8 decoding is\n * needed to parse text files containing training examples or prediction\n * requests (e.g., formatted as CSV or JSON). We cannot use the built-in\n * decoding provided by FileReader.readAsText() because here we are in a\n * streaming context, which FileReader does not support.\n *\n * @param upstream A `LazyIterator` of `Uint8Arrays` containing UTF8-encoded\n * text, which should be interpreted as concatenated. No assumptions are\n * made about the boundaries of the incoming chunks, so a multi-byte UTF8\n * encoding of a character may span the boundary between chunks. This\n * naturally happens, for instance, when reading fixed-size byte arrays from a\n * file.\n */\nclass Utf8IteratorImpl extends OneToManyIterator {\n // `decoder` as `any` here to dynamically assign value based on the\n // environment.\n // tslint:disable-next-line:no-any\n decoder: any;\n\n constructor(protected readonly upstream: LazyIterator) {\n super();\n if (env().get('IS_BROWSER')) {\n this.decoder = new TextDecoder('utf-8');\n } else {\n // tslint:disable-next-line:no-require-imports\n const {StringDecoder} = require('string_decoder');\n this.decoder = new StringDecoder('utf8');\n }\n }\n summary() {\n return `${this.upstream.summary()} -> Utf8`;\n }\n\n async pump(): Promise {\n const chunkResult = await this.upstream.next();\n let chunk;\n if (chunkResult.done) {\n return false;\n } else {\n chunk = chunkResult.value;\n }\n\n let text: string;\n if (env().get('IS_BROWSER')) {\n text = this.decoder.decode(chunk, {stream: true});\n } else {\n text = this.decoder.write(Buffer.from(chunk.buffer));\n }\n this.outputQueue.push(text);\n return true;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\n// inspired by https://github.com/maxogden/filereader-stream\nimport {env, util} from '@tensorflow/tfjs-core';\nimport {FileElement} from '../types';\nimport {ByteChunkIterator} from './byte_chunk_iterator';\n\nexport interface FileChunkIteratorOptions {\n /** The byte offset at which to begin reading the File or Blob. Default 0. */\n offset?: number;\n /** The number of bytes to read at a time. Default 1MB. */\n chunkSize?: number;\n}\n\n/**\n * Provide a stream of chunks from a File, Blob, or Uint8Array.\n * @param file The source File, Blob or Uint8Array.\n * @param options Optional settings controlling file reading.\n * @returns a lazy Iterator of Uint8Arrays containing sequential chunks of the\n * input File, Blob or Uint8Array.\n */\nexport class FileChunkIterator extends ByteChunkIterator {\n offset: number;\n chunkSize: number;\n\n constructor(\n protected file: FileElement,\n protected options: FileChunkIteratorOptions = {}) {\n super();\n util.assert(\n (file instanceof Uint8Array) ||\n (env().get('IS_BROWSER') ?\n (file instanceof File || file instanceof Blob) :\n false),\n () => 'FileChunkIterator only supports File, Blob and Uint8Array ' +\n 'right now.');\n this.offset = options.offset || 0;\n // default 1MB chunk has tolerable perf on large files\n this.chunkSize = options.chunkSize || 1024 * 1024;\n }\n\n summary() {\n return `FileChunks ${this.file}`;\n }\n\n async next(): Promise> {\n if (this.offset >= ((this.file instanceof Uint8Array) ?\n this.file.byteLength :\n this.file.size)) {\n return {value: null, done: true};\n }\n const chunk = new Promise((resolve, reject) => {\n const end = this.offset + this.chunkSize;\n if (this.file instanceof Uint8Array) {\n // Note if end > this.uint8Array.byteLength, we just get a small last\n // chunk.\n resolve(new Uint8Array(this.file.slice(this.offset, end)));\n } else {\n // This branch assumes that this.file type is File or Blob, which\n // means it is in the browser environment.\n\n // TODO(soergel): is this a performance issue?\n const fileReader = new FileReader();\n fileReader.onload = (event) => {\n let data: string|ArrayBuffer|Uint8Array = fileReader.result;\n // Not sure we can trust the return type of\n // FileReader.readAsArrayBuffer See e.g.\n // https://github.com/node-file-api/FileReader/issues/2\n if (data instanceof ArrayBuffer) {\n data = new Uint8Array(data);\n }\n if (!(data instanceof Uint8Array)) {\n return reject(new TypeError('FileReader returned unknown type.'));\n }\n resolve(data);\n };\n fileReader.onabort = (event) => {\n return reject(new Error('Aborted'));\n };\n fileReader.onerror = (event) => {\n return reject(new Error(event.type));\n };\n // TODO(soergel): better handle onabort, onerror\n // Note if end > this.file.size, we just get a small last chunk.\n const slice = this.file.slice(this.offset, end);\n // We can't use readAsText here (even if we know the file is text)\n // because the slice boundary may fall within a multi-byte character.\n fileReader.readAsArrayBuffer(slice);\n }\n this.offset = end;\n });\n return {value: (await chunk), done: false};\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {util} from '@tensorflow/tfjs-core';\nimport {FileChunkIterator, FileChunkIteratorOptions} from './file_chunk_iterator';\n\n/**\n * Provide a stream of chunks from a URL.\n *\n * Note this class first downloads the entire file into memory before providing\n * the first element from the stream. This is because the Fetch API does not\n * yet reliably provide a reader stream for the response body.\n */\nexport async function urlChunkIterator(\n url: RequestInfo, options: FileChunkIteratorOptions = {}) {\n let urlString;\n let requestInit;\n if ((typeof url) === 'string') {\n urlString = url as string;\n } else {\n urlString = (url as Request).url;\n requestInit = getRequestInitFromRequest(url as Request);\n }\n const response = await util.fetch(urlString, requestInit);\n if (response.ok) {\n const uint8Array = new Uint8Array(await response.arrayBuffer());\n return new FileChunkIterator(uint8Array, options);\n } else {\n throw new Error(response.statusText);\n }\n}\n\n// Generate RequestInit from Request to match tf.util.fetch signature.\nconst getRequestInitFromRequest = (request: Request) => {\n const init = {\n method: request.method,\n headers: request.headers,\n body: request.body,\n mode: request.mode,\n credentials: request.credentials,\n cache: request.cache,\n redirect: request.redirect,\n referrer: request.referrer,\n integrity: request.integrity,\n };\n return init;\n};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\n// Skip tslint any type check cause this method is aiming to check type of\n// input.\n// tslint:disable-next-line:no-any\nexport function isLocalPath(source: any): boolean {\n return (typeof source === 'string') && source.substr(0, 7) === 'file://';\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {env} from '@tensorflow/tfjs-core';\nimport {DataSource} from '../datasource';\nimport {ByteChunkIterator} from '../iterators/byte_chunk_iterator';\nimport {FileChunkIterator, FileChunkIteratorOptions} from '../iterators/file_chunk_iterator';\nimport {FileElement} from '../types';\nimport {isLocalPath} from '../util/source_util';\n\n/**\n * Represents a file, blob, or Uint8Array readable as a stream of binary data\n * chunks.\n */\nexport class FileDataSource extends DataSource {\n /**\n * Create a `FileDataSource`.\n *\n * @param input Local file path, or `File`/`Blob`/`Uint8Array` object to\n * read. Local file only works in node environment.\n * @param options Options passed to the underlying `FileChunkIterator`s,\n * such as {chunksize: 1024}.\n */\n constructor(\n protected input: FileElement|string,\n protected readonly options: FileChunkIteratorOptions = {}) {\n super();\n }\n\n async iterator(): Promise {\n if (isLocalPath(this.input) && env().get('IS_NODE')) {\n // tslint:disable-next-line:no-require-imports\n const fs = require('fs');\n this.input = fs.readFileSync((this.input as string).substr(7));\n }\n // TODO(kangyizhang): Add LocalFileChunkIterator to split local streaming\n // with file in browser.\n return new FileChunkIterator(this.input as FileElement, this.options);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {DataSource} from '../datasource';\nimport {ByteChunkIterator} from '../iterators/byte_chunk_iterator';\nimport {FileChunkIteratorOptions} from '../iterators/file_chunk_iterator';\nimport {urlChunkIterator} from '../iterators/url_chunk_iterator';\nimport {isLocalPath} from '../util/source_util';\nimport {FileDataSource} from './file_data_source';\n\n/*\n * Represents a URL readable as a stream of binary data chunks.\n */\nexport class URLDataSource extends DataSource {\n /**\n * Create a `URLDataSource`.\n *\n * @param url A source URL string, or a `Request` object.\n * @param options Options passed to the underlying `FileChunkIterator`s,\n * such as {chunksize: 1024}.\n */\n constructor(\n protected readonly url: RequestInfo,\n protected readonly fileOptions: FileChunkIteratorOptions = {}) {\n super();\n }\n\n // TODO(soergel): provide appropriate caching options. Currently this\n // will download the URL anew for each call to iterator(). Since we have\n // to treat the downloaded file as a blob/buffer anyway, we may as well retain\n // it-- but that raises GC issues. Also we may want a persistent disk cache.\n async iterator(): Promise {\n if (isLocalPath(this.url)) {\n return (new FileDataSource(this.url as string, this.fileOptions))\n .iterator();\n } else {\n return urlChunkIterator(this.url, this.fileOptions);\n }\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {TensorContainer} from '@tensorflow/tfjs-core';\nimport {Dataset, datasetFromIteratorFn} from './dataset';\nimport {CSVDataset} from './datasets/csv_dataset';\nimport {iteratorFromFunction} from './iterators/lazy_iterator';\nimport {MicrophoneIterator} from './iterators/microphone_iterator';\nimport {WebcamIterator} from './iterators/webcam_iterator';\nimport {URLDataSource} from './sources/url_data_source';\nimport {CSVConfig, MicrophoneConfig, WebcamConfig} from './types';\n\n/**\n * Create a `CSVDataset` by reading and decoding CSV file(s) from provided URL\n * or local path if it's in Node environment.\n *\n * Note: If isLabel in columnConfigs is `true` for at least one column, the\n * element in returned `CSVDataset` will be an object of\n * `{xs:features, ys:labels}`: xs is a dict of features key/value pairs, ys\n * is a dict of labels key/value pairs. If no column is marked as label,\n * returns a dict of features only.\n *\n * ```js\n * const csvUrl =\n * 'https://storage.googleapis.com/tfjs-examples/multivariate-linear-regression/data/boston-housing-train.csv';\n *\n * async function run() {\n * // We want to predict the column \"medv\", which represents a median value of\n * // a home (in $1000s), so we mark it as a label.\n * const csvDataset = tf.data.csv(\n * csvUrl, {\n * columnConfigs: {\n * medv: {\n * isLabel: true\n * }\n * }\n * });\n *\n * // Number of features is the number of column names minus one for the label\n * // column.\n * const numOfFeatures = (await csvDataset.columnNames()).length - 1;\n *\n * // Prepare the Dataset for training.\n * const flattenedDataset =\n * csvDataset\n * .map(({xs, ys}) =>\n * {\n * // Convert xs(features) and ys(labels) from object form (keyed by\n * // column name) to array form.\n * return {xs:Object.values(xs), ys:Object.values(ys)};\n * })\n * .batch(10);\n *\n * // Define the model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense({\n * inputShape: [numOfFeatures],\n * units: 1\n * }));\n * model.compile({\n * optimizer: tf.train.sgd(0.000001),\n * loss: 'meanSquaredError'\n * });\n *\n * // Fit the model using the prepared Dataset\n * return model.fitDataset(flattenedDataset, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * console.log(epoch + ':' + logs.loss);\n * }\n * }\n * });\n * }\n *\n * await run();\n * ```\n *\n * @param source URL or local path to get CSV file. If it's a local path, it\n * must have prefix `file://` and it only works in node environment.\n * @param csvConfig (Optional) A CSVConfig object that contains configurations\n * of reading and decoding from CSV file(s).\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * configParamIndices: [1]\n * }\n */\nexport function csv(\n source: RequestInfo, csvConfig: CSVConfig = {}): CSVDataset {\n return new CSVDataset(new URLDataSource(source), csvConfig);\n}\n\n/**\n * Create a `Dataset` that produces each element by calling a provided function.\n *\n * Note that repeated iterations over this `Dataset` may produce different\n * results, because the function will be called anew for each element of each\n * iteration.\n *\n * Also, beware that the sequence of calls to this function may be out of order\n * in time with respect to the logical order of the Dataset. This is due to the\n * asynchronous lazy nature of stream processing, and depends on downstream\n * transformations (e.g. .shuffle()). If the provided function is pure, this is\n * no problem, but if it is a closure over a mutable state (e.g., a traversal\n * pointer), then the order of the produced elements may be scrambled.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const ds = tf.data.func(func);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * @param f A function that produces one data element on each call.\n */\nexport function func(\n f: () => IteratorResult| Promise>): Dataset {\n const iter = iteratorFromFunction(f);\n return datasetFromIteratorFn(async () => iter);\n}\n\n/**\n * Create a `Dataset` that produces each element from provided JavaScript\n * generator, which is a function*\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions),\n * or a function that returns an\n * iterator\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions).\n *\n * The returned iterator should have `.next()` function that returns element in\n * format of `{value: TensorContainer, done:boolean}`.\n *\n * Example of creating a dataset from an iterator factory:\n * ```js\n * function makeIterator() {\n * const numElements = 10;\n * let index = 0;\n *\n * const iterator = {\n * next: () => {\n * let result;\n * if (index < numElements) {\n * result = {value: index, done: false};\n * index++;\n * return result;\n * }\n * return {value: index, done: true};\n * }\n * };\n * return iterator;\n * }\n * const ds = tf.data.generator(makeIterator);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * Example of creating a dataset from a generator:\n * ```js\n * function* dataGenerator() {\n * const numElements = 10;\n * let index = 0;\n * while (index < numElements) {\n * const x = index;\n * index++;\n * yield x;\n * }\n * }\n *\n * const ds = tf.data.generator(dataGenerator);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * @param generator A Javascript generator function that returns a JavaScript\n * iterator.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * configParamIndices: [1]\n * }\n */\nexport function generator(\n generator: () => Iterator| Promise>): Dataset {\n return datasetFromIteratorFn(async () => {\n const gen = await generator();\n return iteratorFromFunction(() => gen.next());\n });\n}\n\n/**\n * Create an iterator that generate `Tensor`s from webcam video stream. This API\n * only works in Browser environment when the device has webcam.\n *\n * Note: this code snippet only works when the device has a webcam. It will\n * request permission to open the webcam when running.\n * ```js\n * const videoElement = document.createElement('video');\n * videoElement.width = 100;\n * videoElement.height = 100;\n * const cam = await tf.data.webcam(videoElement);\n * const img = await cam.capture();\n * img.print();\n * cam.stop();\n * ```\n *\n * @param webcamVideoElement A `HTMLVideoElement` used to play video from\n * webcam. If this element is not provided, a hidden `HTMLVideoElement` will\n * be created. In that case, `resizeWidth` and `resizeHeight` must be\n * provided to set the generated tensor shape.\n * @param webcamConfig A `WebcamConfig` object that contains configurations of\n * reading and manipulating data from webcam video stream.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * ignoreCI: true\n * }\n */\nexport async function webcam(\n webcamVideoElement?: HTMLVideoElement,\n webcamConfig?: WebcamConfig): Promise {\n return WebcamIterator.create(webcamVideoElement, webcamConfig);\n}\n\n/**\n * Create an iterator that generate frequency-domain spectrogram `Tensor`s from\n * microphone audio stream with browser's native FFT. This API only works in\n * browser environment when the device has microphone.\n *\n * Note: this code snippet only works when the device has a microphone. It will\n * request permission to open the microphone when running.\n * ```js\n * const mic = await tf.data.microphone({\n * fftSize: 1024,\n * columnTruncateLength: 232,\n * numFramesPerSpectrogram: 43,\n * sampleRateHz:44100,\n * includeSpectrogram: true,\n * includeWaveform: true\n * });\n * const audioData = await mic.capture();\n * const spectrogramTensor = audioData.spectrogram;\n * spectrogramTensor.print();\n * const waveformTensor = audioData.waveform;\n * waveformTensor.print();\n * mic.stop();\n * ```\n *\n * @param microphoneConfig A `MicrophoneConfig` object that contains\n * configurations of reading audio data from microphone.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * ignoreCI: true\n * }\n */\nexport async function microphone(microphoneConfig?: MicrophoneConfig):\n Promise {\n return MicrophoneIterator.create(microphoneConfig);\n}\n","/** @license See the LICENSE file. */\n\n// This code is auto-generated, do not modify this file!\nconst version = '3.6.0';\nexport {version};\n"],"names":["this","define","sr","tf.util","tf.Tensor","tf.dispose","tf.tensor_util","seedrandom.alea","tf.tidy","tf.stack","tf.tensor","util","env","tensor","tensor1d","tensor2d","browser","tidy","expandDims","cast","image","reshape"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAA;CACA;CACA;CACA;AACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACA;AACA;AACA;CACA,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;AAClC;CACA,SAAS,IAAI,CAAC,IAAI,EAAE;CACpB,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,CAAC;AAC/B;CACA,EAAE,EAAE,CAAC,IAAI,GAAG,WAAW;CACvB,IAAI,IAAI,CAAC,GAAG,OAAO,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,sBAAsB,CAAC;CAC5D,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;CAClB,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;CAClB,IAAI,OAAO,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,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AAC,CAAC;CAC9D,CAAC;CAED;;;;;;;;;;;;;;;;;;;;;;;;UAwBgB,IAAI,CAChB,CAAsD;KACxD,MAAM,IAAI,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC;KACrC,OAAO,qBAAqB,CAAC,YAAY,IAAI,CAAC,CAAC;CACjD,CAAC;CAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;UA4DgB,SAAS,CACrB,SAAkD;KACpD,OAAO,qBAAqB,CAAC;SAC3B,MAAM,GAAG,GAAG,MAAM,SAAS,EAAE,CAAC;SAC9B,OAAO,oBAAoB,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;MAC/C,CAAC,CAAC;CACL,CAAC;CAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BO,eAAe,MAAM,CACxB,kBAAqC,EACrC,YAA2B;KAC7B,OAAO,cAAc,CAAC,MAAM,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC;CACjE,CAAC;CAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCO,eAAe,UAAU,CAAC,gBAAmC;KAElE,OAAO,kBAAkB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;CACrD;;CCzRA;CAEA;OACM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.es2017.min.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.es2017.min.js deleted file mode 100644 index 217c28935..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.es2017.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tensorflow/tfjs-core")):"function"==typeof define&&define.amd?define(["exports","@tensorflow/tfjs-core"],e):e(((t=t||self).tf=t.tf||{},t.tf.data=t.tf.data||{}),t.tf)}(this,(function(t,e){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function r(t,e){return t(e={exports:{}},e.exports),e.exports}var s=r((function(t){!function(t,e,r){function s(t){var e,r=this,s=(e=4022871197,function(t){t=t.toString();for(var r=0;r>>0,e=(s*=e)>>>0,e+=4294967296*(s-=e)}return 2.3283064365386963e-10*(e>>>0)});r.next=function(){var t=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=t-(r.c=0|t)},r.c=1,r.s0=s(" "),r.s1=s(" "),r.s2=s(" "),r.s0-=s(t),r.s0<0&&(r.s0+=1),r.s1-=s(t),r.s1<0&&(r.s1+=1),r.s2-=s(t),r.s2<0&&(r.s2+=1),s=null}function n(t,e){return e.c=t.c,e.s0=t.s0,e.s1=t.s1,e.s2=t.s2,e}function i(t,e){var r=new s(t),i=e&&e.state,a=r.next;return a.int32=function(){return 4294967296*r.next()|0},a.double=function(){return a()+11102230246251565e-32*(2097152*a()|0)},a.quick=a,i&&("object"==typeof i&&n(i,r),a.state=function(){return n(r,{})}),a}e&&e.exports?e.exports=i:r&&r.amd?r((function(){return i})):this.alea=i}(0,t,!1)})),n=r((function(t){!function(t,e,r){function s(t){var e=this,r="";e.x=0,e.y=0,e.z=0,e.w=0,e.next=function(){var t=e.x^e.x<<11;return e.x=e.y,e.y=e.z,e.z=e.w,e.w^=e.w>>>19^t^t>>>8},t===(0|t)?e.x=t:r+=t;for(var s=0;s>>0)/4294967296};return a.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},a.int32=r.next,a.quick=a,i&&("object"==typeof i&&n(i,r),a.state=function(){return n(r,{})}),a}e&&e.exports?e.exports=i:r&&r.amd?r((function(){return i})):this.xor128=i}(0,t,!1)})),i=r((function(t){!function(t,e,r){function s(t){var e=this,r="";e.next=function(){var t=e.x^e.x>>>2;return e.x=e.y,e.y=e.z,e.z=e.w,e.w=e.v,(e.d=e.d+362437|0)+(e.v=e.v^e.v<<4^t^t<<1)|0},e.x=0,e.y=0,e.z=0,e.w=0,e.v=0,t===(0|t)?e.x=t:r+=t;for(var s=0;s>>4),e.next()}function n(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e.v=t.v,e.d=t.d,e}function i(t,e){var r=new s(t),i=e&&e.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},a.int32=r.next,a.quick=a,i&&("object"==typeof i&&n(i,r),a.state=function(){return n(r,{})}),a}e&&e.exports?e.exports=i:r&&r.amd?r((function(){return i})):this.xorwow=i}(0,t,!1)})),a=r((function(t){!function(t,e,r){function s(t){var e=this;e.next=function(){var t,r,s=e.x,n=e.i;return t=s[n],r=(t^=t>>>7)^t<<24,r^=(t=s[n+1&7])^t>>>10,r^=(t=s[n+3&7])^t>>>3,r^=(t=s[n+4&7])^t<<7,t=s[n+7&7],r^=(t^=t<<13)^t<<9,s[n]=r,e.i=n+1&7,r},function(t,e){var r,s=[];if(e===(0|e))s[0]=e;else for(e=""+e,r=0;r0;--r)t.next()}(e,t)}function n(t,e){return e.x=t.x.slice(),e.i=t.i,e}function i(t,e){null==t&&(t=+new Date);var r=new s(t),i=e&&e.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},a.int32=r.next,a.quick=a,i&&(i.x&&n(i,r),a.state=function(){return n(r,{})}),a}e&&e.exports?e.exports=i:r&&r.amd?r((function(){return i})):this.xorshift7=i}(0,t,!1)})),o=r((function(t){!function(t,e,r){function s(t){var e=this;e.next=function(){var t,r,s=e.w,n=e.X,i=e.i;return e.w=s=s+1640531527|0,r=n[i+34&127],t=n[i=i+1&127],r^=r<<13,t^=t<<17,r^=r>>>15,t^=t>>>12,r=n[i]=r^t,e.i=i,r+(s^s>>>16)|0},function(t,e){var r,s,n,i,a,o=[],u=128;for(e===(0|e)?(s=e,e=null):(e+="\0",s=0,u=Math.max(u,e.length)),n=0,i=-32;i>>15,s^=s<<4,s^=s>>>13,i>=0&&(a=a+1640531527|0,n=0==(r=o[127&i]^=s+a)?n+1:0);for(n>=128&&(o[127&(e&&e.length||0)]=-1),n=127,i=512;i>0;--i)s=o[n+34&127],r=o[n=n+1&127],s^=s<<13,r^=r<<17,s^=s>>>15,r^=r>>>12,o[n]=s^r;t.w=a,t.X=o,t.i=n}(e,t)}function n(t,e){return e.i=t.i,e.w=t.w,e.X=t.X.slice(),e}function i(t,e){null==t&&(t=+new Date);var r=new s(t),i=e&&e.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},a.int32=r.next,a.quick=a,i&&(i.X&&n(i,r),a.state=function(){return n(r,{})}),a}e&&e.exports?e.exports=i:r&&r.amd?r((function(){return i})):this.xor4096=i}(0,t,!1)})),u=r((function(t){!function(t,e,r){function s(t){var e=this,r="";e.next=function(){var t=e.b,r=e.c,s=e.d,n=e.a;return t=t<<25^t>>>7^r,r=r-s|0,s=s<<24^s>>>8^n,n=n-t|0,e.b=t=t<<20^t>>>12^r,e.c=r=r-s|0,e.d=s<<16^r>>>16^n,e.a=n-t|0},e.a=0,e.b=0,e.c=-1640531527,e.d=1367130551,t===Math.floor(t)?(e.a=t/4294967296|0,e.b=0|t):r+=t;for(var s=0;s>>0)/4294967296};return a.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},a.int32=r.next,a.quick=a,i&&("object"==typeof i&&n(i,r),a.state=function(){return n(r,{})}),a}e&&e.exports?e.exports=i:r&&r.amd?r((function(){return i})):this.tychei=i}(0,t,!1)})),h=r((function(t){!function(e,r){var s,n=this,i=256,a=r.pow(i,6),o=r.pow(2,52),u=2*o,h=255;function l(t,h,l){var w=[],y=m(d((h=1==h?{entropy:!0}:h||{}).entropy?[t,p(e)]:null==t?function(){try{var t;return s&&(t=s.randomBytes)?t=t(i):(t=new Uint8Array(i),(n.crypto||n.msCrypto).getRandomValues(t)),p(t)}catch(t){var r=n.navigator,a=r&&r.plugins;return[+new Date,n,a,n.screen,p(e)]}}():t,3),w),g=new c(w),x=function(){for(var t=g.g(6),e=a,r=0;t=u;)t/=2,e/=2,r>>>=1;return(t+r)/e};return x.int32=function(){return 0|g.g(4)},x.quick=function(){return g.g(4)/4294967296},x.double=x,m(p(g.S),e),(h.pass||l||function(t,e,s,n){return n&&(n.S&&f(n,g),t.state=function(){return f(g,{})}),s?(r.random=t,e):t})(x,y,"global"in h?h.global:this==r,h.state)}function c(t){var e,r=t.length,s=this,n=0,a=s.i=s.j=0,o=s.S=[];for(r||(t=[r++]);nt[i])),e,r);n[i]=s}return r.delete(s),n}throw new Error(`Can't recurse into non-iterable type: ${s}`)}return n.value}function p(t){return null===t?null:y(t[0])?{value:null,recurse:!0}:{value:t,recurse:!1}}async function w(t,r){const s=new Map;f(t,r,s);for(const t of Array.from(s.keys())){const r=s.get(t);if(e.util.isPromise(r)){const e=await r;s.set(t,e)}}return f(t,r,s)}function y(t){return null!=t&&!ArrayBuffer.isView(t)&&(Array.isArray(t)||"object"==typeof t&&!(t instanceof e.Tensor))}function g(t){return f(t,x)}function x(t){return t instanceof e.Tensor?{value:t.clone(),recurse:!1}:y(t)?{value:null,recurse:!0}:{value:t,recurse:!1}}class v{constructor(t){if(this.capacity=t,this.begin=0,this.end=0,null==t)throw new RangeError("Can't create a ring buffer of unknown capacity.");if(t<1)throw new RangeError("Can't create ring buffer of capacity < 1.");this.data=new Array(t),this.doubledCapacity=2*t}wrap(t){for(;t<0;)t+=this.doubledCapacity;return t%this.doubledCapacity}get(t){if(t<0)throw new RangeError("Can't get item at a negative index.");return this.data[t%this.capacity]}set(t,e){if(t<0)throw new RangeError("Can't set item at a negative index.");this.data[t%this.capacity]=e}length(){let t=this.end-this.begin;return t<0&&(t=this.doubledCapacity+t),t}isFull(){return this.length()===this.capacity}isEmpty(){return 0===this.length()}push(t){if(this.isFull())throw new RangeError("Ring buffer is full.");this.set(this.end,t),this.end=this.wrap(this.end+1)}pushAll(t){for(const e of t)this.push(e)}pop(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");this.end=this.wrap(this.end-1);const t=this.get(this.end);return this.set(this.end,void 0),t}unshift(t){if(this.isFull())throw new RangeError("Ring buffer is full.");this.begin=this.wrap(this.begin-1),this.set(this.begin,t)}shift(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");const t=this.get(this.begin);return this.set(this.begin,void 0),this.begin=this.wrap(this.begin+1),t}shuffleExcise(t){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");const e=this.wrap(this.begin+t),r=this.get(e);return this.set(e,this.pop()),r}}class b extends v{constructor(){super(b.INITIAL_CAPACITY)}isFull(){return!1}push(t){super.isFull()&&this.expand(),super.push(t)}unshift(t){super.isFull()&&this.expand(),super.unshift(t)}expand(){const t=2*this.capacity,e=new Array(t),r=this.length();for(let t=0;t!0===t))}rowMajorBatch(t,e=!0){return new k(this,t,e)}columnMajorBatch(t,e=!0,r=p){return this.rowMajorBatch(t,e).map((t=>d(t,r)))}concatenate(t,e){return new j(C([this,t]),e)}take(t){return t<0||null==t?this:new F(this,t)}skip(t){return t<0||null==t?this:new T(this,t)}prefetch(t){return new q(this,t)}shuffle(t,e){return new H(this,t,e)}serial(){return new R(this)}}class S extends E{constructor(t){super(),this.items=t,this.trav=0}summary(){return`Array of ${this.items.length} items`}async next(){if(this.trav>=this.items.length)return{value:null,done:!0};const t=this.items[this.trav];return this.trav++,{value:g(t),done:!1}}}class A extends E{constructor(t){super(),this.nextFn=t}summary(){return"Function call"}async next(){try{return this.nextFn()}catch(t){throw t.message=`Error thrown while iterating through a dataset: ${t.message}`,t}}}class R extends E{constructor(t){super(),this.upstream=t,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Serial`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){return this.upstream.next()}}class T extends E{constructor(t,e){super(),this.upstream=t,this.maxCount=e,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Skip`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;this.count++ Take`}async next(){return this.count++>=this.maxCount?{value:null,done:!0}:this.upstream.next()}}class k extends E{constructor(t,e,r=!0){super(),this.upstream=t,this.batchSize=e,this.enableSmallLastBatch=r,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> RowMajorBatch`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){const t=[];for(;t.length0?{value:t,done:!1}:{value:null,done:!0};t.push(e.value)}return{value:t,done:!1}}}class N extends E{constructor(t,e){super(),this.upstream=t,this.predicate=e,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Filter`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;;){const t=await this.upstream.next();if(t.done||this.predicate(t.value))return t;e.dispose(t.value)}}}class I extends E{constructor(t,e){super(),this.upstream=t,this.transform=e}summary(){return`${this.upstream.summary()} -> Map`}async next(){const t=await this.upstream.next();if(t.done)return{value:null,done:!0};const r=e.tensor_util.getTensorsInContainer(t.value),s=this.transform(t.value),n=e.tensor_util.getTensorsInContainer(s);for(const t of r)e.tensor_util.isTensorInList(t,n)||t.dispose();return{value:s,done:!1}}}class D extends E{constructor(t,e){super(),this.upstream=t,this.handler=e,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> handleErrors`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;;)try{return await this.upstream.next()}catch(t){if(!this.handler(t))return{value:null,done:!0}}}}class M extends E{constructor(t,e){super(),this.upstream=t,this.transform=e}summary(){return`${this.upstream.summary()} -> AsyncMap`}async next(){const t=await this.upstream.next();if(t.done)return{value:null,done:!0};const r=e.tensor_util.getTensorsInContainer(t.value),s=await this.transform(t.value),n=e.tensor_util.getTensorsInContainer(s);for(const t of r)e.tensor_util.isTensorInList(t,n)||t.dispose();return{value:s,done:!1}}}class O extends E{constructor(){super(),this.outputQueue=new b,this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;0===this.outputQueue.length();)if(!await this.pump())return{value:null,done:!0};return{value:this.outputQueue.shift(),done:!1}}}class $ extends O{constructor(t,e){super(),this.upstream=t,this.transform=e}summary(){return`${this.upstream.summary()} -> Flatmap`}async pump(){const t=await this.upstream.next();if(t.done)return!1;const r=e.tensor_util.getTensorsInContainer(t.value),s=this.transform(t.value),n=e.tensor_util.getTensorsInContainer(s);this.outputQueue.pushAll(s);for(const t of r)e.tensor_util.isTensorInList(t,n)||t.dispose();return!0}}class j extends E{constructor(t,e){super(),this.baseErrorHandler=e,this.lastRead=null,this.iterator=null,this.moreIterators=t}summary(){return"TODO: fill in upstream of chained summaries -> Chained"}async next(){return this.lastRead=this.readFromChain(this.lastRead),this.lastRead}async readFromChain(t){if(await t,null==this.iterator){const t=await this.moreIterators.next();if(t.done)return{value:null,done:!0};this.iterator=t.value,null!=this.baseErrorHandler&&(this.iterator=this.iterator.handleErrors(this.baseErrorHandler))}const e=await this.iterator.next();return e.done?(this.iterator=null,this.readFromChain(t)):e}}!function(t){t[t.FAIL=0]="FAIL",t[t.SHORTEST=1]="SHORTEST",t[t.LONGEST=2]="LONGEST"}(l||(l={}));class L extends E{constructor(t,e=l.FAIL){super(),this.iterators=t,this.mismatchMode=e,this.count=0,this.currentPromise=null}summary(){return"{TODO: fill in upstream of zip summaries} -> Zip"}async nextState(t){await t;let e=0,r=0;const s=await w(this.iterators,(function(t){if(t instanceof E){return{value:t.next().then((t=>(e++,t.done&&r++,t.value))),recurse:!1}}return{value:null,recurse:!0}}));if(e===r)return{value:null,done:!0};if(r>0)switch(this.mismatchMode){case l.FAIL:throw new Error(`Zipped streams should have the same length. Mismatched at element ${this.count}.`);case l.SHORTEST:return{value:null,done:!0};case l.LONGEST:}return this.count++,{value:s,done:!1}}async next(){return this.currentPromise=this.nextState(this.currentPromise),this.currentPromise}}class q extends E{constructor(t,e){super(),this.upstream=t,this.bufferSize=e,this.buffer=new v(e)}summary(){return`${this.upstream.summary()} -> Prefetch`}refill(){for(;!this.buffer.isFull();){const t=this.upstream.next();this.buffer.push(t)}}next(){return this.refill(),this.buffer.shift()}}class H extends q{constructor(t,r,s){super(t,r),this.upstream=t,this.windowSize=r,this.upstreamExhausted=!1,this.random=c(s||e.util.now().toString()),this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}randomInt(t){return Math.floor(this.random()*t)}chooseIndex(){return this.randomInt(this.buffer.length())}async serialNext(){for(this.upstreamExhausted||this.refill();!this.buffer.isEmpty();){const t=this.chooseIndex(),e=await this.buffer.shuffleExcise(t);if(!e.done)return this.refill(),e;this.upstreamExhausted=!0}return{value:null,done:!0}}}class B{constructor(){this.size=null}batch(t,r=!0){const s=this;let n;return e.util.assert(t>0,(()=>`batchSize needs to be positive, but it is\n ${t}`)),n=this.size===1/0||null==this.size?this.size:r?Math.ceil(this.size/t):Math.floor(this.size/t),P((async()=>(await s.iterator()).columnMajorBatch(t,r,W)),n)}concatenate(t){const e=this;let r;return r=this.size===1/0||t.size===1/0?1/0:null!=this.size&&null!=t.size?this.size+t.size:null,P((async()=>(await e.iterator()).concatenate(await t.iterator())),r)}filter(t){const r=this;let s;return s=this.size===1/0?1/0:null,P((async()=>(await r.iterator()).filter((r=>e.tidy((()=>t(r)))))),s)}async forEachAsync(t){return(await this.iterator()).forEachAsync(t)}map(t){const r=this;return P((async()=>(await r.iterator()).map((r=>e.tidy((()=>t(r)))))),this.size)}mapAsync(t){const e=this;return P((async()=>(await e.iterator()).mapAsync(t)),this.size)}prefetch(t){if(null==t)throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified.");const e=this;return P((async()=>(await e.iterator()).prefetch(t)),this.size)}repeat(t){const e=this;let r;return r=null!=this.size&&t>0?this.size*t:0===t?0:null!=this.size&&(void 0===t||t<0)?1/0:null,P((async()=>{const r=z((async()=>({value:await e.iterator(),done:!1})));return s=r.take(t),new j(s,n);var s,n}),r)}skip(t){const e=this;let r;return r=null!=this.size&&t>=0&&this.size>=t?this.size-t:null!=this.size&&(this.size(await e.iterator()).skip(t)),r)}shuffle(t,r,s=!0){if(null==t||t<0)throw null==this.size?new RangeError("`Dataset.shuffle()` requires bufferSize to be specified."):new RangeError(`\`Dataset.shuffle()\` requires bufferSize to be specified. If your data fits in main memory (for regular JS objects), and/or GPU memory (for \`tf.Tensor\`s), consider setting bufferSize to the dataset size (${this.size} elements)`);const n=this,i=c(r||e.util.now().toString());return P((async()=>{let e=i.int32();return s&&(e+=i.int32()),(await n.iterator()).shuffle(t,e.toString())}),this.size)}take(t){const e=this;let r;return r=null!=this.size&&this.size>t?t:null!=this.size&&this.size<=t?this.size:null,P((async()=>(await e.iterator()).take(t)),r)}async toArray(){if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArray()}async toArrayForTest(){if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArrayForTest()}}function P(t,e=null){return new class extends B{constructor(){super(...arguments),this.size=e}async iterator(){return t()}}}function W(t){if(null===t)return null;const r=t[0];if(null==(s=r)||null===(n=s)||"object"!=typeof n&&"function"!=typeof n||Array.isArray(s)||"object"==typeof s&&s instanceof e.Tensor||e.util.isTypedArray(s)){return{value:function(t){if(0===t.length)throw new Error("Can't make a batch of zero elements.");return t[0]instanceof e.Tensor?e.stack(t):e.tensor(t)}(t),recurse:!1}}var s,n;return{value:null,recurse:!0}}B.MAX_BUFFER_SIZE=1e4;class _ extends B{constructor(t){super(),this.input=t}async iterator(){return(await this.input.iterator()).decodeUTF8().split("\n").map((t=>(t.endsWith("\r")&&(t=t.slice(0,-1)),t)))}}const V='"',U=Symbol("out"),Q=Symbol("field"),X=Symbol("quote"),G=Symbol("quoteafterquote"),Z=Symbol("quoteinquote");class J extends B{constructor(t,r){super(),this.input=t,this.hasHeader=!0,this.fullColumnNames=null,this.columnNamesValidated=!1,this.columnConfigs=null,this.configuredColumnsOnly=!1,this.delimiter=",",this.delimWhitespace=!1,this.base=new _(t),r||(r={}),this.hasHeader=!1!==r.hasHeader,this.fullColumnNames=r.columnNames,this.columnConfigs=r.columnConfigs,this.configuredColumnsOnly=r.configuredColumnsOnly,r.delimWhitespace?(e.util.assert(null==r.delimiter,(()=>"Delimiter should not be provided when delimWhitespace is true.")),this.delimWhitespace=!0,this.delimiter=" "):this.delimiter=r.delimiter?r.delimiter:","}async columnNames(){return this.columnNamesValidated||await this.setColumnNames(),this.configuredColumnsOnly?Object.keys(this.columnConfigs):this.fullColumnNames}async setColumnNames(){const t=await this.maybeReadHeaderLine();if(!this.fullColumnNames&&!t)throw new Error("Column names must be provided if there is no header line.");this.fullColumnNames&&t&&e.util.assert(t.length===this.fullColumnNames.length,(()=>"The length of provided columnNames ("+this.fullColumnNames.length.toString()+") does not match the length of the header line read from file ("+t.length.toString()+").")),this.fullColumnNames||(this.fullColumnNames=t);const r=this.fullColumnNames.reduce(((t,e)=>(t[e]=t[e]+1||1,t)),{}),s=Object.keys(r).filter((t=>r[t]>1));if(e.util.assert(0===s.length,(()=>"Duplicate column names found: "+s.toString())),this.columnConfigs)for(const t of Object.keys(this.columnConfigs)){if(-1===this.fullColumnNames.indexOf(t))throw new Error('The key "'+t+'" provided in columnConfigs does not match any of the column names ('+this.fullColumnNames.toString()+").")}this.columnNamesValidated=!0}async maybeReadHeaderLine(){if(this.hasHeader){const t=await this.base.iterator(),e=await t.next();if(e.done)throw new Error("No data was found for CSV parsing.");const r=e.value;return this.parseRow(r,!1)}return null}async iterator(){this.columnNamesValidated||await this.setColumnNames();let t=await this.base.iterator();return this.hasHeader&&(t=t.skip(1)),t.map((t=>this.makeDataElement(t)))}makeDataElement(t){const e=this.parseRow(t),r={},s={};for(let n=0;n14||!Number.isInteger(e))throw new Error(`Invalid fftSize: it must be a power of 2 between 2 to 4 and 2 to 14, but got ${this.fftSize}`);if(this.numFrames=t.numFramesPerSpectrogram||43,this.sampleRateHz=t.sampleRateHz,this.columnTruncateLength=t.columnTruncateLength||this.fftSize,this.audioTrackConstraints=t.audioTrackConstraints,this.smoothingTimeConstant=t.smoothingTimeConstant||0,this.includeSpectrogram=!1!==t.includeSpectrogram,this.includeWaveform=!0===t.includeWaveform,!this.includeSpectrogram&&!this.includeWaveform)throw new Error("Both includeSpectrogram and includeWaveform are false. At least one type of data should be returned.")}summary(){return"microphone"}static async create(t={}){if(e.env().get("IS_NODE"))throw new Error("microphone API is only supported in browser environment.");const r=new Y(t);return await r.start(),r}async start(){try{this.stream=await navigator.mediaDevices.getUserMedia({audio:null==this.audioTrackConstraints||this.audioTrackConstraints,video:!1})}catch(t){throw new Error(`Error thrown while initializing video stream: ${t.message}`)}if(!this.stream)throw new Error("Could not obtain audio from microphone.");const t=window.AudioContext||window.webkitAudioContext;if(this.audioContext=new t,this.sampleRateHz){if(this.audioContext.sampleRate!==this.sampleRateHz)throw new Error(`Mismatch in sampling rate: Expected: ${this.sampleRateHz}; Actual: ${this.audioContext.sampleRate}`)}else this.sampleRateHz=this.audioContext.sampleRate;const e=this.audioContext.createMediaStreamSource(this.stream);this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=2*this.fftSize,this.analyser.smoothingTimeConstant=this.smoothingTimeConstant,e.connect(this.analyser),this.freqData=new Float32Array(this.fftSize),this.timeData=new Float32Array(this.fftSize)}async next(){if(this.isClosed)return{value:null,done:!0};let t,e;const r=await this.getAudioData();if(this.includeSpectrogram){const e=this.flattenQueue(r.freqDataQueue);t=this.getTensorFromAudioDataArray(e,[this.numFrames,this.columnTruncateLength,1])}if(this.includeWaveform){const t=this.flattenQueue(r.timeDataQueue);e=this.getTensorFromAudioDataArray(t,[this.numFrames*this.fftSize,1])}return{value:{spectrogram:t,waveform:e},done:!1}}async capture(){return(await this.next()).value}async getAudioData(){const t=[],e=[];let r=0;return new Promise((s=>{const n=setInterval((()=>{this.includeSpectrogram&&(this.analyser.getFloatFrequencyData(this.freqData),this.freqData[0]===-1/0&&s({freqDataQueue:t,timeDataQueue:e}),t.push(this.freqData.slice(0,this.columnTruncateLength))),this.includeWaveform&&(this.analyser.getFloatTimeDomainData(this.timeData),e.push(this.timeData.slice())),++r===this.numFrames&&(clearInterval(n),s({freqDataQueue:t,timeDataQueue:e}))}),this.fftSize/this.sampleRateHz*1e3)}))}stop(){this.isClosed||(this.isClosed=!0,this.analyser.disconnect(),this.audioContext.close(),null!=this.stream&&this.stream.getTracks().length>0&&this.stream.getTracks()[0].stop())}toArray(){throw new Error("Can not convert infinite audio stream to array.")}getSampleRate(){return this.sampleRateHz}flattenQueue(t){const e=t[0].length,r=new Float32Array(t.length*e);return t.forEach(((t,s)=>r.set(t,s*e))),r}getTensorFromAudioDataArray(t,r){const s=new Float32Array(e.util.sizeFromShape(r));return s.set(t,s.length-t.length),e.tensor(s,r)}}class K extends E{constructor(t,r){if(super(),this.webcamVideoElement=t,this.webcamConfig=r,this.isClosed=!0,this.resize=!1,this.needToResize())if(this.resize=!0,this.cropSize=[this.webcamConfig.resizeHeight,this.webcamConfig.resizeWidth],this.cropBoxInd=e.tensor1d([0],"int32"),this.webcamConfig.centerCrop){const t=1*this.webcamConfig.resizeWidth/this.webcamVideoElement.width,r=1*this.webcamConfig.resizeHeight/this.webcamVideoElement.height,s=(1-t)/2,n=(1-r)/2,i=s+t,a=r+n;this.cropBox=e.tensor2d([n,s,a,i],[1,4])}else this.cropBox=e.tensor2d([0,0,1,1],[1,4])}summary(){return"webcam"}static async create(t,r={}){if(e.env().get("IS_NODE"))throw new Error("tf.data.webcam is only supported in browser environment.");if(!t){if(t=document.createElement("video"),!r.resizeWidth||!r.resizeHeight)throw new Error("Please provide webcam video element, or resizeWidth and resizeHeight to create a hidden video element.");t.width=r.resizeWidth,t.height=r.resizeHeight}const s=new K(t,r);return await s.start(),s}async start(){this.webcamConfig.facingMode&&e.util.assert("user"===this.webcamConfig.facingMode||"environment"===this.webcamConfig.facingMode,(()=>`Invalid webcam facing mode: ${this.webcamConfig.facingMode}. Please provide 'user' or 'environment'`));try{this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:this.webcamConfig.deviceId,facingMode:this.webcamConfig.facingMode?this.webcamConfig.facingMode:"user",width:this.webcamVideoElement.width,height:this.webcamVideoElement.height}})}catch(t){throw t.message=`Error thrown while initializing video stream: ${t.message}`,t}if(!this.stream)throw new Error("Could not obtain video from webcam.");try{this.webcamVideoElement.srcObject=this.stream}catch(t){console.log(t),this.webcamVideoElement.src=window.URL.createObjectURL(this.stream)}return this.webcamVideoElement.play(),this.isClosed=!1,new Promise((t=>{this.webcamVideoElement.onloadedmetadata=()=>{t()}}))}async next(){if(this.isClosed)return{value:null,done:!0};let t;try{t=e.browser.fromPixels(this.webcamVideoElement)}catch(t){throw new Error(`Error thrown converting video to pixels: ${JSON.stringify(t)}`)}if(!this.resize)return{value:t,done:!1};try{return{value:this.cropAndResizeFrame(t),done:!1}}catch(t){throw new Error(`Error thrown cropping the video: ${t.message}`)}finally{t.dispose()}}needToResize(){return!(!this.webcamConfig.resizeWidth||!this.webcamConfig.resizeHeight||this.webcamVideoElement.width===this.webcamConfig.resizeWidth&&this.webcamVideoElement.height===this.webcamConfig.resizeHeight)}cropAndResizeFrame(t){return e.tidy((()=>{const r=e.expandDims(e.cast(t,"float32"),0);let s;s=e.image.cropAndResize(r,this.cropBox,this.cropBoxInd,this.cropSize,"bilinear");const n=s.shape;return e.reshape(s,n.slice(1))}))}async capture(){return(await this.next()).value}stop(){this.stream.getTracks().forEach((t=>t.stop()));try{this.webcamVideoElement.srcObject=null}catch(t){console.log(t),this.webcamVideoElement.src=null}this.isClosed=!0}toArray(){throw new Error("Can not convert infinite video stream to array.")}}class tt{}class et extends E{split(t){return new rt(this,t)}}class rt extends et{constructor(t,e){super(),this.upstream=t,this.impl=new st(t,e)}summary(){return this.impl.summary()}async next(){return this.impl.next()}}class st extends O{constructor(t,e){super(),this.upstream=t,this.separator=e,this.carryover=""}summary(){return`${this.upstream.summary()} -> Split('${this.separator}')`}async pump(){const t=await this.upstream.next();if(t.done)return""!==this.carryover&&(this.outputQueue.push(this.carryover),this.carryover="",!0);const e=t.value.split(this.separator);e[0]=this.carryover+e[0];for(const t of e.slice(0,-1))this.outputQueue.push(t);return this.carryover=e[e.length-1],!0}}class nt extends E{decodeUTF8(){return new it(this)}}class it extends et{constructor(t){super(),this.upstream=t,this.impl=new at(t)}summary(){return this.impl.summary()}async next(){return this.impl.next()}}class at extends O{constructor(t){if(super(),this.upstream=t,e.env().get("IS_BROWSER"))this.decoder=new TextDecoder("utf-8");else{const{StringDecoder:t}=require("string_decoder");this.decoder=new t("utf8")}}summary(){return`${this.upstream.summary()} -> Utf8`}async pump(){const t=await this.upstream.next();let r,s;return!t.done&&(r=t.value,s=e.env().get("IS_BROWSER")?this.decoder.decode(r,{stream:!0}):this.decoder.write(Buffer.from(r.buffer)),this.outputQueue.push(s),!0)}}class ot extends nt{constructor(t,r={}){super(),this.file=t,this.options=r,e.util.assert(t instanceof Uint8Array||!!e.env().get("IS_BROWSER")&&(t instanceof File||t instanceof Blob),(()=>"FileChunkIterator only supports File, Blob and Uint8Array right now.")),this.offset=r.offset||0,this.chunkSize=r.chunkSize||1048576}summary(){return`FileChunks ${this.file}`}async next(){if(this.offset>=(this.file instanceof Uint8Array?this.file.byteLength:this.file.size))return{value:null,done:!0};const t=new Promise(((t,e)=>{const r=this.offset+this.chunkSize;if(this.file instanceof Uint8Array)t(new Uint8Array(this.file.slice(this.offset,r)));else{const s=new FileReader;s.onload=r=>{let n=s.result;if(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),!(n instanceof Uint8Array))return e(new TypeError("FileReader returned unknown type."));t(n)},s.onabort=t=>e(new Error("Aborted")),s.onerror=t=>e(new Error(t.type));const n=this.file.slice(this.offset,r);s.readAsArrayBuffer(n)}this.offset=r}));return{value:await t,done:!1}}}const ut=t=>({method:t.method,headers:t.headers,body:t.body,mode:t.mode,credentials:t.credentials,cache:t.cache,redirect:t.redirect,referrer:t.referrer,integrity:t.integrity});function ht(t){return"string"==typeof t&&"file://"===t.substr(0,7)}class lt extends tt{constructor(t,e={}){super(),this.input=t,this.options=e}async iterator(){if(ht(this.input)&&e.env().get("IS_NODE")){const t=require("fs");this.input=t.readFileSync(this.input.substr(7))}return new ot(this.input,this.options)}}class ct extends tt{constructor(t,e={}){super(),this.url=t,this.fileOptions=e}async iterator(){return ht(this.url)?new lt(this.url,this.fileOptions).iterator():async function(t,r={}){let s,n;"string"==typeof t?s=t:(s=t.url,n=ut(t));const i=await e.util.fetch(s,n);if(i.ok){const t=new Uint8Array(await i.arrayBuffer());return new ot(t,r)}throw new Error(i.statusText)}(this.url,this.fileOptions)}}t.CSVDataset=J,t.Dataset=B,t.FileDataSource=lt,t.TextLineDataset=_,t.URLDataSource=ct,t.array=function(t){return P((async()=>C(t)),t.length)},t.csv=function(t,e={}){return new J(new ct(t),e)},t.func=function(t){const e=z(t);return P((async()=>e))},t.generator=function(t){return P((async()=>{const e=await t();return z((()=>e.next()))}))},t.microphone=async function(t){return Y.create(t)},t.version_data="3.6.0",t.webcam=async function(t,e){return K.create(t,e)},t.zip=function(t){if(!y(t))throw new Error("The argument to zip() must be an object or array.");let e;if(Array.isArray(t))for(let r=0;rfunction(t,e=l.FAIL){return new L(t,e)}(await w(t,(t=>{if(t instanceof B)return{value:t.iterator(),recurse:!1};if(y(t))return{value:null,recurse:!0};throw new Error("Leaves of the structure passed to zip() must be Datasets, not primitives.")})),l.SHORTEST)),e)},Object.defineProperty(t,"__esModule",{value:!0})})); -//# sourceMappingURL=tf-data.es2017.min.js.map diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.es2017.min.js.html b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.es2017.min.js.html deleted file mode 100644 index c7ea8b44c..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.es2017.min.js.html +++ /dev/null @@ -1,3229 +0,0 @@ - - - - - - - RollUp Visualizer - - - - -
- - - - diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.es2017.min.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.es2017.min.js.map deleted file mode 100644 index 9ce6b99bd..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.es2017.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tf-data.es2017.min.js","sources":["../node_modules/seedrandom/lib/alea.js","../node_modules/seedrandom/lib/xor128.js","../node_modules/seedrandom/lib/xorwow.js","../node_modules/seedrandom/lib/xorshift7.js","../node_modules/seedrandom/lib/xor4096.js","../node_modules/seedrandom/lib/tychei.js","../node_modules/seedrandom/seedrandom.js","../node_modules/seedrandom/index.js","../src/iterators/lazy_iterator.ts","../src/util/deep_map.ts","../src/util/deep_clone.ts","../src/util/ring_buffer.ts","../src/util/growing_ring_buffer.ts","../src/dataset.ts","../src/datasets/text_line_dataset.ts","../src/datasets/csv_dataset.ts","../src/iterators/microphone_iterator.ts","../src/iterators/webcam_iterator.ts","../src/datasource.ts","../src/iterators/string_iterator.ts","../src/iterators/byte_chunk_iterator.ts","../src/iterators/file_chunk_iterator.ts","../src/iterators/url_chunk_iterator.ts","../src/util/source_util.ts","../src/sources/file_data_source.ts","../src/sources/url_data_source.ts","../src/readers.ts","../src/version.ts"],"sourcesContent":["// A port of an algorithm by Johannes Baagøe , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baagøe \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xorshift7\" algorithm by\n// François Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n","// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n","// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","/*\nCopyright 2014 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\nvar global = this,\n width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\nmath['seed' + rngname] = seedrandom;\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n}\n\n// End anonymous scope, and pass initial values.\n})(\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n","// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by François Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport * as seedrandom from 'seedrandom';\n\nimport {Container} from '../types';\nimport {deepClone} from '../util/deep_clone';\nimport {deepMapAndAwaitAll, DeepMapAsyncResult, DeepMapResult, deepZip, zipToList} from '../util/deep_map';\nimport {GrowingRingBuffer} from '../util/growing_ring_buffer';\nimport {RingBuffer} from '../util/ring_buffer';\n\n/**\n * A nested structure of LazyIterators, used as the input to zip().\n */\nexport type IteratorContainer = Container>;\n\n// Here we implement a simple asynchronous iterator.\n// This lets us avoid using either third-party stream libraries or\n// recent TypeScript language support requiring polyfills.\n\n/**\n * Create a `LazyIterator` from an array of items.\n */\nexport function iteratorFromItems(items: T[]): LazyIterator {\n return new ArrayIterator(items);\n}\n\n/**\n * Create a `LazyIterator` of incrementing integers.\n */\nexport function iteratorFromIncrementing(start: number): LazyIterator {\n let i = start;\n return iteratorFromFunction(() => ({value: i++, done: false}));\n}\n\n/**\n * Create a `LazyIterator` from a function.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const iter = tf.data.iteratorFromFunction(func);\n * await iter.forEachAsync(e => console.log(e));\n * ```\n *\n * @param func A function that produces data on each call.\n */\nexport function iteratorFromFunction(\n func: () =>\n IteratorResult| Promise>): LazyIterator {\n return new FunctionCallIterator(func);\n}\n\n/**\n * Create a `LazyIterator` by concatenating underlying streams, which are\n * themselves provided as a stream.\n *\n * This can also be thought of as a \"stream flatten\" operation.\n *\n * @param baseIterators A stream of streams to be concatenated.\n * @param baseErrorHandler An optional function that can intercept `Error`s\n * raised during a `next()` call on the base stream. This function can decide\n * whether the error should be propagated, whether the error should be\n * ignored, or whether the base stream should be terminated.\n */\nexport function iteratorFromConcatenated(\n baseIterators: LazyIterator>,\n baseErrorHandler?: (e: Error) => boolean): LazyIterator {\n return new ChainedIterator(baseIterators, baseErrorHandler);\n}\n\n/**\n * Create a `LazyIterator` by concatenating streams produced by calling a\n * stream-generating function a given number of times.\n *\n * Since a `LazyIterator` is read-once, it cannot be repeated, but this\n * function can be used to achieve a similar effect:\n *\n * LazyIterator.ofConcatenatedFunction(() => new MyIterator(), 6);\n *\n * @param iteratorFunc: A function that produces a new stream on each call.\n * @param count: The number of times to call the function.\n * @param baseErrorHandler An optional function that can intercept `Error`s\n * raised during a `next()` call on the base stream. This function can decide\n * whether the error should be propagated, whether the error should be\n * ignored, or whether the base stream should be terminated.\n */\nexport function iteratorFromConcatenatedFunction(\n iteratorFunc: () => IteratorResult>, count: number,\n baseErrorHandler?: (e: Error) => boolean): LazyIterator {\n return iteratorFromConcatenated(\n iteratorFromFunction(iteratorFunc).take(count), baseErrorHandler);\n}\n\n/**\n * Create a `LazyIterator` by zipping together an array, dict, or nested\n * structure of `LazyIterator`s (and perhaps additional constants).\n *\n * The underlying streams must provide elements in a consistent order such\n * that they correspond.\n *\n * Typically, the underlying streams should have the same number of\n * elements. If they do not, the behavior is determined by the\n * `mismatchMode` argument.\n *\n * The nested structure of the `iterators` argument determines the\n * structure of elements in the resulting iterator.\n *\n * @param iterators: An array or object containing LazyIterators at the\n * leaves.\n * @param mismatchMode: Determines what to do when one underlying iterator\n * is exhausted before the others. `ZipMismatchMode.FAIL` (the default)\n * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST`\n * causes the zipped iterator to terminate with the furst underlying\n * streams, so elements remaining on the longer streams are ignored.\n * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling\n * in nulls for the exhausted streams, until all streams are exhausted.\n */\nexport function iteratorFromZipped(\n iterators: IteratorContainer,\n mismatchMode: ZipMismatchMode = ZipMismatchMode.FAIL): LazyIterator {\n return new ZipIterator(iterators, mismatchMode);\n}\n\n/**\n * An asynchronous iterator, providing lazy access to a potentially\n * unbounded stream of elements.\n *\n * Iterator can be obtained from a dataset:\n * `const iter = await dataset.iterator();`\n */\nexport abstract class LazyIterator {\n // This class implements AsyncIterator, but we have not yet set the\n // TypeScript --downlevelIteration flag to enable that.\n\n abstract summary(): string;\n\n /**\n * Returns a `Promise` for the next element in the stream.\n *\n * When an item can be provided successfully, the return value is\n * `{value:T, done:false}`.\n *\n * Calling next() on a closed stream returns `{value:null, done:true}`.\n */\n abstract async next(): Promise>;\n\n /**\n * Collect all remaining elements of a bounded stream into an array.\n * Obviously this will succeed only for small streams that fit in memory.\n * Useful for testing.\n *\n * @returns A Promise for an array of stream elements, which will resolve\n * when the stream is exhausted.\n */\n async toArray(): Promise {\n const result: T[] = [];\n let x = await this.next();\n while (!x.done) {\n result.push(x.value);\n x = await this.next();\n }\n return result;\n }\n\n /**\n * Collect all elements of this dataset into an array with prefetching 100\n * elements. This is useful for testing, because the prefetch changes the\n * order in which the Promises are resolved along the processing pipeline.\n * This may help expose bugs where results are dependent on the order of\n * Promise resolution rather than on the logical order of the stream (i.e.,\n * due to hidden mutable state).\n *\n * @returns A Promise for an array of stream elements, which will resolve\n * when the stream is exhausted.\n */\n async toArrayForTest(): Promise {\n const stream = this.prefetch(100);\n const result: T[] = [];\n let x = await stream.next();\n while (!x.done) {\n result.push(x.value);\n x = await stream.next();\n }\n return result;\n }\n\n /**\n * Draw items from the stream until it is exhausted.\n *\n * This can be useful when the stream has side effects but no output. In\n * that case, calling this function guarantees that the stream will be\n * fully processed.\n */\n async resolveFully(): Promise {\n let x = await this.next();\n while (!x.done) {\n x = await this.next();\n }\n }\n\n /**\n * Draw items from the stream until it is exhausted, or a predicate fails.\n *\n * This can be useful when the stream has side effects but no output. In\n * that case, calling this function guarantees that the stream will be\n * fully processed.\n */\n async resolveWhile(predicate: (r: T) => boolean): Promise {\n let x = await this.next();\n let shouldContinue = predicate(x.value);\n while ((!x.done) && shouldContinue) {\n x = await this.next();\n shouldContinue = predicate(x.value);\n }\n }\n\n /**\n * Handles errors thrown on this stream using a provided handler function.\n *\n * @param handler A function that handles any `Error` thrown during a `next()`\n * call and returns true if the stream should continue (dropping the failed\n * call) or false if the stream should quietly terminate. If the handler\n * itself throws (or rethrows) an `Error`, that will be propagated.\n *\n * @returns A `LazyIterator` of elements passed through from upstream,\n * possibly filtering or terminating on upstream `next()` calls that\n * throw an `Error`.\n */\n handleErrors(handler: (error: Error) => boolean): LazyIterator {\n return new ErrorHandlingLazyIterator(this, handler);\n }\n\n // TODO(soergel): Implement reduce() etc.\n\n /**\n * Filters this stream according to `predicate`.\n *\n * @param predicate A function mapping a stream element to a boolean or a\n * `Promise` for one.\n *\n * @returns A `LazyIterator` of elements for which the predicate was true.\n */\n filter(predicate: (value: T) => boolean): LazyIterator {\n return new FilterIterator(this, predicate);\n }\n\n /**\n * Maps this stream through a 1-to-1 transform.\n *\n * @param transform A function mapping a stream element to a transformed\n * element.\n *\n * @returns A `LazyIterator` of transformed elements.\n */\n map(transform: (value: T) => O): LazyIterator {\n return new MapIterator(this, transform);\n }\n\n /**\n * Maps this stream through an async 1-to-1 transform.\n *\n * @param transform A function mapping a stream element to a `Promise` for a\n * transformed stream element.\n *\n * @returns A `LazyIterator` of transformed elements.\n */\n mapAsync(transform: (value: T) => Promise): LazyIterator {\n return new AsyncMapIterator(this, transform);\n }\n\n /**\n * Maps this stream through a 1-to-1 transform, forcing serial execution.\n *\n * @param transform A function mapping a stream element to a transformed\n * element.\n *\n * @returns A `LazyIterator` of transformed elements.\n */\n serialMapAsync(transform: (value: T) => Promise): LazyIterator {\n return new AsyncMapIterator(this, transform).serial();\n }\n\n /**\n * Maps this stream through a 1-to-many transform.\n *\n * @param transform A function mapping a stream element to an array of\n * transformed elements.\n *\n * @returns A `DataStream` of transformed elements.\n */\n flatmap(transform: (value: T) => O[]): LazyIterator {\n return new FlatmapIterator(this, transform);\n }\n\n /**\n * Apply a function to every element of the stream.\n *\n * @param f A function to apply to each stream element.\n */\n async forEachAsync(f: (value: T) => void): Promise {\n return this.map(f).resolveFully();\n }\n\n /**\n * Apply a function to every element of the stream, forcing serial execution.\n *\n * @param f A function to apply to each stream element. Should return 'true'\n * to indicate that the stream should continue, or 'false' to cause it to\n * terminate.\n */\n async serialForEach(f: (value: T) => Promise): Promise {\n return this.serialMapAsync(f).resolveWhile(x => (x === true));\n }\n\n /**\n * Groups elements into batches, represented as arrays of elements.\n *\n * We can think of the elements of this iterator as 'rows' (even if they are\n * nested structures). By the same token, consecutive values for a given\n * key within the elements form a 'column'. This matches the usual sense of\n * 'row' and 'column' when processing tabular data (e.g., parsing a CSV).\n *\n * Thus, \"Row-major\" means that the resulting batch is simply a collection of\n * rows: `[row1, row2, row3, ...]`. This is contrast to the column-major\n * form, which is needed for vectorized computation.\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @returns A `LazyIterator` of batches of elements, represented as arrays\n * of the original element type.\n */\n rowMajorBatch(batchSize: number, smallLastBatch = true): LazyIterator {\n return new RowMajorBatchIterator(this, batchSize, smallLastBatch);\n }\n\n /**\n * Groups elements into batches, represented in column-major form.\n *\n * We can think of the elements of this iterator as 'rows' (even if they are\n * nested structures). By the same token, consecutive values for a given\n * key within the elements form a 'column'. This matches the usual sense of\n * 'row' and 'column' when processing tabular data (e.g., parsing a CSV).\n *\n * Thus, \"column-major\" means that the resulting batch is a (potentially\n * nested) structure representing the columns. Each column entry, then,\n * contains a collection of the values found in that column for a range of\n * input elements. This representation allows for vectorized computation, in\n * contrast to the row-major form.\n *\n * The inputs should all have the same nested structure (i.e., of arrays and\n * dicts). The result is a single object with the same nested structure,\n * where the leaves are arrays collecting the values of the inputs at that\n * location (or, optionally, the result of a custom function applied to those\n * arrays).\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @param zipFn: (optional) A function that expects an array of elements at a\n * single node of the object tree, and returns a `DeepMapResult`. The\n * `DeepMapResult` either provides a result value for that node (i.e.,\n * representing the subtree), or indicates that the node should be processed\n * recursively. The default zipFn recurses as far as possible and places\n * arrays at the leaves.\n * @returns A `LazyIterator` of batches of elements, represented as an object\n * with collections at the leaves.\n */\n columnMajorBatch(\n batchSize: number, smallLastBatch = true,\n // tslint:disable-next-line:no-any\n zipFn: (xs: any[]) => DeepMapResult = zipToList):\n LazyIterator {\n // First collect the desired number of input elements as a row-major batch.\n const rowBatches = this.rowMajorBatch(batchSize, smallLastBatch);\n // Now 'rotate' or 'pivot' the data, collecting all values from each column\n // in the batch (i.e., for each key within the elements) into an array.\n return rowBatches.map(x => deepZip(x, zipFn));\n }\n\n /**\n * Concatenate this `LazyIterator` with another.\n *\n * @param iterator A `LazyIterator` to be concatenated onto this one.\n * @param baseErrorHandler An optional function that can intercept `Error`s\n * raised during a `next()` call on the base stream. This function can\n * decide whether the error should be propagated, whether the error should\n * be ignored, or whether the base stream should be terminated.\n * @returns A `LazyIterator`.\n */\n concatenate(\n iterator: LazyIterator,\n baseErrorHandler?: (e: Error) => boolean): LazyIterator {\n return new ChainedIterator(\n iteratorFromItems([this, iterator]), baseErrorHandler);\n }\n\n /**\n * Limits this stream to return at most `count` items.\n *\n * @param count The maximum number of items to provide from the stream. If\n * a negative or undefined value is given, the entire stream is returned\n * unaltered.\n */\n take(count: number): LazyIterator {\n if (count < 0 || count == null) {\n return this;\n }\n return new TakeIterator(this, count);\n }\n\n /**\n * Skips the first `count` items in this stream.\n *\n * @param count The number of items to skip. If a negative or undefined\n * value is given, the entire stream is returned unaltered.\n */\n skip(count: number): LazyIterator {\n if (count < 0 || count == null) {\n return this;\n }\n return new SkipIterator(this, count);\n }\n\n /**\n * Prefetch the first `bufferSize` items in this stream.\n *\n * Note this prefetches Promises, but makes no guarantees about when those\n * Promises resolve.\n *\n * @param bufferSize: An integer specifying the number of elements to be\n * prefetched.\n */\n prefetch(bufferSize: number): LazyIterator {\n return new PrefetchIterator(this, bufferSize);\n }\n\n // TODO(soergel): deep sharded shuffle, where supported\n\n /**\n * Randomly shuffles the elements of this stream.\n *\n * @param bufferSize: An integer specifying the number of elements from\n * this stream from which the new stream will sample.\n * @param seed: (Optional.) An integer specifying the random seed that\n * will be used to create the distribution.\n */\n shuffle(windowSize: number, seed?: string): LazyIterator {\n return new ShuffleIterator(this, windowSize, seed);\n }\n\n /**\n * Force an iterator to execute serially: each next() call will await the\n * prior one, so that they cannot execute concurrently.\n */\n serial(): LazyIterator {\n return new SerialIterator(this);\n }\n}\n\n// ============================================================================\n// The following private classes serve to implement the chainable methods\n// on LazyIterator. Unfortunately they can't be placed in separate files,\n// due to resulting trouble with circular imports.\n// ============================================================================\n\n// Iterators that just extend LazyIterator directly\n// ============================================================================\n\nclass ArrayIterator extends LazyIterator {\n private trav = 0;\n constructor(protected items: T[]) {\n super();\n }\n\n summary() {\n return `Array of ${this.items.length} items`;\n }\n\n async next(): Promise> {\n if (this.trav >= this.items.length) {\n return {value: null, done: true};\n }\n const item = this.items[this.trav];\n this.trav++;\n return {value: deepClone(item), done: false};\n }\n}\n\nclass FunctionCallIterator extends LazyIterator {\n constructor(\n protected nextFn: () => IteratorResult| Promise>) {\n super();\n }\n\n summary() {\n return `Function call`;\n }\n\n async next(): Promise> {\n try {\n return this.nextFn();\n } catch (e) {\n // Modify the error message but leave the stack trace intact\n e.message =\n `Error thrown while iterating through a dataset: ${e.message}`;\n throw e;\n }\n }\n}\n\nclass SerialIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n constructor(protected upstream: LazyIterator) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> Serial`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n return this.upstream.next();\n }\n}\n\nclass SkipIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n // Local state that should not be clobbered by out-of-order execution.\n count = 0;\n\n constructor(protected upstream: LazyIterator, protected maxCount: number) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> Skip`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n // TODO(soergel): consider tradeoffs of reading in parallel, eg.\n // collecting next() promises in an Array and then waiting for\n // Promise.all() of those. Benefit: pseudo-parallel execution. Drawback:\n // maybe delayed GC.\n while (this.count++ < this.maxCount) {\n const skipped = await this.upstream.next();\n // short-circuit if upstream is already empty\n if (skipped.done) {\n return skipped;\n }\n tf.dispose(skipped.value as {});\n }\n return this.upstream.next();\n }\n}\n\nclass TakeIterator extends LazyIterator {\n count = 0;\n constructor(protected upstream: LazyIterator, protected maxCount: number) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Take`;\n }\n\n async next(): Promise> {\n if (this.count++ >= this.maxCount) {\n return {value: null, done: true};\n }\n return this.upstream.next();\n }\n}\n\n// Note this batch just groups items into row-wise element arrays.\n// Rotating these to a column-wise representation happens only at the dataset\n// level.\nclass RowMajorBatchIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n constructor(\n protected upstream: LazyIterator, protected batchSize: number,\n protected enableSmallLastBatch = true) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> RowMajorBatch`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n const batch: T[] = [];\n while (batch.length < this.batchSize) {\n const item = await this.upstream.next();\n if (item.done) {\n if (this.enableSmallLastBatch && batch.length > 0) {\n return {value: batch, done: false};\n }\n return {value: null, done: true};\n }\n batch.push(item.value);\n }\n return {value: batch, done: false};\n }\n}\n\nclass FilterIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n constructor(\n protected upstream: LazyIterator,\n protected predicate: (value: T) => boolean) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> Filter`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n while (true) {\n const item = await this.upstream.next();\n if (item.done || this.predicate(item.value)) {\n return item;\n }\n tf.dispose(item.value as {});\n }\n }\n}\n\nclass MapIterator extends LazyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected transform: (value: I) => O) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Map`;\n }\n\n async next(): Promise> {\n const item = await this.upstream.next();\n if (item.done) {\n return {value: null, done: true};\n }\n const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {});\n // Careful: the transform may mutate the item in place.\n // That's why we have to remember the input Tensors above, and then\n // below dispose only those that were not passed through to the output.\n // Note too that the transform function is responsible for tidying\n // any intermediate Tensors. Here we are concerned only about the\n // inputs.\n const mapped = this.transform(item.value);\n const outputTensors = tf.tensor_util.getTensorsInContainer(mapped as {});\n\n // TODO(soergel) faster intersection\n // TODO(soergel) move to tf.disposeExcept(in, out)?\n for (const t of inputTensors) {\n if (!tf.tensor_util.isTensorInList(t, outputTensors)) {\n t.dispose();\n }\n }\n return {value: mapped, done: false};\n }\n}\n\nclass ErrorHandlingLazyIterator extends LazyIterator {\n count = 0;\n constructor(\n protected upstream: LazyIterator,\n protected handler: (error: Error) => boolean) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> handleErrors`;\n }\n\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n async serialNext(): Promise> {\n while (true) {\n try {\n return await this.upstream.next();\n } catch (e) {\n if (!this.handler(e)) {\n return {value: null, done: true};\n }\n // If the handler returns true, loop and fetch the next upstream item.\n\n // If the upstream iterator throws an endless stream of errors, and if\n // the handler says to ignore them, then we loop forever here. That is\n // the correct behavior-- it's up to the handler to decide when to stop.\n }\n }\n }\n}\n\nclass AsyncMapIterator extends LazyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected transform: (value: I) => Promise) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> AsyncMap`;\n }\n\n async next(): Promise> {\n const item = await this.upstream.next();\n if (item.done) {\n return {value: null, done: true};\n }\n const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {});\n // Careful: the transform may mutate the item in place.\n // That's why we have to remember the input Tensors above, and then\n // below dispose only those that were not passed through to the output.\n // Note too that the transform function is responsible for tidying\n // any intermediate Tensors. Here we are concerned only about the\n // inputs.\n const mapped = await this.transform(item.value);\n const outputTensors = tf.tensor_util.getTensorsInContainer(mapped as {});\n\n // TODO(soergel) faster intersection\n // TODO(soergel) move to tf.disposeExcept(in, out)?\n for (const t of inputTensors) {\n if (!tf.tensor_util.isTensorInList(t, outputTensors)) {\n t.dispose();\n }\n }\n return {value: mapped, done: false};\n }\n}\n\n// Iterators that maintain a queue of pending items\n// ============================================================================\n\n/**\n * A base class for transforming streams that operate by maintaining an\n * output queue of elements that are ready to return via next(). This is\n * commonly required when the transformation is 1-to-many: A call to next()\n * may trigger a call to the underlying stream, which will produce many\n * mapped elements of this stream-- of which we need to return only one, so\n * we have to queue the rest.\n */\nexport abstract class OneToManyIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n // Local state that should not be clobbered by out-of-order execution.\n protected outputQueue: RingBuffer;\n\n constructor() {\n super();\n this.outputQueue = new GrowingRingBuffer();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n /**\n * Read one or more chunks from upstream and process them, possibly\n * reading or writing a carryover, and adding processed items to the\n * output queue. Note it's possible that no items are added to the queue\n * on a given pump() call, even if the upstream stream is not closed\n * (e.g., because items are filtered).\n *\n * @return `true` if any action was taken, i.e. fetching items from the\n * upstream source OR adding items to the output queue. `false` if the\n * upstream source is exhausted AND nothing was added to the queue\n * (i.e., any remaining carryover).\n */\n protected abstract async pump(): Promise;\n\n async serialNext(): Promise> {\n // Fetch so that the queue contains at least one item if possible.\n // If the upstream source is exhausted, AND there are no items left in\n // the output queue, then this stream is also exhausted.\n while (this.outputQueue.length() === 0) {\n // TODO(soergel): consider parallel reads.\n if (!await this.pump()) {\n return {value: null, done: true};\n }\n }\n return {value: this.outputQueue.shift(), done: false};\n }\n}\nclass FlatmapIterator extends OneToManyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected transform: (value: I) => O[]) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Flatmap`;\n }\n\n async pump(): Promise {\n const item = await this.upstream.next();\n if (item.done) {\n return false;\n }\n const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {});\n // Careful: the transform may mutate the item in place.\n // that's why we have to remember the input Tensors above, and then\n // below dispose only those that were not passed through to the output.\n // Note too that the transform function is responsible for tidying any\n // intermediate Tensors. Here we are concerned only about the inputs.\n const mappedArray = this.transform(item.value);\n const outputTensors =\n tf.tensor_util.getTensorsInContainer(mappedArray as {});\n this.outputQueue.pushAll(mappedArray);\n\n // TODO(soergel) faster intersection, and deduplicate outputTensors\n // TODO(soergel) move to tf.disposeExcept(in, out)?\n for (const t of inputTensors) {\n if (!tf.tensor_util.isTensorInList(t, outputTensors)) {\n t.dispose();\n }\n }\n\n return true;\n }\n}\n\n/**\n * Provides a `LazyIterator` that concatenates a stream of underlying\n * streams.\n *\n * Doing this in a concurrency-safe way requires some trickery. In\n * particular, we want this stream to return the elements from the\n * underlying streams in the correct order according to when next() was\n * called, even if the resulting Promises resolve in a different order.\n */\nexport class ChainedIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise> = null;\n\n // Local state that should not be clobbered by out-of-order execution.\n private iterator: LazyIterator = null;\n private moreIterators: LazyIterator>;\n\n constructor(\n iterators: LazyIterator>,\n private readonly baseErrorHandler?: (e: Error) => boolean) {\n super();\n this.moreIterators = iterators;\n }\n\n summary() {\n const upstreamSummaries = 'TODO: fill in upstream of chained summaries';\n return `${upstreamSummaries} -> Chained`;\n }\n\n async next(): Promise> {\n this.lastRead = this.readFromChain(this.lastRead);\n return this.lastRead;\n }\n\n private async readFromChain(lastRead: Promise>):\n Promise> {\n // Must await on the previous read since the previous read may have advanced\n // the stream of streams, from which we need to read.\n // This is unfortunate since we can't parallelize reads. Which means\n // prefetching of chained streams is a no-op.\n // One solution is to prefetch immediately upstream of this.\n await lastRead;\n if (this.iterator == null) {\n const iteratorResult = await this.moreIterators.next();\n if (iteratorResult.done) {\n // No more streams to stream from.\n return {value: null, done: true};\n }\n this.iterator = iteratorResult.value;\n if (this.baseErrorHandler != null) {\n this.iterator = this.iterator.handleErrors(this.baseErrorHandler);\n }\n }\n const itemResult = await this.iterator.next();\n if (itemResult.done) {\n this.iterator = null;\n return this.readFromChain(lastRead);\n }\n return itemResult;\n }\n}\n\nexport enum ZipMismatchMode {\n FAIL, // require zipped streams to have the same length\n SHORTEST, // terminate zip when the first stream is exhausted\n LONGEST // use nulls for exhausted streams; use up the longest stream.\n}\n\n/**\n * Provides a `LazyIterator` that zips together an array, dict, or nested\n * structure of `LazyIterator`s (and perhaps additional constants).\n *\n * The underlying streams must provide elements in a consistent order such\n * that they correspond.\n *\n * Typically, the underlying streams should have the same number of\n * elements. If they do not, the behavior is determined by the\n * `mismatchMode` argument.\n *\n * The nested structure of the `iterators` argument determines the\n * structure of elements in the resulting iterator.\n *\n * Doing this in a concurrency-safe way requires some trickery. In\n * particular, we want this stream to return the elements from the\n * underlying streams in the correct order according to when next() was\n * called, even if the resulting Promises resolve in a different order.\n *\n * @param iterators: An array or object containing LazyIterators at the\n * leaves.\n * @param mismatchMode: Determines what to do when one underlying iterator\n * is exhausted before the others. `ZipMismatchMode.FAIL` (the default)\n * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST`\n * causes the zipped iterator to terminate with the furst underlying\n * streams, so elements remaining on the longer streams are ignored.\n * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling\n * in nulls for the exhausted streams, until all streams are exhausted.\n */\nclass ZipIterator extends LazyIterator {\n private count = 0;\n private currentPromise: Promise> = null;\n\n constructor(\n protected readonly iterators: IteratorContainer,\n protected readonly mismatchMode: ZipMismatchMode = ZipMismatchMode.FAIL) {\n super();\n }\n\n summary() {\n const upstreamSummaries = 'TODO: fill in upstream of zip summaries';\n return `{${upstreamSummaries}} -> Zip`;\n }\n\n private async nextState(afterState: Promise>):\n Promise> {\n // This chaining ensures that the underlying next() are not even called\n // before the previous ones have resolved.\n await afterState;\n\n // Collect underlying iterator \"done\" signals as a side effect in\n // getNext()\n let numIterators = 0;\n let iteratorsDone = 0;\n\n function getNext(container: IteratorContainer): DeepMapAsyncResult {\n if (container instanceof LazyIterator) {\n const result = container.next();\n return {\n value: result.then(x => {\n numIterators++;\n if (x.done) {\n iteratorsDone++;\n }\n return x.value;\n }),\n recurse: false\n };\n } else {\n return {value: null, recurse: true};\n }\n }\n\n const mapped: O = await deepMapAndAwaitAll(this.iterators, getNext);\n\n if (numIterators === iteratorsDone) {\n // The streams have all ended.\n return {value: null, done: true};\n }\n if (iteratorsDone > 0) {\n switch (this.mismatchMode) {\n case ZipMismatchMode.FAIL:\n throw new Error(\n 'Zipped streams should have the same length. ' +\n `Mismatched at element ${this.count}.`);\n case ZipMismatchMode.SHORTEST:\n return {value: null, done: true};\n case ZipMismatchMode.LONGEST:\n default:\n // Continue. The exhausted streams already produced value: null.\n }\n }\n\n this.count++;\n return {value: mapped, done: false};\n }\n\n async next(): Promise> {\n this.currentPromise = this.nextState(this.currentPromise);\n return this.currentPromise;\n }\n}\n\n// Iterators that maintain a ring buffer of pending promises\n// ============================================================================\n\n/**\n * A stream that prefetches a given number of items from an upstream source,\n * returning them in FIFO order.\n *\n * Note this prefetches Promises, but makes no guarantees about when those\n * Promises resolve.\n */\nexport class PrefetchIterator extends LazyIterator {\n protected buffer: RingBuffer>>;\n\n constructor(\n protected upstream: LazyIterator, protected bufferSize: number) {\n super();\n this.buffer = new RingBuffer>>(bufferSize);\n }\n\n summary() {\n return `${this.upstream.summary()} -> Prefetch`;\n }\n\n /**\n * Refill the prefetch buffer. Returns only after the buffer is full, or\n * the upstream source is exhausted.\n */\n protected refill() {\n while (!this.buffer.isFull()) {\n const v = this.upstream.next();\n this.buffer.push(v);\n }\n }\n\n next(): Promise> {\n this.refill();\n // This shift will never throw an error because the buffer is always\n // full after a refill. If the stream is exhausted, the buffer will be\n // full of Promises that will resolve to the end-of-stream signal.\n return this.buffer.shift();\n }\n}\n\n/**\n * A stream that performs a sliding-window random shuffle on an upstream\n * source. This is like a `PrefetchIterator` except that the items are\n * returned in randomized order. Mixing naturally improves as the buffer\n * size increases.\n */\nexport class ShuffleIterator extends PrefetchIterator {\n private readonly random: seedrandom.prng;\n\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n // Local state that should not be clobbered by out-of-order execution.\n private upstreamExhausted = false;\n\n constructor(\n protected upstream: LazyIterator, protected windowSize: number,\n seed?: string) {\n super(upstream, windowSize);\n this.random = seedrandom.alea(seed || tf.util.now().toString());\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private randomInt(max: number) {\n return Math.floor(this.random() * max);\n }\n\n protected chooseIndex(): number {\n return this.randomInt(this.buffer.length());\n }\n\n async serialNext(): Promise> {\n // TODO(soergel): consider performance\n if (!this.upstreamExhausted) {\n this.refill();\n }\n while (!this.buffer.isEmpty()) {\n const chosenIndex = this.chooseIndex();\n const result = await this.buffer.shuffleExcise(chosenIndex);\n if (result.done) {\n this.upstreamExhausted = true;\n } else {\n this.refill();\n return result;\n }\n }\n return {value: null, done: true};\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\n\n// tslint:disable:no-any\n\n/**\n * A return value for a mapping function that can be applied via deepMap.\n *\n * If recurse is true, the value should be empty, and iteration will continue\n * into the object or array.\n */\nexport type DeepMapResult = {\n value: any,\n recurse: boolean\n};\n\n/**\n * Apply a mapping function to a nested structure in a recursive manner.\n *\n * The result of the mapping is an object with the same nested structure (i.e.,\n * of arrays and dicts) as the input, except that some subtrees are replaced,\n * according to the results of the mapping function.\n *\n * Mappings are memoized. Thus, if the nested structure contains the same\n * object in multiple positions, the output will contain the same mapped object\n * in those positions. Cycles are not supported, however.\n *\n * @param input: The object to which to apply the mapping function.\n * @param mapFn: A function that expects a single node of the object tree, and\n * returns a `DeepMapResult`. The `DeepMapResult` either provides a\n * replacement value for that node (i.e., replacing the subtree), or indicates\n * that the node should be processed recursively.\n */\nexport function deepMap(input: any, mapFn: (x: any) => DeepMapResult): any|\n any[] {\n return deepMapInternal(input, mapFn);\n}\n\n/**\n * @param seen: A Map of known object mappings (i.e., memoized results of\n * `mapFn()`)\n * @param containedIn: An set containing objects on the reference path currently\n * being processed (used to detect cycles).\n */\nfunction deepMapInternal(\n input: any, mapFn: (x: any) => DeepMapResult,\n seen: Map = new Map(), containedIn: Set<{}> = new Set()): any|\n any[] {\n if (input == null) {\n return null;\n }\n if (containedIn.has(input)) {\n throw new Error('Circular references are not supported.');\n }\n if (seen.has(input)) {\n return seen.get(input);\n }\n const result = mapFn(input);\n\n if (result.recurse && result.value !== null) {\n throw new Error(\n 'A deep map function may not return both a value and recurse=true.');\n }\n\n if (!result.recurse) {\n seen.set(input, result.value);\n return result.value;\n } else if (isIterable(input)) {\n // tslint:disable-next-line:no-any\n const mappedIterable: any|any[] = Array.isArray(input) ? [] : {};\n containedIn.add(input);\n for (const k in input) {\n const child = input[k];\n const childResult = deepMapInternal(child, mapFn, seen, containedIn);\n mappedIterable[k] = childResult;\n }\n containedIn.delete(input);\n return mappedIterable;\n } else {\n throw new Error(`Can't recurse into non-iterable type: ${input}`);\n }\n}\n\n// TODO(soergel, kangyizhang) Reconsider naming of deepZip() to avoid confusion\n// with zip()\n\n/**\n * Zip nested structures together in a recursive manner.\n *\n * This has the effect of transposing or pivoting data, e.g. converting it from\n * a row-major representation to a column-major representation.\n *\n * For example, `deepZip([{a: 1, b: 2}, {a: 3, b: 4}])` returns\n * `{a: [1, 3], b: [2, 4]}`.\n *\n * The inputs should all have the same nested structure (i.e., of arrays and\n * dicts). The result is a single object with the same nested structure, where\n * the leaves are arrays collecting the values of the inputs at that location\n * (or, optionally, the result of a custom function applied to those arrays).\n *\n * @param inputs: An array of the objects to zip together.\n * @param zipFn: (optional) A function that expects an array of elements at a\n * single node of the object tree, and returns a `DeepMapResult`. The\n * `DeepMapResult` either provides a result value for that node (i.e.,\n * representing the subtree), or indicates that the node should be processed\n * recursively. The default zipFn recurses as far as possible and places\n * arrays at the leaves.\n */\nexport function deepZip(\n inputs: any[], zipFn: (xs: any[]) => DeepMapResult = zipToList): any|any[] {\n return deepZipInternal(inputs, zipFn);\n}\n\n/**\n * @param containedIn: An set containing objects on the reference path currently\n * being processed (used to detect cycles).\n */\nfunction deepZipInternal(\n inputs: any[], zipFn: (xs: any[]) => DeepMapResult,\n containedIn: Set<{}> = new Set()): any|any[] {\n // The recursion follows the structure of input 0; it's assumed that all the\n // other inputs have the same structure.\n const input = inputs[0];\n if (containedIn.has(input)) {\n throw new Error('Circular references are not supported.');\n }\n const result = zipFn(inputs);\n\n if (result.recurse && result.value !== null) {\n throw new Error(\n 'A deep zip function may not return both a value and recurse=true.');\n }\n\n if (!result.recurse) {\n return result.value;\n } else if (isIterable(input)) {\n // tslint:disable-next-line:no-any\n const mappedIterable: any|any[] = Array.isArray(input) ? [] : {};\n containedIn.add(input);\n for (const k in input) {\n const children = inputs.map(x => x[k]);\n const childResult = deepZipInternal(children, zipFn, containedIn);\n mappedIterable[k] = childResult;\n }\n containedIn.delete(input);\n return mappedIterable;\n } else {\n throw new Error(`Can't recurse into non-iterable type: ${input}`);\n }\n}\n\n// tslint:disable-next-line:no-any\nexport function zipToList(x: any[]): DeepMapResult {\n if (x === null) {\n return null;\n }\n // TODO(soergel): validate array type?\n\n if (isIterable(x[0])) {\n return {value: null, recurse: true};\n } else {\n return {value: x, recurse: false};\n }\n}\n\n/**\n * A return value for an async map function for use with deepMapAndAwaitAll.\n *\n * If recurse is true, the value should be empty, and iteration will continue\n * into the object or array.\n */\nexport type DeepMapAsyncResult = {\n value: Promise,\n recurse: boolean\n};\n\n/**\n * Apply an async mapping function to a nested structure in a recursive manner.\n *\n * This first creates a nested structure of Promises, and then awaits all of\n * those, resulting in a single Promise for a resolved nested structure.\n *\n * The result of the mapping is an object with the same nested structure (i.e.,\n * of arrays and dicts) as the input, except that some subtrees are replaced,\n * according to the results of the mapping function.\n *\n * Mappings are memoized. Thus, if the nested structure contains the same\n * object in multiple positions, the output will contain the same mapped object\n * in those positions. Cycles are not supported, however.\n *\n * @param input: The object to which to apply the mapping function.\n * @param mapFn: A function that expects a single node of the object tree, and\n * returns a `DeepMapAsyncResult`. The `DeepMapAsyncResult` either provides\n * a `Promise` for a replacement value for that node (i.e., replacing the\n * subtree), or indicates that the node should be processed recursively. Note\n * that the decision whether or not to recurse must be made immediately; only\n * the mapped value may be promised.\n */\nexport async function deepMapAndAwaitAll(\n input: any, mapFn: (x: any) => DeepMapAsyncResult): Promise {\n const seen: Map> = new Map();\n\n // First do a normal deepMap, collecting Promises in 'seen' as a side effect.\n deepMapInternal(input, mapFn, seen);\n\n // Replace the Promises in 'seen' in place.\n // Note TypeScript provides no async map iteration, and regular map iteration\n // is broken too, so sadly we have to do Array.from() to make it work.\n // (There's no advantage to Promise.all(), and that would be tricky anyway.)\n for (const key of Array.from(seen.keys())) {\n const value = seen.get(key);\n if (tf.util.isPromise(value)) {\n const mappedValue = await value;\n seen.set(key, mappedValue);\n }\n }\n\n // Normal deepMap again, this time filling in the resolved values.\n // It's unfortunate that we have to do two passes.\n // TODO(soergel): test performance and think harder about a fast solution.\n const result = deepMapInternal(input, mapFn, seen);\n return result;\n}\n\n/**\n * Determine whether the argument is iterable.\n *\n * @returns true if the argument is an array or any non-Tensor object.\n */\n// tslint:disable-next-line:no-any\nexport function isIterable(obj: any): boolean {\n return obj != null && (!ArrayBuffer.isView(obj)) &&\n (Array.isArray(obj) ||\n (typeof obj === 'object' && !(obj instanceof tf.Tensor)));\n}\n\n/**\n * Determine whether the argument can be converted to Tensor.\n *\n * Tensors, primitives, arrays, and TypedArrays all qualify; anything else does\n * not.\n *\n * @returns true if the argument can be converted to Tensor.\n */\n// tslint:disable-next-line:no-any\nexport function canTensorify(obj: any): boolean {\n return obj == null || isPrimitive(obj) || Array.isArray(obj) ||\n (typeof obj === 'object' && (obj instanceof tf.Tensor)) ||\n tf.util.isTypedArray(obj);\n}\n\n/**\n * Returns true if the given `value` is a primitive type. Otherwise returns\n * false. This is equivalant to node util.isPrimitive\n */\nfunction isPrimitive(value: any): boolean {\n return (\n value === null ||\n (typeof value !== 'object' && typeof value !== 'function'));\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport {deepMap, DeepMapResult, isIterable} from './deep_map';\n\nexport function deepClone(container: T): T {\n return deepMap(container, cloneIfTensor);\n}\n\n// tslint:disable-next-line: no-any\nfunction cloneIfTensor(item: any): DeepMapResult {\n if (item instanceof tf.Tensor) {\n return ({value: item.clone(), recurse: false});\n } else if (isIterable(item)) {\n return {value: null, recurse: true};\n } else {\n return {value: item, recurse: false};\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\n/**\n * A ring buffer, providing O(1) FIFO, LIFO, and related operations.\n */\nexport class RingBuffer {\n // Note we store the indices in the range 0 <= index < 2*capacity.\n // This allows us to distinguish the full from the empty case.\n // See https://www.snellman.net/blog/archive/2016-12-13-ring-buffers/\n protected begin = 0; // inclusive\n protected end = 0; // exclusive\n protected doubledCapacity: number;\n\n protected data: T[];\n\n /**\n * Constructs a `RingBuffer`.\n * @param capacity The number of items that the buffer can accomodate.\n */\n constructor(public capacity: number) {\n if (capacity == null) {\n throw new RangeError('Can\\'t create a ring buffer of unknown capacity.');\n }\n if (capacity < 1) {\n throw new RangeError('Can\\'t create ring buffer of capacity < 1.');\n }\n this.data = new Array(capacity);\n this.doubledCapacity = 2 * capacity;\n }\n\n /**\n * Map any index into the range 0 <= index < 2*capacity.\n */\n protected wrap(index: number) {\n // don't trust % on negative numbers\n while (index < 0) {\n index += this.doubledCapacity;\n }\n return index % this.doubledCapacity;\n }\n\n protected get(index: number) {\n if (index < 0) {\n throw new RangeError('Can\\'t get item at a negative index.');\n }\n return this.data[index % this.capacity];\n }\n\n protected set(index: number, value: T) {\n if (index < 0) {\n throw new RangeError('Can\\'t set item at a negative index.');\n }\n this.data[index % this.capacity] = value;\n }\n\n /**\n * Returns the current number of items in the buffer.\n */\n length(): number {\n let length = this.end - this.begin;\n if (length < 0) {\n length = this.doubledCapacity + length;\n }\n return length;\n }\n\n /**\n * Reports whether the buffer is full.\n * @returns true if the number of items in the buffer equals its capacity, and\n * false otherwise.\n */\n isFull() {\n return this.length() === this.capacity;\n }\n\n /**\n * Reports whether the buffer is empty.\n * @returns true if the number of items in the buffer equals zero, and\n * false otherwise.\n */\n isEmpty() {\n return this.length() === 0;\n }\n\n /**\n * Adds an item to the end of the buffer.\n */\n push(value: T) {\n if (this.isFull()) {\n throw new RangeError('Ring buffer is full.');\n }\n this.set(this.end, value);\n this.end = this.wrap(this.end + 1);\n }\n\n /**\n * Adds many items to the end of the buffer, in order.\n */\n pushAll(values: T[]) {\n for (const value of values) {\n this.push(value);\n }\n }\n\n /**\n * Removes and returns the last item in the buffer.\n */\n pop(): T {\n if (this.isEmpty()) {\n throw new RangeError('Ring buffer is empty.');\n }\n this.end = this.wrap(this.end - 1);\n const result = this.get(this.end);\n this.set(this.end, undefined);\n return result;\n }\n\n /**\n * Adds an item to the beginning of the buffer.\n */\n unshift(value: T) {\n if (this.isFull()) {\n throw new RangeError('Ring buffer is full.');\n }\n this.begin = this.wrap(this.begin - 1);\n this.set(this.begin, value);\n }\n\n /**\n * Removes and returns the first item in the buffer.\n */\n shift(): T {\n if (this.isEmpty()) {\n throw new RangeError('Ring buffer is empty.');\n }\n const result = this.get(this.begin);\n this.set(this.begin, undefined);\n this.begin = this.wrap(this.begin + 1);\n return result;\n }\n\n /**\n * Removes and returns a specific item in the buffer, and moves the last item\n * to the vacated slot. This is useful for implementing a shuffling stream.\n * Note that this operation necessarily scrambles the original order.\n *\n * @param relativeIndex: the index of the item to remove, relative to the\n * first item in the buffer (e.g., hiding the ring nature of the underlying\n * storage).\n */\n shuffleExcise(relativeIndex: number): T {\n if (this.isEmpty()) {\n throw new RangeError('Ring buffer is empty.');\n }\n const index = this.wrap(this.begin + relativeIndex);\n const result = this.get(index);\n this.set(index, this.pop());\n return result;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {RingBuffer} from './ring_buffer';\n\nexport class GrowingRingBuffer extends RingBuffer {\n private static INITIAL_CAPACITY = 32;\n\n /**\n * Constructs a `GrowingRingBuffer`.\n */\n constructor() {\n super(GrowingRingBuffer.INITIAL_CAPACITY);\n }\n\n isFull() {\n return false;\n }\n\n push(value: T) {\n if (super.isFull()) {\n this.expand();\n }\n super.push(value);\n }\n\n unshift(value: T) {\n if (super.isFull()) {\n this.expand();\n }\n super.unshift(value);\n }\n\n /**\n * Doubles the capacity of the buffer.\n */\n private expand() {\n const newCapacity = this.capacity * 2;\n const newData = new Array(newCapacity);\n const len = this.length();\n\n // Rotate the buffer to start at index 0 again, since we can't just\n // allocate more space at the end.\n for (let i = 0; i < len; i++) {\n newData[i] = this.get(this.wrap(this.begin + i));\n }\n\n this.data = newData;\n this.capacity = newCapacity;\n this.doubledCapacity = 2 * this.capacity;\n this.begin = 0;\n this.end = len;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport {TensorContainer, TensorLike} from '@tensorflow/tfjs-core';\nimport * as seedrandom from 'seedrandom';\n\nimport {iteratorFromConcatenated, iteratorFromFunction, iteratorFromItems, iteratorFromZipped, LazyIterator, ZipMismatchMode} from './iterators/lazy_iterator';\nimport {Container} from './types';\nimport {canTensorify, deepMapAndAwaitAll, DeepMapResult, isIterable} from './util/deep_map';\n\n/**\n * A nested structure of Datasets, used as the input to zip().\n */\nexport type DatasetContainer = Container>;\n\n// TODO(soergel): consider vectorized operations within the pipeline.\n\n/**\n * Represents a potentially large list of independent data elements (typically\n * 'samples' or 'examples').\n *\n * A 'data example' may be a primitive, an array, a map from string keys to\n * values, or any nested structure of these.\n *\n * A `Dataset` represents an ordered collection of elements, together with a\n * chain of transformations to be performed on those elements. Each\n * transformation is a method of `Dataset` that returns another `Dataset`, so\n * these may be chained, e.g.\n * `const processedDataset = rawDataset.filter(...).map(...).batch(...)`.\n *\n * Data loading and transformation is done in a lazy, streaming fashion. The\n * dataset may be iterated over multiple times; each iteration starts the data\n * loading anew and recapitulates the transformations.\n *\n * A `Dataset` is typically processed as a stream of unbatched examples --i.e.,\n * its transformations are applied one example at a time. Batching produces a\n * new `Dataset` where each element is a batch. Batching should usually come\n * last in a pipeline, because data transformations are easier to express on a\n * per-example basis than on a per-batch basis.\n *\n * The following code examples are calling `await dataset.forEachAsync(...)` to\n * iterate once over the entire dataset in order to print out the data.\n *\n * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'}\n */\nexport abstract class Dataset {\n /*\n * Provide a new stream of elements. Note this will also start new streams\n * from any underlying `Dataset`s.\n *\n * CAUTION: Any Tensors contained within the elements returned from\n * this stream *must* be manually disposed to avoid a GPU memory leak.\n * The tf.tidy() approach cannot be used in an asynchronous context.\n */\n abstract async iterator(): Promise>;\n\n readonly size: number = null;\n\n // TODO(soergel): Make Datasets report whether repeated iterator() calls\n // produce the same result (e.g., reading from a file) or different results\n // (e.g., from the webcam). Currently we don't make this distinction but it\n // could be important for the user to know.\n // abstract isDeterministic(): boolean;\n\n /**\n * Groups elements into batches.\n *\n * It is assumed that each of the incoming dataset elements has the same\n * structure-- i.e. the same set of keys at each location in an object\n * hierarchy. For each key, the resulting `Dataset` provides a batched\n * element collecting all of the incoming values for that key.\n *\n * * Incoming primitives are grouped into a 1-D Tensor.\n * * Incoming Tensors are grouped into a new Tensor where the 0'th axis is\n * the batch dimension.\n * * Incoming arrays are converted to Tensor and then batched.\n * * A nested array is interpreted as an n-D Tensor, so the batched result\n * has n+1 dimensions.\n * * An array that cannot be converted to Tensor produces an error.\n *\n * If an array should not be batched as a unit, it should first be converted\n * to an object with integer keys.\n *\n * Here are a few examples:\n *\n * Batch a dataset of numbers:\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8]).batch(4);\n * await a.forEachAsync(e => e.print());\n * ```\n *\n * Batch a dataset of arrays:\n * ```js\n * const b = tf.data.array([[1], [2], [3], [4], [5], [6], [7], [8]]).batch(4);\n * await b.forEachAsync(e => e.print());\n * ```\n *\n * Batch a dataset of objects:\n * ```js\n * const c = tf.data.array([{a: 1, b: 11}, {a: 2, b: 12}, {a: 3, b: 13},\n * {a: 4, b: 14}, {a: 5, b: 15}, {a: 6, b: 16}, {a: 7, b: 17},\n * {a: 8, b: 18}]).batch(4);\n * await c.forEachAsync(e => {\n * console.log('{');\n * for(var key in e) {\n * console.log(key+':');\n * e[key].print();\n * }\n * console.log('}');\n * })\n * ```\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @returns A `Dataset`, from which a stream of batches can be obtained.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n batch(batchSize: number, smallLastBatch = true): Dataset {\n const base = this;\n tf.util.assert(\n batchSize > 0, () => `batchSize needs to be positive, but it is\n ${batchSize}`);\n let size;\n if (this.size === Infinity || this.size == null) {\n // If the size of this dataset is infinity or null, the new size keeps the\n // same.\n size = this.size;\n } else if (smallLastBatch) {\n // If the size of this dataset is known and include small last batch, the\n // new size is full batch count plus last batch.\n size = Math.ceil(this.size / batchSize);\n } else {\n // If the size of this dataset is known and not include small last batch,\n // the new size is full batch count.\n size = Math.floor(this.size / batchSize);\n }\n return datasetFromIteratorFn(async () => {\n return (await base.iterator())\n .columnMajorBatch(batchSize, smallLastBatch, deepBatchConcat);\n }, size);\n }\n\n /**\n * Concatenates this `Dataset` with another.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]);\n * const b = tf.data.array([4, 5, 6]);\n * const c = a.concatenate(b);\n * await c.forEachAsync(e => console.log(e));\n * ```\n *\n * @param dataset A `Dataset` to be concatenated onto this one.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n concatenate(dataset: Dataset): Dataset {\n const base = this;\n let size;\n if (this.size === Infinity || dataset.size === Infinity) {\n // If the size of any of these two dataset is infinity, new size is\n // infinity.\n size = Infinity;\n } else if (this.size != null && dataset.size != null) {\n // If the size of both datasets are known and not infinity, new size is\n // sum the size of these two datasets.\n size = this.size + dataset.size;\n } else {\n // If neither of these two datasets has infinite size and any of these two\n // datasets' size is null, the new size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () =>\n (await base.iterator()).concatenate(await dataset.iterator()),\n size);\n }\n\n /**\n * Filters this dataset according to `predicate`.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])\n * .filter(x => x%2 === 0);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param predicate A function mapping a dataset element to a boolean or a\n * `Promise` for one.\n *\n * @returns A `Dataset` of elements for which the predicate was true.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n filter(predicate: (value: T) => boolean): Dataset {\n const base = this;\n let size;\n if (this.size === Infinity) {\n // If the size of this dataset is infinity, new size is infinity\n size = Infinity;\n } else {\n // If this dataset has limited elements, new size is null because it might\n // exhausted randomly.\n size = null;\n }\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).filter(x => tf.tidy(() => predicate(x)));\n }, size);\n }\n\n /**\n * Apply a function to every element of the dataset.\n *\n * After the function is applied to a dataset element, any Tensors contained\n * within that element are disposed.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param f A function to apply to each dataset element.\n * @returns A `Promise` that resolves after all elements have been processed.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async forEachAsync(f: (input: T) => void): Promise {\n return (await this.iterator()).forEachAsync(f);\n }\n\n /**\n * Maps this dataset through a 1-to-1 transform.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]).map(x => x*x);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param transform A function mapping a dataset element to a transformed\n * dataset element.\n *\n * @returns A `Dataset` of transformed elements.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n map(transform: (value: T) => O): Dataset {\n const base = this;\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).map(x => tf.tidy(() => transform(x)));\n }, this.size);\n }\n\n /**\n * Maps this dataset through an async 1-to-1 transform.\n *\n * ```js\n * const a =\n * tf.data.array([1, 2, 3]).mapAsync(x => new Promise(function(resolve){\n * setTimeout(() => {\n * resolve(x * x);\n * }, Math.random()*1000 + 500);\n * }));\n * console.log(await a.toArray());\n * ```\n *\n * @param transform A function mapping a dataset element to a `Promise` for a\n * transformed dataset element. This transform is responsible for disposing\n * any intermediate `Tensor`s, i.e. by wrapping its computation in\n * `tf.tidy()`; that cannot be automated here (as it is in the synchronous\n * `map()` case).\n *\n * @returns A `Dataset` of transformed elements.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n mapAsync(transform: (value: T) => Promise):\n Dataset {\n const base = this;\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).mapAsync(transform);\n }, this.size);\n }\n\n /**\n * Creates a `Dataset` that prefetches elements from this dataset.\n *\n * @param bufferSize: An integer specifying the number of elements to be\n * prefetched.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n prefetch(bufferSize: number): Dataset {\n if (bufferSize == null) {\n throw new RangeError(\n '`Dataset.prefetch()` requires bufferSize to be specified.');\n }\n\n const base = this;\n return datasetFromIteratorFn(\n async () => (await base.iterator()).prefetch(bufferSize), this.size);\n }\n\n /**\n * Repeats this dataset `count` times.\n *\n * NOTE: If this dataset is a function of global state (e.g. a random number\n * generator), then different repetitions may produce different elements.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]).repeat(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: (Optional) An integer, representing the number of times\n * the dataset should be repeated. The default behavior (if `count` is\n * `undefined` or negative) is for the dataset be repeated indefinitely.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n repeat(count?: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && count > 0) {\n // If this dataset has size and count is positive, new size is current\n // size multiply count. This also covers the case that current size is\n // infinity.\n size = this.size * count;\n } else if (count === 0) {\n // If count is 0, new size is 0.\n size = 0;\n } else if (this.size != null && (count === undefined || count < 0)) {\n // If this dataset has size and count is undefined or negative, the\n // dataset will be repeated indefinitely and new size is infinity.\n size = Infinity;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(async () => {\n const iteratorIterator = iteratorFromFunction(\n async () => ({value: await base.iterator(), done: false}));\n return iteratorFromConcatenated(iteratorIterator.take(count));\n }, size);\n }\n\n /**\n * Creates a `Dataset` that skips `count` initial elements from this dataset.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).skip(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: The number of elements of this dataset that should be skipped\n * to form the new dataset. If `count` is greater than the size of this\n * dataset, the new dataset will contain no elements. If `count`\n * is `undefined` or negative, skips the entire dataset.\n *\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n skip(count: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && count >= 0 && this.size >= count) {\n // If the size of this dataset is greater than count, the new dataset's\n // size is current size minus skipped size.This also covers the case that\n // current size is infinity.\n size = this.size - count;\n } else if (\n this.size != null &&\n (this.size < count || count === undefined || count < 0)) {\n // If the size of this dataset is smaller than count, or count is\n // undefined or negative, skips the entire dataset and the new size is 0.\n size = 0;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () => (await base.iterator()).skip(count), size);\n }\n\n // TODO(soergel): deep sharded shuffle, where supported\n\n static readonly MAX_BUFFER_SIZE = 10000;\n\n /**\n * Pseudorandomly shuffles the elements of this dataset. This is done in a\n * streaming manner, by sampling from a given number of prefetched elements.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).shuffle(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param bufferSize: An integer specifying the number of elements from this\n * dataset from which the new dataset will sample.\n * @param seed: (Optional) An integer specifying the random seed that will\n * be used to create the distribution.\n * @param reshuffleEachIteration: (Optional) A boolean, which if true\n * indicates that the dataset should be pseudorandomly reshuffled each time\n * it is iterated over. If false, elements will be returned in the same\n * shuffled order on each iteration. (Defaults to `true`.)\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n shuffle(bufferSize: number, seed?: string, reshuffleEachIteration = true):\n Dataset {\n if (bufferSize == null || bufferSize < 0) {\n if (this.size == null) {\n throw new RangeError(\n '`Dataset.shuffle()` requires bufferSize to be specified.');\n } else {\n throw new RangeError(\n '`Dataset.shuffle()` requires bufferSize to be specified. ' +\n 'If your data fits in main memory (for regular JS objects), ' +\n 'and/or GPU memory (for `tf.Tensor`s), consider setting ' +\n `bufferSize to the dataset size (${this.size} elements)`);\n }\n }\n const base = this;\n const random = seedrandom.alea(seed || tf.util.now().toString());\n return datasetFromIteratorFn(async () => {\n let seed2 = random.int32();\n if (reshuffleEachIteration) {\n seed2 += random.int32();\n }\n return (await base.iterator()).shuffle(bufferSize, seed2.toString());\n }, this.size);\n }\n\n /**\n * Creates a `Dataset` with at most `count` initial elements from this\n * dataset.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).take(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: The number of elements of this dataset that should be taken\n * to form the new dataset. If `count` is `undefined` or negative, or if\n * `count` is greater than the size of this dataset, the new dataset will\n * contain all elements of this dataset.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n take(count: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && this.size > count) {\n // If the size of this dataset is greater than count, the new dataset's\n // size is count.\n size = count;\n } else if (this.size != null && this.size <= count) {\n // If the size of this dataset is equal or smaller than count, the new\n // dataset's size is the size of this dataset.\n size = this.size;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () => (await base.iterator()).take(count), size);\n }\n\n /**\n * Collect all elements of this dataset into an array.\n *\n * Obviously this will succeed only for small datasets that fit in memory.\n * Useful for testing and generally should be avoided if possible.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]);\n * console.log(await a.toArray());\n * ```\n *\n * @returns A Promise for an array of elements, which will resolve\n * when a new stream has been obtained and fully consumed.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async toArray() {\n if (this.size === Infinity) {\n throw new Error('Can not convert infinite data stream to array.');\n }\n return (await this.iterator()).toArray();\n }\n\n /**\n * Collect all elements of this dataset into an array with prefetching 100\n * elements. This is useful for testing, because the prefetch changes the\n * order in which the Promises are resolved along the processing pipeline.\n * This may help expose bugs where results are dependent on the order of\n * Promise resolution rather than on the logical order of the stream (i.e.,\n * due to hidden mutable state).\n *\n * @returns A Promise for an array of elements, which will resolve\n * when a new stream has been obtained and fully consumed.\n */\n async toArrayForTest() {\n if (this.size === Infinity) {\n throw new Error('Can not convert infinite data stream to array.');\n }\n return (await this.iterator()).toArrayForTest();\n }\n}\n\n/**\n * Create a `Dataset` defined by a provided iterator() function.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const iter = tf.data.iteratorFromFunction(func);\n * const ds = tf.data.datasetFromIteratorFn(iter);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n */\nexport function datasetFromIteratorFn(\n iteratorFn: () => Promise>,\n size: number = null): Dataset {\n return new class extends Dataset {\n size = size;\n\n /*\n * Provide a new stream of elements. Note this will also start new streams\n * from any underlying `Dataset`s.\n */\n async iterator(): Promise> {\n return iteratorFn();\n }\n }\n ();\n}\n\n/**\n * Create a `Dataset` from an array of elements.\n *\n * Create a Dataset from an array of objects:\n * ```js\n * const a = tf.data.array([{'item': 1}, {'item': 2}, {'item': 3}]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * Create a Dataset from an array of numbers:\n * ```js\n * const a = tf.data.array([4, 5, 6]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n * @param items An array of elements that will be parsed as items in a dataset.\n *\n * @doc {heading: 'Data', subheading: 'Creation', namespace: 'data'}\n */\nexport function array(items: T[]): Dataset {\n return datasetFromIteratorFn(\n async () => iteratorFromItems(items), items.length);\n}\n\n/**\n * Create a `Dataset` by zipping together an array, dict, or nested\n * structure of `Dataset`s (and perhaps additional constants).\n * The underlying datasets must provide elements in a consistent order such that\n * they correspond.\n *\n * The number of elements in the resulting dataset is the same as the size of\n * the smallest dataset in datasets.\n *\n * The nested structure of the `datasets` argument determines the\n * structure of elements in the resulting iterator.\n *\n * Note this means that, given an array of two datasets that produce dict\n * elements, the result is a dataset that produces elements that are arrays\n * of two dicts:\n *\n * Zip an array of datasets:\n * ```js\n * console.log('Zip two datasets of objects:');\n * const ds1 = tf.data.array([{a: 1}, {a: 2}, {a: 3}]);\n * const ds2 = tf.data.array([{b: 4}, {b: 5}, {b: 6}]);\n * const ds3 = tf.data.zip([ds1, ds2]);\n * await ds3.forEachAsync(e => console.log(JSON.stringify(e)));\n *\n * // If the goal is to merge the dicts in order to produce elements like\n * // {a: ..., b: ...}, this requires a second step such as:\n * console.log('Merge the objects:');\n * const ds4 = ds3.map(x => {return {a: x[0].a, b: x[1].b}});\n * await ds4.forEachAsync(e => console.log(e));\n * ```\n *\n * Zip a dict of datasets:\n * ```js\n * const a = tf.data.array([{a: 1}, {a: 2}, {a: 3}]);\n * const b = tf.data.array([{b: 4}, {b: 5}, {b: 6}]);\n * const c = tf.data.zip({c: a, d: b});\n * await c.forEachAsync(e => console.log(JSON.stringify(e)));\n * ```\n *\n * @doc {heading: 'Data', subheading: 'Operations', namespace: 'data'}\n */\nexport function zip(datasets: DatasetContainer):\n Dataset {\n // manually type-check the argument for JS users\n if (!isIterable(datasets)) {\n throw new Error('The argument to zip() must be an object or array.');\n }\n let size;\n if (Array.isArray(datasets)) {\n for (let i = 0; i < datasets.length; i++) {\n size = size == null ? (datasets[i] as Dataset).size :\n Math.min(size, (datasets[i] as Dataset).size);\n }\n } else if (datasets instanceof Object) {\n for (const ds in datasets) {\n size = size == null ? (datasets[ds] as Dataset).size :\n Math.min(size, (datasets[ds] as Dataset).size);\n }\n }\n return datasetFromIteratorFn(async () => {\n const streams = await deepMapAndAwaitAll(datasets, d => {\n if (d instanceof Dataset) {\n return {value: d.iterator(), recurse: false};\n } else if (isIterable(d)) {\n return {value: null, recurse: true};\n } else {\n throw new Error(\n 'Leaves of the structure passed to zip() must be Datasets, ' +\n 'not primitives.');\n }\n });\n return iteratorFromZipped(streams, ZipMismatchMode.SHORTEST);\n }, size);\n}\n\n/**\n * A zip function for use with deepZip, passed via the columnMajorBatch call.\n *\n * Accepts an array of identically-structured nested elements and either batches\n * them (if they are primitives, numeric arrays, or Tensors) or requests\n * recursion (if not).\n */\n// tslint:disable-next-line:no-any\nfunction deepBatchConcat(rows: any[]): DeepMapResult {\n if (rows === null) {\n return null;\n }\n\n // use the first item to decide whether to recurse or batch here.\n const exampleRow = rows[0];\n\n if (canTensorify(exampleRow)) {\n // rows is an array of primitives, Tensors, or arrays. Batch them.\n const value = batchConcat(rows);\n return {value, recurse: false};\n }\n\n // the example row is an object, so recurse into it.\n return {value: null, recurse: true};\n}\n\n/**\n * Assembles a list of same-shaped numbers, number arrays, or Tensors\n * into a single new Tensor where axis 0 is the batch dimension.\n */\nfunction batchConcat(arrays: T[]):\n tf.Tensor {\n if (arrays.length === 0) {\n // We can't return an empty Tensor because we don't know the element shape.\n throw new Error('Can\\'t make a batch of zero elements.');\n }\n\n if (arrays[0] instanceof tf.Tensor) {\n // Input is an array of Tensors\n return tf.stack(arrays as tf.Tensor[]);\n } else {\n // Input is a possibly-nested array of numbers.\n return tf.tensor(arrays as TensorLike);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {Dataset} from '../dataset';\nimport {DataSource} from '../datasource';\nimport {LazyIterator} from '../iterators/lazy_iterator';\n\n/**\n * Represents a potentially large collection of text lines.\n *\n * The results are not batched.\n */\nexport class TextLineDataset extends Dataset {\n /**\n * Create a `TextLineDataset`.\n *\n * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream.\n */\n constructor(protected readonly input: DataSource) {\n super();\n }\n\n async iterator(): Promise> {\n const inputIterator = await this.input.iterator();\n const utf8Iterator = inputIterator.decodeUTF8();\n const lineIterator = utf8Iterator.split('\\n').map(line => {\n // Windows/DOS format text file has extra line breaker at the end of line.\n if (line.endsWith('\\r')) {\n line = line.slice(0, -1);\n }\n return line;\n });\n return lineIterator;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {TensorContainer, util} from '@tensorflow/tfjs-core';\nimport {Dataset} from '../dataset';\nimport {DataSource} from '../datasource';\nimport {LazyIterator} from '../iterators/lazy_iterator';\nimport {ColumnConfig, CSVConfig} from '../types';\nimport {TextLineDataset} from './text_line_dataset';\n\nconst CODE_QUOTE = '\"';\nconst STATE_OUT = Symbol('out');\nconst STATE_FIELD = Symbol('field');\nconst STATE_QUOTE = Symbol('quote');\nconst STATE_QUOTE_AFTER_QUOTE = Symbol('quoteafterquote');\nconst STATE_WITHIN_QUOTE_IN_QUOTE = Symbol('quoteinquote');\n\n/**\n * Represents a potentially large collection of delimited text records.\n *\n * The produced `TensorContainer`s each contain one key-value pair for\n * every column of the table. When a field is empty in the incoming data, the\n * resulting value is `undefined`, or throw error if it is required. Values\n * that can be parsed as numbers are emitted as type `number`, other values\n * are parsed as `string`.\n *\n * The results are not batched.\n *\n * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'}\n */\nexport class CSVDataset extends Dataset {\n base: TextLineDataset;\n private hasHeader = true;\n private fullColumnNames: string[] = null;\n private columnNamesValidated = false;\n private columnConfigs: {[key: string]: ColumnConfig} = null;\n private configuredColumnsOnly = false;\n private delimiter = ',';\n private delimWhitespace = false;\n\n /**\n * Returns column names of the csv dataset. If `configuredColumnsOnly` is\n * true, return column names in `columnConfigs`. If `configuredColumnsOnly` is\n * false and `columnNames` is provided, `columnNames`. If\n * `configuredColumnsOnly` is false and `columnNames` is not provided, return\n * all column names parsed from the csv file. For example usage please go to\n * `tf.data.csv`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async columnNames() {\n if (!this.columnNamesValidated) {\n await this.setColumnNames();\n }\n return this.configuredColumnsOnly ? Object.keys(this.columnConfigs) :\n this.fullColumnNames;\n }\n\n /* 1) If `columnNames` is provided as string[], use this string[] as output\n * keys in corresponding order. The length must match the number of inferred\n * columns if `hasHeader` is true .\n * 2) If `columnNames` is not provided, parse header line as `columnNames` if\n * hasHeader is true. If `hasHeader` is false, throw an error.\n * 3) If `columnConfigs` is provided, all the keys in `columnConfigs` must\n * exist in parsed `columnNames`.\n */\n private async setColumnNames() {\n const columnNamesFromFile = await this.maybeReadHeaderLine();\n if (!this.fullColumnNames && !columnNamesFromFile) {\n // Throw an error if columnNames is not provided and no header line.\n throw new Error(\n 'Column names must be provided if there is no header line.');\n } else if (this.fullColumnNames && columnNamesFromFile) {\n // Check provided columnNames match header line.\n util.assert(\n columnNamesFromFile.length === this.fullColumnNames.length,\n () => 'The length of provided columnNames (' +\n this.fullColumnNames.length.toString() +\n ') does not match the length of the header line read from ' +\n 'file (' + columnNamesFromFile.length.toString() + ').');\n }\n if (!this.fullColumnNames) {\n this.fullColumnNames = columnNamesFromFile;\n }\n // Check if there are duplicate column names.\n const counts: {[key: string]: number} = this.fullColumnNames.reduce(\n (countAcc: {[key: string]: number}, name) => {\n countAcc[name] = (countAcc[name] + 1) || 1;\n return countAcc;\n },\n {});\n const duplicateNames =\n Object.keys(counts).filter((name) => (counts[name] > 1));\n util.assert(\n duplicateNames.length === 0,\n () => 'Duplicate column names found: ' + duplicateNames.toString());\n // Check if keys in columnConfigs match columnNames.\n if (this.columnConfigs) {\n for (const key of Object.keys(this.columnConfigs)) {\n const index = this.fullColumnNames.indexOf(key);\n if (index === -1) {\n throw new Error(\n 'The key \"' + key +\n '\" provided in columnConfigs does not match any of the column ' +\n 'names (' + this.fullColumnNames.toString() + ').');\n }\n }\n }\n this.columnNamesValidated = true;\n }\n\n private async maybeReadHeaderLine() {\n if (this.hasHeader) {\n const iter = await this.base.iterator();\n const firstElement = await iter.next();\n if (firstElement.done) {\n throw new Error('No data was found for CSV parsing.');\n }\n const firstLine: string = firstElement.value;\n const headers = this.parseRow(firstLine, false);\n return headers;\n } else {\n return null;\n }\n }\n\n /**\n * Create a `CSVDataset`.\n *\n * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream.\n * @param csvConfig (Optional) A CSVConfig object that contains configurations\n * of reading and decoding from CSV file(s).\n *\n * hasHeader: (Optional) A boolean value that indicates whether the first\n * row of provided CSV file is a header line with column names, and should\n * not be included in the data. Defaults to `true`.\n *\n * columnNames: (Optional) A list of strings that corresponds to\n * the CSV column names, in order. If provided, it ignores the column\n * names inferred from the header row. If not provided, infers the column\n * names from the first row of the records. If hasHeader is false and\n * columnNames is not provided, this method throws an error.\n *\n * columnConfigs: (Optional) A dictionary whose key is column names, value\n * is an object stating if this column is required, column's data type,\n * default value, and if this column is label. If provided, keys must\n * correspond to names provided in columnNames or inferred from the file\n * header lines. If isLabel is true any column, returns an array of two\n * items: the first item is a dict of features key/value pairs, the second\n * item is a dict of labels key/value pairs. If no feature is marked as\n * label, returns a dict of features only.\n *\n * configuredColumnsOnly (Optional) If true, only columns provided in\n * columnConfigs will be parsed and provided during iteration.\n *\n * delimiter (Optional) The string used to parse each line of the input\n * file. Defaults to `,`.\n */\n constructor(protected readonly input: DataSource, csvConfig?: CSVConfig) {\n super();\n this.base = new TextLineDataset(input);\n if (!csvConfig) {\n csvConfig = {};\n }\n this.hasHeader = csvConfig.hasHeader === false ? false : true;\n this.fullColumnNames = csvConfig.columnNames;\n this.columnConfigs = csvConfig.columnConfigs;\n this.configuredColumnsOnly = csvConfig.configuredColumnsOnly;\n if (csvConfig.delimWhitespace) {\n util.assert(\n csvConfig.delimiter == null,\n () =>\n 'Delimiter should not be provided when delimWhitespace is true.');\n this.delimWhitespace = true;\n this.delimiter = ' ';\n } else {\n this.delimiter = csvConfig.delimiter ? csvConfig.delimiter : ',';\n }\n }\n\n async iterator(): Promise> {\n if (!this.columnNamesValidated) {\n await this.setColumnNames();\n }\n let lines = await this.base.iterator();\n if (this.hasHeader) {\n // We previously read the first line to get the columnNames.\n // Now that we're providing data, skip it.\n lines = lines.skip(1);\n }\n return lines.map(x => this.makeDataElement(x));\n }\n\n makeDataElement(line: string): TensorContainer {\n const values = this.parseRow(line);\n const features: {[key: string]: TensorContainer} = {};\n const labels: {[key: string]: TensorContainer} = {};\n\n for (let i = 0; i < this.fullColumnNames.length; i++) {\n const key = this.fullColumnNames[i];\n const config = this.columnConfigs ? this.columnConfigs[key] : null;\n if (this.configuredColumnsOnly && !config) {\n // This column is not selected.\n continue;\n } else {\n const value = values[i];\n let parsedValue = null;\n if (value === '') {\n // If default value is provided, use it. If default value is not\n // provided, set as undefined.\n if (config && config.default !== undefined) {\n parsedValue = config.default;\n } else if (config && (config.required || config.isLabel)) {\n throw new Error(\n `Required column ${key} is empty in this line: ${line}`);\n } else {\n parsedValue = undefined;\n }\n } else {\n // A value is present, so parse it based on type\n const valueAsNum = Number(value);\n if (isNaN(valueAsNum)) {\n // The value is a string and this column is declared as boolean\n // in config, parse it as boolean.\n if (config && config.dtype === 'bool') {\n parsedValue = this.getBoolean(value);\n } else {\n // Set value as string\n parsedValue = value;\n }\n } else if (!config || !config.dtype) {\n // If this value is a number and no type config is provided, return\n // it as number.\n parsedValue = valueAsNum;\n } else {\n // If this value is a number and data type is provided, parse it\n // according to provided data type.\n switch (config.dtype) {\n case 'float32':\n parsedValue = valueAsNum;\n break;\n case 'int32':\n parsedValue = Math.floor(valueAsNum);\n break;\n case 'bool':\n parsedValue = this.getBoolean(value);\n break;\n default:\n parsedValue = valueAsNum;\n }\n }\n }\n // Check if this column is label.\n (config && config.isLabel) ? labels[key] = parsedValue :\n features[key] = parsedValue;\n }\n }\n // If label exists, return an object of features and labels as {xs:features,\n // ys:labels}, otherwise return features only.\n if (Object.keys(labels).length === 0) {\n return features;\n\n } else {\n return {xs: features, ys: labels};\n }\n }\n\n private getBoolean(value: string): number {\n if (value === '1' || value.toLowerCase() === 'true') {\n return 1;\n } else {\n return 0;\n }\n }\n\n // adapted from https://beta.observablehq.com/@mbostock/streaming-csv\n private parseRow(line: string, validateElementCount = true): string[] {\n const result: string[] = [];\n let readOffset = 0;\n const readLength = line.length;\n let currentState = STATE_OUT;\n // Goes through the line to parse quote.\n for (let i = 0; i < readLength; i++) {\n switch (currentState) {\n // Before enter a new field\n case STATE_OUT:\n switch (line.charAt(i)) {\n // Enter a quoted field\n case CODE_QUOTE:\n readOffset = i + 1;\n currentState = STATE_QUOTE;\n break;\n // Read an empty field\n case this.delimiter:\n readOffset = i + 1;\n // If delimiter is white space and configured to collapse\n // multiple white spaces, ignore this white space.\n if (this.delimiter === ' ' && this.delimWhitespace) {\n break;\n }\n result.push('');\n currentState = STATE_OUT;\n break;\n // Enter an unquoted field\n default:\n currentState = STATE_FIELD;\n readOffset = i;\n break;\n }\n break;\n // In an unquoted field\n case STATE_FIELD:\n switch (line.charAt(i)) {\n // Exit an unquoted field, add it to result\n case this.delimiter:\n result.push(line.substring(readOffset, i));\n currentState = STATE_OUT;\n readOffset = i + 1;\n break;\n default:\n }\n break;\n // In a quoted field\n case STATE_QUOTE:\n switch (line.charAt(i)) {\n // Read a quote after a quote\n case CODE_QUOTE:\n currentState = STATE_QUOTE_AFTER_QUOTE;\n break;\n default:\n }\n break;\n // This state means it's right after a second quote in a field\n case STATE_QUOTE_AFTER_QUOTE:\n switch (line.charAt(i)) {\n // Finished a quoted field\n case this.delimiter:\n result.push(line.substring(readOffset, i - 1));\n currentState = STATE_OUT;\n readOffset = i + 1;\n break;\n // Finished a quoted part in a quoted field\n case CODE_QUOTE:\n currentState = STATE_QUOTE;\n break;\n // In a quoted part in a quoted field\n default:\n currentState = STATE_WITHIN_QUOTE_IN_QUOTE;\n break;\n }\n break;\n case STATE_WITHIN_QUOTE_IN_QUOTE:\n switch (line.charAt(i)) {\n // Exit a quoted part in a quoted field\n case CODE_QUOTE:\n currentState = STATE_QUOTE;\n break;\n default:\n }\n break;\n default:\n }\n }\n // Adds last item based on if it is quoted.\n if (currentState === STATE_QUOTE_AFTER_QUOTE) {\n result.push(line.substring(readOffset, readLength - 1));\n } else {\n result.push(line.substring(readOffset));\n }\n // Check if each row has the same number of elements as column names.\n if (validateElementCount && result.length !== this.fullColumnNames.length) {\n throw new Error(`Invalid row in csv file. Should have ${\n this.fullColumnNames.length} elements in a row, but got ${result}`);\n }\n return result;\n }\n}\n\n// TODO(soergel): add more basic datasets for parity with tf.data\n// tf.data.FixedLengthRecordDataset()\n// tf.data.TFRecordDataset()\n","/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {env, Tensor, tensor, Tensor2D, Tensor3D, TensorContainer, util} from '@tensorflow/tfjs-core';\nimport {MicrophoneConfig} from '../types';\nimport {LazyIterator} from './lazy_iterator';\n\n/**\n * Provide a stream of tensors from microphone audio stream. The tensors are\n * representing audio data as frequency-domain spectrogram generated with\n * browser's native FFT. Tensors representing time-domain waveform is available\n * based on configuration. Only works in browser environment.\n */\nexport class MicrophoneIterator extends LazyIterator {\n private isClosed = false;\n private stream: MediaStream;\n private readonly fftSize: number;\n private readonly columnTruncateLength: number;\n private freqData: Float32Array;\n private timeData: Float32Array;\n private readonly numFrames: number;\n private analyser: AnalyserNode;\n private audioContext: AudioContext;\n private sampleRateHz: number;\n private readonly audioTrackConstraints: MediaTrackConstraints;\n private readonly smoothingTimeConstant: number;\n private readonly includeSpectrogram: boolean;\n private readonly includeWaveform: boolean;\n\n private constructor(protected readonly microphoneConfig: MicrophoneConfig) {\n super();\n this.fftSize = microphoneConfig.fftSize || 1024;\n const fftSizeLog2 = Math.log2(this.fftSize);\n if (this.fftSize < 0 || fftSizeLog2 < 4 || fftSizeLog2 > 14 ||\n !Number.isInteger(fftSizeLog2)) {\n throw new Error(\n `Invalid fftSize: it must be a power of 2 between ` +\n `2 to 4 and 2 to 14, but got ${this.fftSize}`);\n }\n\n this.numFrames = microphoneConfig.numFramesPerSpectrogram || 43;\n this.sampleRateHz = microphoneConfig.sampleRateHz;\n this.columnTruncateLength =\n microphoneConfig.columnTruncateLength || this.fftSize;\n this.audioTrackConstraints = microphoneConfig.audioTrackConstraints;\n this.smoothingTimeConstant = microphoneConfig.smoothingTimeConstant || 0;\n\n this.includeSpectrogram =\n microphoneConfig.includeSpectrogram === false ? false : true;\n this.includeWaveform =\n microphoneConfig.includeWaveform === true ? true : false;\n if (!this.includeSpectrogram && !this.includeWaveform) {\n throw new Error(\n 'Both includeSpectrogram and includeWaveform are false. ' +\n 'At least one type of data should be returned.');\n }\n }\n\n summary() {\n return `microphone`;\n }\n\n // Construct a MicrophoneIterator and start the audio stream.\n static async create(microphoneConfig: MicrophoneConfig = {}) {\n if (env().get('IS_NODE')) {\n throw new Error(\n 'microphone API is only supported in browser environment.');\n }\n\n const microphoneIterator = new MicrophoneIterator(microphoneConfig);\n\n // Call async function start() to initialize the audio stream.\n await microphoneIterator.start();\n\n return microphoneIterator;\n }\n\n // Start the audio stream and FFT.\n async start(): Promise {\n try {\n this.stream = await navigator.mediaDevices.getUserMedia({\n audio: this.audioTrackConstraints == null ? true :\n this.audioTrackConstraints,\n video: false\n });\n } catch (e) {\n throw new Error(\n `Error thrown while initializing video stream: ${e.message}`);\n }\n\n if (!this.stream) {\n throw new Error('Could not obtain audio from microphone.');\n }\n\n const ctxConstructor =\n // tslint:disable-next-line:no-any\n (window as any).AudioContext || (window as any).webkitAudioContext;\n this.audioContext = new ctxConstructor();\n\n if (!this.sampleRateHz) {\n // If sample rate is not provided, use the available sample rate on\n // device.\n this.sampleRateHz = this.audioContext.sampleRate;\n } else if (this.audioContext.sampleRate !== this.sampleRateHz) {\n throw new Error(\n `Mismatch in sampling rate: ` +\n `Expected: ${this.sampleRateHz}; ` +\n `Actual: ${this.audioContext.sampleRate}`);\n }\n\n const streamSource = this.audioContext.createMediaStreamSource(this.stream);\n this.analyser = this.audioContext.createAnalyser();\n this.analyser.fftSize = this.fftSize * 2;\n this.analyser.smoothingTimeConstant = this.smoothingTimeConstant;\n streamSource.connect(this.analyser);\n this.freqData = new Float32Array(this.fftSize);\n this.timeData = new Float32Array(this.fftSize);\n return;\n }\n\n async next(): Promise> {\n if (this.isClosed) {\n return {value: null, done: true};\n }\n\n let spectrogramTensor: Tensor;\n let waveformTensor: Tensor;\n\n const audioDataQueue = await this.getAudioData();\n if (this.includeSpectrogram) {\n const freqData = this.flattenQueue(audioDataQueue.freqDataQueue);\n spectrogramTensor = this.getTensorFromAudioDataArray(\n freqData, [this.numFrames, this.columnTruncateLength, 1]);\n }\n if (this.includeWaveform) {\n const timeData = this.flattenQueue(audioDataQueue.timeDataQueue);\n waveformTensor = this.getTensorFromAudioDataArray(\n timeData, [this.numFrames * this.fftSize, 1]);\n }\n\n return {\n value: {'spectrogram': spectrogramTensor, 'waveform': waveformTensor},\n done: false\n };\n }\n\n // Capture one result from the audio stream, and extract the value from\n // iterator.next() result.\n async capture(): Promise<{spectrogram: Tensor3D, waveform: Tensor2D}> {\n return (await this.next()).value as\n {spectrogram: Tensor3D, waveform: Tensor2D};\n }\n\n private async getAudioData():\n Promise<{freqDataQueue: Float32Array[], timeDataQueue: Float32Array[]}> {\n const freqDataQueue: Float32Array[] = [];\n const timeDataQueue: Float32Array[] = [];\n let currentFrames = 0;\n return new Promise(resolve => {\n const intervalID = setInterval(() => {\n if (this.includeSpectrogram) {\n this.analyser.getFloatFrequencyData(this.freqData);\n // If the audio stream is initializing, return empty queue.\n if (this.freqData[0] === -Infinity) {\n resolve({freqDataQueue, timeDataQueue});\n }\n freqDataQueue.push(this.freqData.slice(0, this.columnTruncateLength));\n }\n if (this.includeWaveform) {\n this.analyser.getFloatTimeDomainData(this.timeData);\n timeDataQueue.push(this.timeData.slice());\n }\n\n // Clean interval and return when all frames have been collected\n if (++currentFrames === this.numFrames) {\n clearInterval(intervalID);\n resolve({freqDataQueue, timeDataQueue});\n }\n }, this.fftSize / this.sampleRateHz * 1e3);\n });\n }\n\n // Stop the audio stream and pause the iterator.\n stop(): void {\n if (!this.isClosed) {\n this.isClosed = true;\n this.analyser.disconnect();\n this.audioContext.close();\n if (this.stream != null && this.stream.getTracks().length > 0) {\n this.stream.getTracks()[0].stop();\n }\n }\n }\n\n // Override toArray() function to prevent collecting.\n toArray(): Promise {\n throw new Error('Can not convert infinite audio stream to array.');\n }\n\n // Return audio sampling rate in Hz\n getSampleRate(): number {\n return this.sampleRateHz;\n }\n\n private flattenQueue(queue: Float32Array[]): Float32Array {\n const frameSize = queue[0].length;\n const freqData = new Float32Array(queue.length * frameSize);\n queue.forEach((data, i) => freqData.set(data, i * frameSize));\n return freqData;\n }\n\n private getTensorFromAudioDataArray(freqData: Float32Array, shape: number[]):\n Tensor {\n const vals = new Float32Array(util.sizeFromShape(shape));\n // If the data is less than the output shape, the rest is padded with zeros.\n vals.set(freqData, vals.length - freqData.length);\n return tensor(vals, shape);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {browser, cast, env, expandDims, image, reshape, tensor1d, Tensor1D, tensor2d, Tensor2D, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs-core';\nimport {WebcamConfig} from '../types';\nimport {LazyIterator} from './lazy_iterator';\n\n/**\n * Provide a stream of image tensors from webcam video stream. Only works in\n * browser environment.\n */\nexport class WebcamIterator extends LazyIterator {\n private isClosed = true;\n private stream: MediaStream;\n private resize = false;\n private cropSize: [number, number];\n private cropBox: Tensor2D;\n private cropBoxInd: Tensor1D;\n\n private constructor(\n protected readonly webcamVideoElement: HTMLVideoElement,\n protected readonly webcamConfig: WebcamConfig) {\n super();\n if (this.needToResize()) {\n this.resize = true;\n this.cropSize =\n [this.webcamConfig.resizeHeight, this.webcamConfig.resizeWidth];\n this.cropBoxInd = tensor1d([0], 'int32');\n if (this.webcamConfig.centerCrop) {\n // Calculate the box based on resizing shape.\n const widthCroppingRatio =\n this.webcamConfig.resizeWidth * 1.0 / this.webcamVideoElement.width;\n const heightCroppingRatio = this.webcamConfig.resizeHeight * 1.0 /\n this.webcamVideoElement.height;\n const widthCropStart = (1 - widthCroppingRatio) / 2;\n const heightCropStart = (1 - heightCroppingRatio) / 2;\n const widthCropEnd = widthCropStart + widthCroppingRatio;\n const heightCropEnd = heightCroppingRatio + heightCropStart;\n this.cropBox = tensor2d(\n [heightCropStart, widthCropStart, heightCropEnd, widthCropEnd],\n [1, 4]);\n } else {\n this.cropBox = tensor2d([0, 0, 1, 1], [1, 4]);\n }\n }\n }\n\n summary() {\n return `webcam`;\n }\n\n // Construct a WebcamIterator and start it's video stream.\n static async create(\n webcamVideoElement?: HTMLVideoElement, webcamConfig: WebcamConfig = {}) {\n if (env().get('IS_NODE')) {\n throw new Error(\n 'tf.data.webcam is only supported in browser environment.');\n }\n\n if (!webcamVideoElement) {\n // If webcam video element is not provided, create a hidden video element\n // with provided width and height.\n webcamVideoElement = document.createElement('video');\n if (!webcamConfig.resizeWidth || !webcamConfig.resizeHeight) {\n throw new Error(\n 'Please provide webcam video element, or resizeWidth and ' +\n 'resizeHeight to create a hidden video element.');\n }\n webcamVideoElement.width = webcamConfig.resizeWidth;\n webcamVideoElement.height = webcamConfig.resizeHeight;\n }\n const webcamIterator = new WebcamIterator(webcamVideoElement, webcamConfig);\n\n // Call async function to initialize the video stream.\n await webcamIterator.start();\n\n return webcamIterator;\n }\n\n // Async function to start video stream.\n async start(): Promise {\n if (this.webcamConfig.facingMode) {\n util.assert(\n (this.webcamConfig.facingMode === 'user') ||\n (this.webcamConfig.facingMode === 'environment'),\n () =>\n `Invalid webcam facing mode: ${this.webcamConfig.facingMode}. ` +\n `Please provide 'user' or 'environment'`);\n }\n\n try {\n this.stream = await navigator.mediaDevices.getUserMedia({\n video: {\n deviceId: this.webcamConfig.deviceId,\n facingMode: this.webcamConfig.facingMode ?\n this.webcamConfig.facingMode :\n 'user',\n width: this.webcamVideoElement.width,\n height: this.webcamVideoElement.height\n }\n });\n } catch (e) {\n // Modify the error message but leave the stack trace intact\n e.message = `Error thrown while initializing video stream: ${e.message}`;\n throw e;\n }\n\n if (!this.stream) {\n throw new Error('Could not obtain video from webcam.');\n }\n\n // Older browsers may not have srcObject\n try {\n this.webcamVideoElement.srcObject = this.stream;\n } catch (error) {\n console.log(error);\n this.webcamVideoElement.src = window.URL.createObjectURL(this.stream);\n }\n // Start the webcam video stream\n this.webcamVideoElement.play();\n\n this.isClosed = false;\n\n return new Promise(resolve => {\n // Add event listener to make sure the webcam has been fully initialized.\n this.webcamVideoElement.onloadedmetadata = () => {\n resolve();\n };\n });\n }\n\n async next(): Promise> {\n if (this.isClosed) {\n return {value: null, done: true};\n }\n\n let img;\n try {\n img = browser.fromPixels(this.webcamVideoElement);\n } catch (e) {\n throw new Error(\n `Error thrown converting video to pixels: ${JSON.stringify(e)}`);\n }\n if (this.resize) {\n try {\n return {value: this.cropAndResizeFrame(img), done: false};\n } catch (e) {\n throw new Error(`Error thrown cropping the video: ${e.message}`);\n } finally {\n img.dispose();\n }\n } else {\n return {value: img, done: false};\n }\n }\n\n private needToResize() {\n // If resizeWidth and resizeHeight are provided, and different from the\n // width and height of original HTMLVideoElement, then resizing and cropping\n // is required.\n if (this.webcamConfig.resizeWidth && this.webcamConfig.resizeHeight &&\n (this.webcamVideoElement.width !== this.webcamConfig.resizeWidth ||\n this.webcamVideoElement.height !== this.webcamConfig.resizeHeight)) {\n return true;\n }\n return false;\n }\n\n // Cropping and resizing each frame based on config\n cropAndResizeFrame(img: Tensor3D): Tensor3D {\n return tidy(() => {\n const expandedImage: Tensor4D = expandDims(cast(img, 'float32'), (0));\n let resizedImage;\n resizedImage = image.cropAndResize(\n expandedImage, this.cropBox, this.cropBoxInd, this.cropSize,\n 'bilinear');\n // Extract image from batch cropping.\n const shape = resizedImage.shape;\n return reshape(resizedImage, shape.slice(1) as [number, number, number]);\n });\n }\n\n // Capture one frame from the video stream, and extract the value from\n // iterator.next() result.\n async capture(): Promise {\n return (await this.next()).value;\n }\n\n // Stop the video stream and pause webcam iterator.\n stop(): void {\n const tracks = this.stream.getTracks();\n\n tracks.forEach(track => track.stop());\n\n try {\n this.webcamVideoElement.srcObject = null;\n } catch (error) {\n console.log(error);\n this.webcamVideoElement.src = null;\n }\n this.isClosed = true;\n }\n\n // Override toArray() function to prevent collecting.\n toArray(): Promise {\n throw new Error('Can not convert infinite video stream to array.');\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {ByteChunkIterator} from './iterators/byte_chunk_iterator';\n\n/**\n * Represents a data source readable as a stream of binary data chunks.\n *\n * Because `Dataset`s can be read repeatedly (via `Dataset.iterator()`), this\n * provides a means to repeatedly create streams from the underlying data\n * sources.\n */\nexport abstract class DataSource {\n /**\n * Obtain a new stream of binary data chunks.\n *\n * Starts the new stream from the beginning of the data source, even if other\n * streams have been obtained previously.\n */\n abstract async iterator(): Promise;\n\n // TODO(soergel): consider chainable Dataset construction here\n}\n\n// TODO(soergel): consider convenience factory functions here\n// in combination with chainable source->dataset above, e.g.:\n// tf.data.url(...).asCsvDataset().shuffle().batch()\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {LazyIterator, OneToManyIterator} from './lazy_iterator';\n\nexport abstract class StringIterator extends LazyIterator {\n /**\n * Splits a string stream on a given separator.\n *\n * It is assumed that the incoming chunk boundaries have no semantic meaning,\n * so conceptually the incoming stream is treated simply as the concatenation\n * of its elements.\n *\n * The outgoing stream provides chunks corresponding to the results of the\n * standard string split() operation (even if such a chunk spanned incoming\n * chunks). The separators are not included.\n *\n * A typical usage is to split a text file (represented as a stream with\n * arbitrary chunk boundaries) into lines.\n *\n * @param upstream A readable stream of strings that can be treated as\n * concatenated.\n * @param separator A character to split on.\n */\n split(separator: string): StringIterator {\n return new SplitIterator(this, separator);\n }\n}\n\n// ============================================================================\n// The following private classes serve to implement the chainable methods\n// on StringIterator. Unfortunately they can't be placed in separate files, due\n// to resulting trouble with circular imports.\n// ============================================================================\n\n// We wanted multiple inheritance, e.g.\n// class SplitIterator extends QueueIterator, StringIterator\n// but the TypeScript mixin approach is a bit hacky, so we take this adapter\n// approach instead.\n\nclass SplitIterator extends StringIterator {\n private impl: SplitIteratorImpl;\n\n constructor(protected upstream: LazyIterator, separator: string) {\n super();\n this.impl = new SplitIteratorImpl(upstream, separator);\n }\n\n summary() {\n return this.impl.summary();\n }\n\n async next() {\n return this.impl.next();\n }\n}\n\nclass SplitIteratorImpl extends OneToManyIterator {\n // A partial string at the end of an upstream chunk\n carryover = '';\n\n constructor(\n protected upstream: LazyIterator, protected separator: string) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Split('${this.separator}')`;\n }\n\n async pump(): Promise {\n const chunkResult = await this.upstream.next();\n if (chunkResult.done) {\n if (this.carryover === '') {\n return false;\n }\n\n // Pretend that the pump succeeded in order to emit the small last batch.\n // The next pump() call will actually fail.\n this.outputQueue.push(this.carryover);\n this.carryover = '';\n return true;\n }\n const lines = chunkResult.value.split(this.separator);\n // Note the behavior: \" ab \".split(' ') === ['', 'ab', '']\n // Thus the carryover may be '' if the separator falls on a chunk\n // boundary; this produces the correct result.\n\n lines[0] = this.carryover + lines[0];\n for (const line of lines.slice(0, -1)) {\n this.outputQueue.push(line);\n }\n this.carryover = lines[lines.length - 1];\n\n return true;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {env} from '@tensorflow/tfjs-core';\nimport {LazyIterator, OneToManyIterator} from './lazy_iterator';\nimport {StringIterator} from './string_iterator';\n\nexport abstract class ByteChunkIterator extends LazyIterator {\n /**\n * Decode a stream of UTF8-encoded byte arrays to a stream of strings.\n *\n * The byte arrays producetd from the ByteChunkIterator on which this is\n * called will be interpreted as concatenated. No assumptions are made about\n * the boundaries of the incoming chunks, so a multi-byte UTF8 encoding of a\n * character may span the boundary between chunks. This naturally happens,\n * for instance, when reading fixed-size byte arrays from a file.\n */\n decodeUTF8(): StringIterator {\n return new Utf8Iterator(this);\n }\n}\n\n// ============================================================================\n// The following private classes serve to implement the chainable methods\n// on ByteChunkIterator. Unfortunately they can't be placed in separate files,\n// due to resulting trouble with circular imports.\n// ============================================================================\n\n// We wanted multiple inheritance, e.g.\n// class Utf8Iterator extends QueueIterator, StringIterator\n// but the TypeScript mixin approach is a bit hacky, so we take this adapter\n// approach instead.\n\nclass Utf8Iterator extends StringIterator {\n private impl: Utf8IteratorImpl;\n\n constructor(protected upstream: LazyIterator) {\n super();\n this.impl = new Utf8IteratorImpl(upstream);\n }\n\n summary() {\n return this.impl.summary();\n }\n\n async next() {\n return this.impl.next();\n }\n}\n\n/**\n * Decode a stream of UTF8-encoded byte arrays to a stream of strings.\n *\n * This is tricky because the incoming byte array boundaries may disrupt a\n * multi-byte UTF8 character. Thus any incomplete character data at the end of\n * a chunk must be carried over and prepended to the next chunk before\n * decoding. Luckily with native decoder, TextDecoder in browser and\n * string_decoder in node, byte array boundaries are handled automatically.\n *\n * In the context of an input pipeline for machine learning, UTF8 decoding is\n * needed to parse text files containing training examples or prediction\n * requests (e.g., formatted as CSV or JSON). We cannot use the built-in\n * decoding provided by FileReader.readAsText() because here we are in a\n * streaming context, which FileReader does not support.\n *\n * @param upstream A `LazyIterator` of `Uint8Arrays` containing UTF8-encoded\n * text, which should be interpreted as concatenated. No assumptions are\n * made about the boundaries of the incoming chunks, so a multi-byte UTF8\n * encoding of a character may span the boundary between chunks. This\n * naturally happens, for instance, when reading fixed-size byte arrays from a\n * file.\n */\nclass Utf8IteratorImpl extends OneToManyIterator {\n // `decoder` as `any` here to dynamically assign value based on the\n // environment.\n // tslint:disable-next-line:no-any\n decoder: any;\n\n constructor(protected readonly upstream: LazyIterator) {\n super();\n if (env().get('IS_BROWSER')) {\n this.decoder = new TextDecoder('utf-8');\n } else {\n // tslint:disable-next-line:no-require-imports\n const {StringDecoder} = require('string_decoder');\n this.decoder = new StringDecoder('utf8');\n }\n }\n summary() {\n return `${this.upstream.summary()} -> Utf8`;\n }\n\n async pump(): Promise {\n const chunkResult = await this.upstream.next();\n let chunk;\n if (chunkResult.done) {\n return false;\n } else {\n chunk = chunkResult.value;\n }\n\n let text: string;\n if (env().get('IS_BROWSER')) {\n text = this.decoder.decode(chunk, {stream: true});\n } else {\n text = this.decoder.write(Buffer.from(chunk.buffer));\n }\n this.outputQueue.push(text);\n return true;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\n// inspired by https://github.com/maxogden/filereader-stream\nimport {env, util} from '@tensorflow/tfjs-core';\nimport {FileElement} from '../types';\nimport {ByteChunkIterator} from './byte_chunk_iterator';\n\nexport interface FileChunkIteratorOptions {\n /** The byte offset at which to begin reading the File or Blob. Default 0. */\n offset?: number;\n /** The number of bytes to read at a time. Default 1MB. */\n chunkSize?: number;\n}\n\n/**\n * Provide a stream of chunks from a File, Blob, or Uint8Array.\n * @param file The source File, Blob or Uint8Array.\n * @param options Optional settings controlling file reading.\n * @returns a lazy Iterator of Uint8Arrays containing sequential chunks of the\n * input File, Blob or Uint8Array.\n */\nexport class FileChunkIterator extends ByteChunkIterator {\n offset: number;\n chunkSize: number;\n\n constructor(\n protected file: FileElement,\n protected options: FileChunkIteratorOptions = {}) {\n super();\n util.assert(\n (file instanceof Uint8Array) ||\n (env().get('IS_BROWSER') ?\n (file instanceof File || file instanceof Blob) :\n false),\n () => 'FileChunkIterator only supports File, Blob and Uint8Array ' +\n 'right now.');\n this.offset = options.offset || 0;\n // default 1MB chunk has tolerable perf on large files\n this.chunkSize = options.chunkSize || 1024 * 1024;\n }\n\n summary() {\n return `FileChunks ${this.file}`;\n }\n\n async next(): Promise> {\n if (this.offset >= ((this.file instanceof Uint8Array) ?\n this.file.byteLength :\n this.file.size)) {\n return {value: null, done: true};\n }\n const chunk = new Promise((resolve, reject) => {\n const end = this.offset + this.chunkSize;\n if (this.file instanceof Uint8Array) {\n // Note if end > this.uint8Array.byteLength, we just get a small last\n // chunk.\n resolve(new Uint8Array(this.file.slice(this.offset, end)));\n } else {\n // This branch assumes that this.file type is File or Blob, which\n // means it is in the browser environment.\n\n // TODO(soergel): is this a performance issue?\n const fileReader = new FileReader();\n fileReader.onload = (event) => {\n let data: string|ArrayBuffer|Uint8Array = fileReader.result;\n // Not sure we can trust the return type of\n // FileReader.readAsArrayBuffer See e.g.\n // https://github.com/node-file-api/FileReader/issues/2\n if (data instanceof ArrayBuffer) {\n data = new Uint8Array(data);\n }\n if (!(data instanceof Uint8Array)) {\n return reject(new TypeError('FileReader returned unknown type.'));\n }\n resolve(data);\n };\n fileReader.onabort = (event) => {\n return reject(new Error('Aborted'));\n };\n fileReader.onerror = (event) => {\n return reject(new Error(event.type));\n };\n // TODO(soergel): better handle onabort, onerror\n // Note if end > this.file.size, we just get a small last chunk.\n const slice = this.file.slice(this.offset, end);\n // We can't use readAsText here (even if we know the file is text)\n // because the slice boundary may fall within a multi-byte character.\n fileReader.readAsArrayBuffer(slice);\n }\n this.offset = end;\n });\n return {value: (await chunk), done: false};\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {util} from '@tensorflow/tfjs-core';\nimport {FileChunkIterator, FileChunkIteratorOptions} from './file_chunk_iterator';\n\n/**\n * Provide a stream of chunks from a URL.\n *\n * Note this class first downloads the entire file into memory before providing\n * the first element from the stream. This is because the Fetch API does not\n * yet reliably provide a reader stream for the response body.\n */\nexport async function urlChunkIterator(\n url: RequestInfo, options: FileChunkIteratorOptions = {}) {\n let urlString;\n let requestInit;\n if ((typeof url) === 'string') {\n urlString = url as string;\n } else {\n urlString = (url as Request).url;\n requestInit = getRequestInitFromRequest(url as Request);\n }\n const response = await util.fetch(urlString, requestInit);\n if (response.ok) {\n const uint8Array = new Uint8Array(await response.arrayBuffer());\n return new FileChunkIterator(uint8Array, options);\n } else {\n throw new Error(response.statusText);\n }\n}\n\n// Generate RequestInit from Request to match tf.util.fetch signature.\nconst getRequestInitFromRequest = (request: Request) => {\n const init = {\n method: request.method,\n headers: request.headers,\n body: request.body,\n mode: request.mode,\n credentials: request.credentials,\n cache: request.cache,\n redirect: request.redirect,\n referrer: request.referrer,\n integrity: request.integrity,\n };\n return init;\n};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\n// Skip tslint any type check cause this method is aiming to check type of\n// input.\n// tslint:disable-next-line:no-any\nexport function isLocalPath(source: any): boolean {\n return (typeof source === 'string') && source.substr(0, 7) === 'file://';\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {env} from '@tensorflow/tfjs-core';\nimport {DataSource} from '../datasource';\nimport {ByteChunkIterator} from '../iterators/byte_chunk_iterator';\nimport {FileChunkIterator, FileChunkIteratorOptions} from '../iterators/file_chunk_iterator';\nimport {FileElement} from '../types';\nimport {isLocalPath} from '../util/source_util';\n\n/**\n * Represents a file, blob, or Uint8Array readable as a stream of binary data\n * chunks.\n */\nexport class FileDataSource extends DataSource {\n /**\n * Create a `FileDataSource`.\n *\n * @param input Local file path, or `File`/`Blob`/`Uint8Array` object to\n * read. Local file only works in node environment.\n * @param options Options passed to the underlying `FileChunkIterator`s,\n * such as {chunksize: 1024}.\n */\n constructor(\n protected input: FileElement|string,\n protected readonly options: FileChunkIteratorOptions = {}) {\n super();\n }\n\n async iterator(): Promise {\n if (isLocalPath(this.input) && env().get('IS_NODE')) {\n // tslint:disable-next-line:no-require-imports\n const fs = require('fs');\n this.input = fs.readFileSync((this.input as string).substr(7));\n }\n // TODO(kangyizhang): Add LocalFileChunkIterator to split local streaming\n // with file in browser.\n return new FileChunkIterator(this.input as FileElement, this.options);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {DataSource} from '../datasource';\nimport {ByteChunkIterator} from '../iterators/byte_chunk_iterator';\nimport {FileChunkIteratorOptions} from '../iterators/file_chunk_iterator';\nimport {urlChunkIterator} from '../iterators/url_chunk_iterator';\nimport {isLocalPath} from '../util/source_util';\nimport {FileDataSource} from './file_data_source';\n\n/*\n * Represents a URL readable as a stream of binary data chunks.\n */\nexport class URLDataSource extends DataSource {\n /**\n * Create a `URLDataSource`.\n *\n * @param url A source URL string, or a `Request` object.\n * @param options Options passed to the underlying `FileChunkIterator`s,\n * such as {chunksize: 1024}.\n */\n constructor(\n protected readonly url: RequestInfo,\n protected readonly fileOptions: FileChunkIteratorOptions = {}) {\n super();\n }\n\n // TODO(soergel): provide appropriate caching options. Currently this\n // will download the URL anew for each call to iterator(). Since we have\n // to treat the downloaded file as a blob/buffer anyway, we may as well retain\n // it-- but that raises GC issues. Also we may want a persistent disk cache.\n async iterator(): Promise {\n if (isLocalPath(this.url)) {\n return (new FileDataSource(this.url as string, this.fileOptions))\n .iterator();\n } else {\n return urlChunkIterator(this.url, this.fileOptions);\n }\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {TensorContainer} from '@tensorflow/tfjs-core';\nimport {Dataset, datasetFromIteratorFn} from './dataset';\nimport {CSVDataset} from './datasets/csv_dataset';\nimport {iteratorFromFunction} from './iterators/lazy_iterator';\nimport {MicrophoneIterator} from './iterators/microphone_iterator';\nimport {WebcamIterator} from './iterators/webcam_iterator';\nimport {URLDataSource} from './sources/url_data_source';\nimport {CSVConfig, MicrophoneConfig, WebcamConfig} from './types';\n\n/**\n * Create a `CSVDataset` by reading and decoding CSV file(s) from provided URL\n * or local path if it's in Node environment.\n *\n * Note: If isLabel in columnConfigs is `true` for at least one column, the\n * element in returned `CSVDataset` will be an object of\n * `{xs:features, ys:labels}`: xs is a dict of features key/value pairs, ys\n * is a dict of labels key/value pairs. If no column is marked as label,\n * returns a dict of features only.\n *\n * ```js\n * const csvUrl =\n * 'https://storage.googleapis.com/tfjs-examples/multivariate-linear-regression/data/boston-housing-train.csv';\n *\n * async function run() {\n * // We want to predict the column \"medv\", which represents a median value of\n * // a home (in $1000s), so we mark it as a label.\n * const csvDataset = tf.data.csv(\n * csvUrl, {\n * columnConfigs: {\n * medv: {\n * isLabel: true\n * }\n * }\n * });\n *\n * // Number of features is the number of column names minus one for the label\n * // column.\n * const numOfFeatures = (await csvDataset.columnNames()).length - 1;\n *\n * // Prepare the Dataset for training.\n * const flattenedDataset =\n * csvDataset\n * .map(({xs, ys}) =>\n * {\n * // Convert xs(features) and ys(labels) from object form (keyed by\n * // column name) to array form.\n * return {xs:Object.values(xs), ys:Object.values(ys)};\n * })\n * .batch(10);\n *\n * // Define the model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense({\n * inputShape: [numOfFeatures],\n * units: 1\n * }));\n * model.compile({\n * optimizer: tf.train.sgd(0.000001),\n * loss: 'meanSquaredError'\n * });\n *\n * // Fit the model using the prepared Dataset\n * return model.fitDataset(flattenedDataset, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * console.log(epoch + ':' + logs.loss);\n * }\n * }\n * });\n * }\n *\n * await run();\n * ```\n *\n * @param source URL or local path to get CSV file. If it's a local path, it\n * must have prefix `file://` and it only works in node environment.\n * @param csvConfig (Optional) A CSVConfig object that contains configurations\n * of reading and decoding from CSV file(s).\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * configParamIndices: [1]\n * }\n */\nexport function csv(\n source: RequestInfo, csvConfig: CSVConfig = {}): CSVDataset {\n return new CSVDataset(new URLDataSource(source), csvConfig);\n}\n\n/**\n * Create a `Dataset` that produces each element by calling a provided function.\n *\n * Note that repeated iterations over this `Dataset` may produce different\n * results, because the function will be called anew for each element of each\n * iteration.\n *\n * Also, beware that the sequence of calls to this function may be out of order\n * in time with respect to the logical order of the Dataset. This is due to the\n * asynchronous lazy nature of stream processing, and depends on downstream\n * transformations (e.g. .shuffle()). If the provided function is pure, this is\n * no problem, but if it is a closure over a mutable state (e.g., a traversal\n * pointer), then the order of the produced elements may be scrambled.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const ds = tf.data.func(func);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * @param f A function that produces one data element on each call.\n */\nexport function func(\n f: () => IteratorResult| Promise>): Dataset {\n const iter = iteratorFromFunction(f);\n return datasetFromIteratorFn(async () => iter);\n}\n\n/**\n * Create a `Dataset` that produces each element from provided JavaScript\n * generator, which is a function*\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions),\n * or a function that returns an\n * iterator\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions).\n *\n * The returned iterator should have `.next()` function that returns element in\n * format of `{value: TensorContainer, done:boolean}`.\n *\n * Example of creating a dataset from an iterator factory:\n * ```js\n * function makeIterator() {\n * const numElements = 10;\n * let index = 0;\n *\n * const iterator = {\n * next: () => {\n * let result;\n * if (index < numElements) {\n * result = {value: index, done: false};\n * index++;\n * return result;\n * }\n * return {value: index, done: true};\n * }\n * };\n * return iterator;\n * }\n * const ds = tf.data.generator(makeIterator);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * Example of creating a dataset from a generator:\n * ```js\n * function* dataGenerator() {\n * const numElements = 10;\n * let index = 0;\n * while (index < numElements) {\n * const x = index;\n * index++;\n * yield x;\n * }\n * }\n *\n * const ds = tf.data.generator(dataGenerator);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * @param generator A Javascript generator function that returns a JavaScript\n * iterator.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * configParamIndices: [1]\n * }\n */\nexport function generator(\n generator: () => Iterator| Promise>): Dataset {\n return datasetFromIteratorFn(async () => {\n const gen = await generator();\n return iteratorFromFunction(() => gen.next());\n });\n}\n\n/**\n * Create an iterator that generate `Tensor`s from webcam video stream. This API\n * only works in Browser environment when the device has webcam.\n *\n * Note: this code snippet only works when the device has a webcam. It will\n * request permission to open the webcam when running.\n * ```js\n * const videoElement = document.createElement('video');\n * videoElement.width = 100;\n * videoElement.height = 100;\n * const cam = await tf.data.webcam(videoElement);\n * const img = await cam.capture();\n * img.print();\n * cam.stop();\n * ```\n *\n * @param webcamVideoElement A `HTMLVideoElement` used to play video from\n * webcam. If this element is not provided, a hidden `HTMLVideoElement` will\n * be created. In that case, `resizeWidth` and `resizeHeight` must be\n * provided to set the generated tensor shape.\n * @param webcamConfig A `WebcamConfig` object that contains configurations of\n * reading and manipulating data from webcam video stream.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * ignoreCI: true\n * }\n */\nexport async function webcam(\n webcamVideoElement?: HTMLVideoElement,\n webcamConfig?: WebcamConfig): Promise {\n return WebcamIterator.create(webcamVideoElement, webcamConfig);\n}\n\n/**\n * Create an iterator that generate frequency-domain spectrogram `Tensor`s from\n * microphone audio stream with browser's native FFT. This API only works in\n * browser environment when the device has microphone.\n *\n * Note: this code snippet only works when the device has a microphone. It will\n * request permission to open the microphone when running.\n * ```js\n * const mic = await tf.data.microphone({\n * fftSize: 1024,\n * columnTruncateLength: 232,\n * numFramesPerSpectrogram: 43,\n * sampleRateHz:44100,\n * includeSpectrogram: true,\n * includeWaveform: true\n * });\n * const audioData = await mic.capture();\n * const spectrogramTensor = audioData.spectrogram;\n * spectrogramTensor.print();\n * const waveformTensor = audioData.waveform;\n * waveformTensor.print();\n * mic.stop();\n * ```\n *\n * @param microphoneConfig A `MicrophoneConfig` object that contains\n * configurations of reading audio data from microphone.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * ignoreCI: true\n * }\n */\nexport async function microphone(microphoneConfig?: MicrophoneConfig):\n Promise {\n return MicrophoneIterator.create(microphoneConfig);\n}\n","/** @license See the LICENSE file. */\n\n// This code is auto-generated, do not modify this file!\nconst version = '3.6.0';\nexport {version};\n"],"names":["global","module","define","Alea","seed","n","me","this","mash","data","toString","i","length","h","charCodeAt","next","t","s0","c","s1","s2","copy","f","impl","opts","xg","state","prng","int32","double","quick","exports","amd","alea","XorGen","strseed","x","y","z","w","k","result","xor128","v","d","xorwow","X","j","push","init","slice","Date","xorshift7","limit","Math","max","xor4096","b","a","floor","tychei","pool","math","nodecrypto","width","startdenom","pow","significance","overflow","mask","seedrandom","options","callback","key","shortseed","mixkey","flatten","entropy","tostring","out","randomBytes","Uint8Array","crypto","msCrypto","getRandomValues","e","browser","navigator","plugins","screen","autoseed","arc4","ARC4","g","S","pass","is_math_call","keylen","s","count","r","obj","depth","prop","typ","smear","stringseed","String","fromCharCode","apply","random","require","ex","ZipMismatchMode","sr","deepMapInternal","input","mapFn","seen","Map","containedIn","Set","has","Error","get","recurse","value","isIterable","mappedIterable","Array","isArray","add","childResult","delete","set","deepZip","inputs","zipFn","zipToList","deepZipInternal","map","async","deepMapAndAwaitAll","from","keys","tf.util","isPromise","mappedValue","ArrayBuffer","isView","tf.Tensor","deepClone","container","cloneIfTensor","item","clone","RingBuffer","[object Object]","capacity","RangeError","doubledCapacity","index","end","begin","isFull","wrap","values","isEmpty","undefined","relativeIndex","pop","GrowingRingBuffer","super","INITIAL_CAPACITY","expand","unshift","newCapacity","newData","len","iteratorFromItems","items","ArrayIterator","iteratorFromFunction","func","FunctionCallIterator","LazyIterator","done","stream","prefetch","predicate","shouldContinue","handler","ErrorHandlingLazyIterator","FilterIterator","transform","MapIterator","AsyncMapIterator","serial","FlatmapIterator","resolveFully","serialMapAsync","resolveWhile","batchSize","smallLastBatch","RowMajorBatchIterator","rowMajorBatch","iterator","baseErrorHandler","ChainedIterator","TakeIterator","SkipIterator","bufferSize","PrefetchIterator","windowSize","ShuffleIterator","SerialIterator","trav","nextFn","message","upstream","lastRead","Promise","resolve","summary","then","serialNext","maxCount","skipped","tf.dispose","enableSmallLastBatch","batch","inputTensors","tf.tensor_util","getTensorsInContainer","mapped","outputTensors","isTensorInList","dispose","OneToManyIterator","outputQueue","pump","shift","mappedArray","pushAll","iterators","moreIterators","readFromChain","iteratorResult","handleErrors","itemResult","ZipIterator","mismatchMode","FAIL","afterState","numIterators","iteratorsDone","SHORTEST","LONGEST","currentPromise","nextState","buffer","refill","seedrandom.alea","now","randomInt","upstreamExhausted","chosenIndex","chooseIndex","shuffleExcise","Dataset","base","size","assert","Infinity","ceil","datasetFromIteratorFn","columnMajorBatch","deepBatchConcat","dataset","concatenate","filter","tf.tidy","forEachAsync","mapAsync","iteratorIterator","baseIterators","take","skip","reshuffleEachIteration","seed2","shuffle","toArray","toArrayForTest","iteratorFn","rows","exampleRow","isTypedArray","arrays","tf.stack","tf.tensor","batchConcat","TextLineDataset","decodeUTF8","split","line","endsWith","CODE_QUOTE","STATE_OUT","Symbol","STATE_FIELD","STATE_QUOTE","STATE_QUOTE_AFTER_QUOTE","STATE_WITHIN_QUOTE_IN_QUOTE","CSVDataset","csvConfig","hasHeader","fullColumnNames","columnNames","columnConfigs","configuredColumnsOnly","delimWhitespace","util","delimiter","columnNamesValidated","setColumnNames","Object","columnNamesFromFile","maybeReadHeaderLine","counts","reduce","countAcc","name","duplicateNames","indexOf","iter","firstElement","firstLine","parseRow","lines","makeDataElement","features","labels","config","parsedValue","default","required","isLabel","valueAsNum","Number","isNaN","dtype","getBoolean","xs","ys","toLowerCase","validateElementCount","readOffset","readLength","currentState","charAt","substring","MicrophoneIterator","microphoneConfig","fftSize","fftSizeLog2","log2","isInteger","numFrames","numFramesPerSpectrogram","sampleRateHz","columnTruncateLength","audioTrackConstraints","smoothingTimeConstant","includeSpectrogram","includeWaveform","env","microphoneIterator","start","mediaDevices","getUserMedia","audio","video","ctxConstructor","window","AudioContext","webkitAudioContext","audioContext","sampleRate","streamSource","createMediaStreamSource","analyser","createAnalyser","connect","freqData","Float32Array","timeData","isClosed","spectrogramTensor","waveformTensor","audioDataQueue","getAudioData","flattenQueue","freqDataQueue","getTensorFromAudioDataArray","timeDataQueue","spectrogram","waveform","currentFrames","intervalID","setInterval","getFloatFrequencyData","getFloatTimeDomainData","clearInterval","disconnect","close","getTracks","stop","queue","frameSize","forEach","shape","vals","sizeFromShape","tensor","WebcamIterator","webcamVideoElement","webcamConfig","needToResize","resize","cropSize","resizeHeight","resizeWidth","cropBoxInd","tensor1d","centerCrop","widthCroppingRatio","heightCroppingRatio","height","widthCropStart","heightCropStart","widthCropEnd","heightCropEnd","cropBox","tensor2d","document","createElement","webcamIterator","facingMode","deviceId","srcObject","error","console","log","src","URL","createObjectURL","play","onloadedmetadata","img","fromPixels","JSON","stringify","cropAndResizeFrame","tidy","expandedImage","expandDims","cast","resizedImage","image","cropAndResize","reshape","track","DataSource","StringIterator","separator","SplitIterator","SplitIteratorImpl","chunkResult","carryover","ByteChunkIterator","Utf8Iterator","Utf8IteratorImpl","decoder","TextDecoder","StringDecoder","chunk","text","decode","write","Buffer","FileChunkIterator","file","File","Blob","offset","chunkSize","byteLength","reject","fileReader","FileReader","onload","event","TypeError","onabort","onerror","type","readAsArrayBuffer","getRequestInitFromRequest","request","method","headers","body","mode","credentials","cache","redirect","referrer","integrity","isLocalPath","source","substr","FileDataSource","fs","readFileSync","URLDataSource","url","fileOptions","urlString","requestInit","response","fetch","ok","uint8Array","arrayBuffer","statusText","urlChunkIterator","generator","gen","create","datasets","min","ds","iteratorFromZipped"],"mappings":";;;;;;;;;;;;;;;;ggBA2BA,SAAUA,EAAQC,EAAQC,GAE1B,SAASC,EAAKC,GACZ,IAgDIC,EAhDAC,EAAKC,KAAMC,GAgDXH,EAAI,WAEG,SAASI,GAClBA,EAAOA,EAAKC,WACZ,IAAK,IAAIC,EAAI,EAAGA,EAAIF,EAAKG,OAAQD,IAAK,CAEpC,IAAIE,EAAI,oBADRR,GAAKI,EAAKK,WAAWH,IAGrBE,GADAR,EAAIQ,IAAM,EAGVR,GADAQ,GAAKR,KACK,EAEVA,GAAS,YADTQ,GAAKR,GAGP,OAAmB,wBAAXA,IAAM,KA5DhBC,EAAGS,KAAO,WACR,IAAIC,EAAI,QAAUV,EAAGW,GAAY,uBAAPX,EAAGY,EAG7B,OAFAZ,EAAGW,GAAKX,EAAGa,GACXb,EAAGa,GAAKb,EAAGc,GACJd,E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ot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.fesm.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.fesm.js deleted file mode 100644 index d83665054..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.fesm.js +++ /dev/null @@ -1,4648 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import { Tensor, util, dispose, tensor_util, tidy, stack, tensor, env, tensor1d, tensor2d, browser, expandDims, cast, image, reshape } from '@tensorflow/tfjs-core'; - -var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - -function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; -} - -var alea = createCommonjsModule(function (module) { -// A port of an algorithm by Johannes Baagøe , 2010 -// http://baagoe.com/en/RandomMusings/javascript/ -// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror -// Original work is under MIT license - - -// Copyright (C) 2010 by Johannes Baagøe -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - - - -(function(global, module, define) { - -function Alea(seed) { - var me = this, mash = Mash(); - - me.next = function() { - var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32 - me.s0 = me.s1; - me.s1 = me.s2; - return me.s2 = t - (me.c = t | 0); - }; - - // Apply the seeding algorithm from Baagoe. - me.c = 1; - me.s0 = mash(' '); - me.s1 = mash(' '); - me.s2 = mash(' '); - me.s0 -= mash(seed); - if (me.s0 < 0) { me.s0 += 1; } - me.s1 -= mash(seed); - if (me.s1 < 0) { me.s1 += 1; } - me.s2 -= mash(seed); - if (me.s2 < 0) { me.s2 += 1; } - mash = null; -} - -function copy(f, t) { - t.c = f.c; - t.s0 = f.s0; - t.s1 = f.s1; - t.s2 = f.s2; - return t; -} - -function impl(seed, opts) { - var xg = new Alea(seed), - state = opts && opts.state, - prng = xg.next; - prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }; - prng.double = function() { - return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53 - }; - prng.quick = prng; - if (state) { - if (typeof(state) == 'object') copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; -} - -function Mash() { - var n = 0xefc8249d; - - var mash = function(data) { - data = data.toString(); - for (var i = 0; i < data.length; i++) { - n += data.charCodeAt(i); - var h = 0.02519603282416938 * n; - n = h >>> 0; - h -= n; - h *= n; - n = h >>> 0; - h -= n; - n += h * 0x100000000; // 2^32 - } - return (n >>> 0) * 2.3283064365386963e-10; // 2^-32 - }; - - return mash; -} - - -if (module && module.exports) { - module.exports = impl; -} else if (define && define.amd) { - define(function() { return impl; }); -} else { - this.alea = impl; -} - -})( - commonjsGlobal, - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader -); -}); - -var xor128 = createCommonjsModule(function (module) { -// A Javascript implementaion of the "xor128" prng algorithm by -// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper - -(function(global, module, define) { - -function XorGen(seed) { - var me = this, strseed = ''; - - me.x = 0; - me.y = 0; - me.z = 0; - me.w = 0; - - // Set up generator function. - me.next = function() { - var t = me.x ^ (me.x << 11); - me.x = me.y; - me.y = me.z; - me.z = me.w; - return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8); - }; - - if (seed === (seed | 0)) { - // Integer seed. - me.x = seed; - } else { - // String seed. - strseed += seed; - } - - // Mix in string seed, then discard an initial batch of 64 values. - for (var k = 0; k < strseed.length + 64; k++) { - me.x ^= strseed.charCodeAt(k) | 0; - me.next(); - } -} - -function copy(f, t) { - t.x = f.x; - t.y = f.y; - t.z = f.z; - t.w = f.w; - return t; -} - -function impl(seed, opts) { - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (typeof(state) == 'object') copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; -} - -if (module && module.exports) { - module.exports = impl; -} else if (define && define.amd) { - define(function() { return impl; }); -} else { - this.xor128 = impl; -} - -})( - commonjsGlobal, - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader -); -}); - -var xorwow = createCommonjsModule(function (module) { -// A Javascript implementaion of the "xorwow" prng algorithm by -// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper - -(function(global, module, define) { - -function XorGen(seed) { - var me = this, strseed = ''; - - // Set up generator function. - me.next = function() { - var t = (me.x ^ (me.x >>> 2)); - me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v; - return (me.d = (me.d + 362437 | 0)) + - (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0; - }; - - me.x = 0; - me.y = 0; - me.z = 0; - me.w = 0; - me.v = 0; - - if (seed === (seed | 0)) { - // Integer seed. - me.x = seed; - } else { - // String seed. - strseed += seed; - } - - // Mix in string seed, then discard an initial batch of 64 values. - for (var k = 0; k < strseed.length + 64; k++) { - me.x ^= strseed.charCodeAt(k) | 0; - if (k == strseed.length) { - me.d = me.x << 10 ^ me.x >>> 4; - } - me.next(); - } -} - -function copy(f, t) { - t.x = f.x; - t.y = f.y; - t.z = f.z; - t.w = f.w; - t.v = f.v; - t.d = f.d; - return t; -} - -function impl(seed, opts) { - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (typeof(state) == 'object') copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; -} - -if (module && module.exports) { - module.exports = impl; -} else if (define && define.amd) { - define(function() { return impl; }); -} else { - this.xorwow = impl; -} - -})( - commonjsGlobal, - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader -); -}); - -var xorshift7 = createCommonjsModule(function (module) { -// A Javascript implementaion of the "xorshift7" algorithm by -// François Panneton and Pierre L'ecuyer: -// "On the Xorgshift Random Number Generators" -// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf - -(function(global, module, define) { - -function XorGen(seed) { - var me = this; - - // Set up generator function. - me.next = function() { - // Update xor generator. - var X = me.x, i = me.i, t, v; - t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24); - t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10); - t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3); - t = X[(i + 4) & 7]; v ^= t ^ (t << 7); - t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9); - X[i] = v; - me.i = (i + 1) & 7; - return v; - }; - - function init(me, seed) { - var j, w, X = []; - - if (seed === (seed | 0)) { - // Seed state array using a 32-bit integer. - w = X[0] = seed; - } else { - // Seed state using a string. - seed = '' + seed; - for (j = 0; j < seed.length; ++j) { - X[j & 7] = (X[j & 7] << 15) ^ - (seed.charCodeAt(j) + X[(j + 1) & 7] << 13); - } - } - // Enforce an array length of 8, not all zeroes. - while (X.length < 8) X.push(0); - for (j = 0; j < 8 && X[j] === 0; ++j); - if (j == 8) w = X[7] = -1; else w = X[j]; - - me.x = X; - me.i = 0; - - // Discard an initial 256 values. - for (j = 256; j > 0; --j) { - me.next(); - } - } - - init(me, seed); -} - -function copy(f, t) { - t.x = f.x.slice(); - t.i = f.i; - return t; -} - -function impl(seed, opts) { - if (seed == null) seed = +(new Date); - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (state.x) copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; -} - -if (module && module.exports) { - module.exports = impl; -} else if (define && define.amd) { - define(function() { return impl; }); -} else { - this.xorshift7 = impl; -} - -})( - commonjsGlobal, - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader -); -}); - -var xor4096 = createCommonjsModule(function (module) { -// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm. -// -// This fast non-cryptographic random number generator is designed for -// use in Monte-Carlo algorithms. It combines a long-period xorshift -// generator with a Weyl generator, and it passes all common batteries -// of stasticial tests for randomness while consuming only a few nanoseconds -// for each prng generated. For background on the generator, see Brent's -// paper: "Some long-period random number generators using shifts and xors." -// http://arxiv.org/pdf/1004.3115v1.pdf -// -// Usage: -// -// var xor4096 = require('xor4096'); -// random = xor4096(1); // Seed with int32 or string. -// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits. -// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits. -// -// For nonzero numeric keys, this impelementation provides a sequence -// identical to that by Brent's xorgens 3 implementaion in C. This -// implementation also provides for initalizing the generator with -// string seeds, or for saving and restoring the state of the generator. -// -// On Chrome, this prng benchmarks about 2.1 times slower than -// Javascript's built-in Math.random(). - -(function(global, module, define) { - -function XorGen(seed) { - var me = this; - - // Set up generator function. - me.next = function() { - var w = me.w, - X = me.X, i = me.i, t, v; - // Update Weyl generator. - me.w = w = (w + 0x61c88647) | 0; - // Update xor generator. - v = X[(i + 34) & 127]; - t = X[i = ((i + 1) & 127)]; - v ^= v << 13; - t ^= t << 17; - v ^= v >>> 15; - t ^= t >>> 12; - // Update Xor generator array state. - v = X[i] = v ^ t; - me.i = i; - // Result is the combination. - return (v + (w ^ (w >>> 16))) | 0; - }; - - function init(me, seed) { - var t, v, i, j, w, X = [], limit = 128; - if (seed === (seed | 0)) { - // Numeric seeds initialize v, which is used to generates X. - v = seed; - seed = null; - } else { - // String seeds are mixed into v and X one character at a time. - seed = seed + '\0'; - v = 0; - limit = Math.max(limit, seed.length); - } - // Initialize circular array and weyl value. - for (i = 0, j = -32; j < limit; ++j) { - // Put the unicode characters into the array, and shuffle them. - if (seed) v ^= seed.charCodeAt((j + 32) % seed.length); - // After 32 shuffles, take v as the starting w value. - if (j === 0) w = v; - v ^= v << 10; - v ^= v >>> 15; - v ^= v << 4; - v ^= v >>> 13; - if (j >= 0) { - w = (w + 0x61c88647) | 0; // Weyl. - t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array. - i = (0 == t) ? i + 1 : 0; // Count zeroes. - } - } - // We have detected all zeroes; make the key nonzero. - if (i >= 128) { - X[(seed && seed.length || 0) & 127] = -1; - } - // Run the generator 512 times to further mix the state before using it. - // Factoring this as a function slows the main generator, so it is just - // unrolled here. The weyl generator is not advanced while warming up. - i = 127; - for (j = 4 * 128; j > 0; --j) { - v = X[(i + 34) & 127]; - t = X[i = ((i + 1) & 127)]; - v ^= v << 13; - t ^= t << 17; - v ^= v >>> 15; - t ^= t >>> 12; - X[i] = v ^ t; - } - // Storing state as object members is faster than using closure variables. - me.w = w; - me.X = X; - me.i = i; - } - - init(me, seed); -} - -function copy(f, t) { - t.i = f.i; - t.w = f.w; - t.X = f.X.slice(); - return t; -} -function impl(seed, opts) { - if (seed == null) seed = +(new Date); - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (state.X) copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; -} - -if (module && module.exports) { - module.exports = impl; -} else if (define && define.amd) { - define(function() { return impl; }); -} else { - this.xor4096 = impl; -} - -})( - commonjsGlobal, // window object or global - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader -); -}); - -var tychei = createCommonjsModule(function (module) { -// A Javascript implementaion of the "Tyche-i" prng algorithm by -// Samuel Neves and Filipe Araujo. -// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf - -(function(global, module, define) { - -function XorGen(seed) { - var me = this, strseed = ''; - - // Set up generator function. - me.next = function() { - var b = me.b, c = me.c, d = me.d, a = me.a; - b = (b << 25) ^ (b >>> 7) ^ c; - c = (c - d) | 0; - d = (d << 24) ^ (d >>> 8) ^ a; - a = (a - b) | 0; - me.b = b = (b << 20) ^ (b >>> 12) ^ c; - me.c = c = (c - d) | 0; - me.d = (d << 16) ^ (c >>> 16) ^ a; - return me.a = (a - b) | 0; - }; - - /* The following is non-inverted tyche, which has better internal - * bit diffusion, but which is about 25% slower than tyche-i in JS. - me.next = function() { - var a = me.a, b = me.b, c = me.c, d = me.d; - a = (me.a + me.b | 0) >>> 0; - d = me.d ^ a; d = d << 16 ^ d >>> 16; - c = me.c + d | 0; - b = me.b ^ c; b = b << 12 ^ d >>> 20; - me.a = a = a + b | 0; - d = d ^ a; me.d = d = d << 8 ^ d >>> 24; - me.c = c = c + d | 0; - b = b ^ c; - return me.b = (b << 7 ^ b >>> 25); - } - */ - - me.a = 0; - me.b = 0; - me.c = 2654435769 | 0; - me.d = 1367130551; - - if (seed === Math.floor(seed)) { - // Integer seed. - me.a = (seed / 0x100000000) | 0; - me.b = seed | 0; - } else { - // String seed. - strseed += seed; - } - - // Mix in string seed, then discard an initial batch of 64 values. - for (var k = 0; k < strseed.length + 20; k++) { - me.b ^= strseed.charCodeAt(k) | 0; - me.next(); - } -} - -function copy(f, t) { - t.a = f.a; - t.b = f.b; - t.c = f.c; - t.d = f.d; - return t; -} -function impl(seed, opts) { - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (typeof(state) == 'object') copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; -} - -if (module && module.exports) { - module.exports = impl; -} else if (define && define.amd) { - define(function() { return impl; }); -} else { - this.tychei = impl; -} - -})( - commonjsGlobal, - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader -); -}); - -var seedrandom = createCommonjsModule(function (module) { -/* -Copyright 2014 David Bau. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -*/ - -(function (pool, math) { -// -// The following constants are related to IEEE 754 limits. -// -var global = this, - width = 256, // each RC4 output is 0 <= x < 256 - chunks = 6, // at least six RC4 outputs for each double - digits = 52, // there are 52 significant digits in a double - rngname = 'random', // rngname: name for Math.random and Math.seedrandom - startdenom = math.pow(width, chunks), - significance = math.pow(2, digits), - overflow = significance * 2, - mask = width - 1, - nodecrypto; // node.js crypto module, initialized at the bottom. - -// -// seedrandom() -// This is the seedrandom function described above. -// -function seedrandom(seed, options, callback) { - var key = []; - options = (options == true) ? { entropy: true } : (options || {}); - - // Flatten the seed string or build one from local entropy if needed. - var shortseed = mixkey(flatten( - options.entropy ? [seed, tostring(pool)] : - (seed == null) ? autoseed() : seed, 3), key); - - // Use the seed to initialize an ARC4 generator. - var arc4 = new ARC4(key); - - // This function returns a random double in [0, 1) that contains - // randomness in every bit of the mantissa of the IEEE 754 value. - var prng = function() { - var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48 - d = startdenom, // and denominator d = 2 ^ 48. - x = 0; // and no 'extra last byte'. - while (n < significance) { // Fill up all significant digits by - n = (n + x) * width; // shifting numerator and - d *= width; // denominator and generating a - x = arc4.g(1); // new least-significant-byte. - } - while (n >= overflow) { // To avoid rounding up, before adding - n /= 2; // last byte, shift everything - d /= 2; // right using integer math until - x >>>= 1; // we have exactly the desired bits. - } - return (n + x) / d; // Form the number within [0, 1). - }; - - prng.int32 = function() { return arc4.g(4) | 0; }; - prng.quick = function() { return arc4.g(4) / 0x100000000; }; - prng.double = prng; - - // Mix the randomness into accumulated entropy. - mixkey(tostring(arc4.S), pool); - - // Calling convention: what to return as a function of prng, seed, is_math. - return (options.pass || callback || - function(prng, seed, is_math_call, state) { - if (state) { - // Load the arc4 state from the given state if it has an S array. - if (state.S) { copy(state, arc4); } - // Only provide the .state method if requested via options.state. - prng.state = function() { return copy(arc4, {}); }; - } - - // If called as a method of Math (Math.seedrandom()), mutate - // Math.random because that is how seedrandom.js has worked since v1.0. - if (is_math_call) { math[rngname] = prng; return seed; } - - // Otherwise, it is a newer calling convention, so return the - // prng directly. - else return prng; - })( - prng, - shortseed, - 'global' in options ? options.global : (this == math), - options.state); -} -math['seed' + rngname] = seedrandom; - -// -// ARC4 -// -// An ARC4 implementation. The constructor takes a key in the form of -// an array of at most (width) integers that should be 0 <= x < (width). -// -// The g(count) method returns a pseudorandom integer that concatenates -// the next (count) outputs from ARC4. Its return value is a number x -// that is in the range 0 <= x < (width ^ count). -// -function ARC4(key) { - var t, keylen = key.length, - me = this, i = 0, j = me.i = me.j = 0, s = me.S = []; - - // The empty key [] is treated as [0]. - if (!keylen) { key = [keylen++]; } - - // Set up S using the standard key scheduling algorithm. - while (i < width) { - s[i] = i++; - } - for (i = 0; i < width; i++) { - s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))]; - s[j] = t; - } - - // The "g" method returns the next (count) outputs as one number. - (me.g = function(count) { - // Using instance members instead of closure state nearly doubles speed. - var t, r = 0, - i = me.i, j = me.j, s = me.S; - while (count--) { - t = s[i = mask & (i + 1)]; - r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))]; - } - me.i = i; me.j = j; - return r; - // For robust unpredictability, the function call below automatically - // discards an initial batch of values. This is called RC4-drop[256]. - // See http://google.com/search?q=rsa+fluhrer+response&btnI - })(width); -} - -// -// copy() -// Copies internal state of ARC4 to or from a plain object. -// -function copy(f, t) { - t.i = f.i; - t.j = f.j; - t.S = f.S.slice(); - return t; -} -// -// flatten() -// Converts an object tree to nested arrays of strings. -// -function flatten(obj, depth) { - var result = [], typ = (typeof obj), prop; - if (depth && typ == 'object') { - for (prop in obj) { - try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {} - } - } - return (result.length ? result : typ == 'string' ? obj : obj + '\0'); -} - -// -// mixkey() -// Mixes a string seed into a key that is an array of integers, and -// returns a shortened string seed that is equivalent to the result key. -// -function mixkey(seed, key) { - var stringseed = seed + '', smear, j = 0; - while (j < stringseed.length) { - key[mask & j] = - mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++)); - } - return tostring(key); -} - -// -// autoseed() -// Returns an object for autoseeding, using window.crypto and Node crypto -// module if available. -// -function autoseed() { - try { - var out; - if (nodecrypto && (out = nodecrypto.randomBytes)) { - // The use of 'out' to remember randomBytes makes tight minified code. - out = out(width); - } else { - out = new Uint8Array(width); - (global.crypto || global.msCrypto).getRandomValues(out); - } - return tostring(out); - } catch (e) { - var browser = global.navigator, - plugins = browser && browser.plugins; - return [+new Date, global, plugins, global.screen, tostring(pool)]; - } -} - -// -// tostring() -// Converts an array of charcodes to a string -// -function tostring(a) { - return String.fromCharCode.apply(0, a); -} - -// -// When seedrandom.js is loaded, we immediately mix a few bits -// from the built-in RNG into the entropy pool. Because we do -// not want to interfere with deterministic PRNG state later, -// seedrandom will not call math.random on its own again after -// initialization. -// -mixkey(math.random(), pool); - -// -// Nodejs and AMD support: export the implementation as a module using -// either convention. -// -if ( module.exports) { - module.exports = seedrandom; - // When in node.js, try using crypto package for autoseeding. - try { - nodecrypto = require('crypto'); - } catch (ex) {} -} - -// End anonymous scope, and pass initial values. -})( - [], // pool: entropy pool starts empty - Math // math: package containing random, pow, and seedrandom -); -}); - -// A library of seedable RNGs implemented in Javascript. -// -// Usage: -// -// var seedrandom = require('seedrandom'); -// var random = seedrandom(1); // or any seed. -// var x = random(); // 0 <= x < 1. Every bit is random. -// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness. - -// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe. -// Period: ~2^116 -// Reported to pass all BigCrush tests. - - -// xor128, a pure xor-shift generator by George Marsaglia. -// Period: 2^128-1. -// Reported to fail: MatrixRank and LinearComp. - - -// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl. -// Period: 2^192-2^32 -// Reported to fail: CollisionOver, SimpPoker, and LinearComp. - - -// xorshift7, by François Panneton and Pierre L'ecuyer, takes -// a different approach: it adds robustness by allowing more shifts -// than Marsaglia's original three. It is a 7-shift generator -// with 256 bits, that passes BigCrush with no systmatic failures. -// Period 2^256-1. -// No systematic BigCrush failures reported. - - -// xor4096, by Richard Brent, is a 4096-bit xor-shift with a -// very long period that also adds a Weyl generator. It also passes -// BigCrush with no systematic failures. Its long period may -// be useful if you have many generators and need to avoid -// collisions. -// Period: 2^4128-2^32. -// No systematic BigCrush failures reported. - - -// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random -// number generator derived from ChaCha, a modern stream cipher. -// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf -// Period: ~2^127 -// No systematic BigCrush failures reported. - - -// The original ARC4-based prng included in this library. -// Period: ~2^1600 - - -seedrandom.alea = alea; -seedrandom.xor128 = xor128; -seedrandom.xorwow = xorwow; -seedrandom.xorshift7 = xorshift7; -seedrandom.xor4096 = xor4096; -seedrandom.tychei = tychei; - -var seedrandom$1 = seedrandom; -var seedrandom_1 = seedrandom$1.alea; - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/** - * Apply a mapping function to a nested structure in a recursive manner. - * - * The result of the mapping is an object with the same nested structure (i.e., - * of arrays and dicts) as the input, except that some subtrees are replaced, - * according to the results of the mapping function. - * - * Mappings are memoized. Thus, if the nested structure contains the same - * object in multiple positions, the output will contain the same mapped object - * in those positions. Cycles are not supported, however. - * - * @param input: The object to which to apply the mapping function. - * @param mapFn: A function that expects a single node of the object tree, and - * returns a `DeepMapResult`. The `DeepMapResult` either provides a - * replacement value for that node (i.e., replacing the subtree), or indicates - * that the node should be processed recursively. - */ -function deepMap(input, mapFn) { - return deepMapInternal(input, mapFn); -} -/** - * @param seen: A Map of known object mappings (i.e., memoized results of - * `mapFn()`) - * @param containedIn: An set containing objects on the reference path currently - * being processed (used to detect cycles). - */ -function deepMapInternal(input, mapFn, seen = new Map(), containedIn = new Set()) { - if (input == null) { - return null; - } - if (containedIn.has(input)) { - throw new Error('Circular references are not supported.'); - } - if (seen.has(input)) { - return seen.get(input); - } - const result = mapFn(input); - if (result.recurse && result.value !== null) { - throw new Error('A deep map function may not return both a value and recurse=true.'); - } - if (!result.recurse) { - seen.set(input, result.value); - return result.value; - } - else if (isIterable(input)) { - // tslint:disable-next-line:no-any - const mappedIterable = Array.isArray(input) ? [] : {}; - containedIn.add(input); - for (const k in input) { - const child = input[k]; - const childResult = deepMapInternal(child, mapFn, seen, containedIn); - mappedIterable[k] = childResult; - } - containedIn.delete(input); - return mappedIterable; - } - else { - throw new Error(`Can't recurse into non-iterable type: ${input}`); - } -} -// TODO(soergel, kangyizhang) Reconsider naming of deepZip() to avoid confusion -// with zip() -/** - * Zip nested structures together in a recursive manner. - * - * This has the effect of transposing or pivoting data, e.g. converting it from - * a row-major representation to a column-major representation. - * - * For example, `deepZip([{a: 1, b: 2}, {a: 3, b: 4}])` returns - * `{a: [1, 3], b: [2, 4]}`. - * - * The inputs should all have the same nested structure (i.e., of arrays and - * dicts). The result is a single object with the same nested structure, where - * the leaves are arrays collecting the values of the inputs at that location - * (or, optionally, the result of a custom function applied to those arrays). - * - * @param inputs: An array of the objects to zip together. - * @param zipFn: (optional) A function that expects an array of elements at a - * single node of the object tree, and returns a `DeepMapResult`. The - * `DeepMapResult` either provides a result value for that node (i.e., - * representing the subtree), or indicates that the node should be processed - * recursively. The default zipFn recurses as far as possible and places - * arrays at the leaves. - */ -function deepZip(inputs, zipFn = zipToList) { - return deepZipInternal(inputs, zipFn); -} -/** - * @param containedIn: An set containing objects on the reference path currently - * being processed (used to detect cycles). - */ -function deepZipInternal(inputs, zipFn, containedIn = new Set()) { - // The recursion follows the structure of input 0; it's assumed that all the - // other inputs have the same structure. - const input = inputs[0]; - if (containedIn.has(input)) { - throw new Error('Circular references are not supported.'); - } - const result = zipFn(inputs); - if (result.recurse && result.value !== null) { - throw new Error('A deep zip function may not return both a value and recurse=true.'); - } - if (!result.recurse) { - return result.value; - } - else if (isIterable(input)) { - // tslint:disable-next-line:no-any - const mappedIterable = Array.isArray(input) ? [] : {}; - containedIn.add(input); - for (const k in input) { - const children = inputs.map(x => x[k]); - const childResult = deepZipInternal(children, zipFn, containedIn); - mappedIterable[k] = childResult; - } - containedIn.delete(input); - return mappedIterable; - } - else { - throw new Error(`Can't recurse into non-iterable type: ${input}`); - } -} -// tslint:disable-next-line:no-any -function zipToList(x) { - if (x === null) { - return null; - } - // TODO(soergel): validate array type? - if (isIterable(x[0])) { - return { value: null, recurse: true }; - } - else { - return { value: x, recurse: false }; - } -} -/** - * Apply an async mapping function to a nested structure in a recursive manner. - * - * This first creates a nested structure of Promises, and then awaits all of - * those, resulting in a single Promise for a resolved nested structure. - * - * The result of the mapping is an object with the same nested structure (i.e., - * of arrays and dicts) as the input, except that some subtrees are replaced, - * according to the results of the mapping function. - * - * Mappings are memoized. Thus, if the nested structure contains the same - * object in multiple positions, the output will contain the same mapped object - * in those positions. Cycles are not supported, however. - * - * @param input: The object to which to apply the mapping function. - * @param mapFn: A function that expects a single node of the object tree, and - * returns a `DeepMapAsyncResult`. The `DeepMapAsyncResult` either provides - * a `Promise` for a replacement value for that node (i.e., replacing the - * subtree), or indicates that the node should be processed recursively. Note - * that the decision whether or not to recurse must be made immediately; only - * the mapped value may be promised. - */ -async function deepMapAndAwaitAll(input, mapFn) { - const seen = new Map(); - // First do a normal deepMap, collecting Promises in 'seen' as a side effect. - deepMapInternal(input, mapFn, seen); - // Replace the Promises in 'seen' in place. - // Note TypeScript provides no async map iteration, and regular map iteration - // is broken too, so sadly we have to do Array.from() to make it work. - // (There's no advantage to Promise.all(), and that would be tricky anyway.) - for (const key of Array.from(seen.keys())) { - const value = seen.get(key); - if (util.isPromise(value)) { - const mappedValue = await value; - seen.set(key, mappedValue); - } - } - // Normal deepMap again, this time filling in the resolved values. - // It's unfortunate that we have to do two passes. - // TODO(soergel): test performance and think harder about a fast solution. - const result = deepMapInternal(input, mapFn, seen); - return result; -} -/** - * Determine whether the argument is iterable. - * - * @returns true if the argument is an array or any non-Tensor object. - */ -// tslint:disable-next-line:no-any -function isIterable(obj) { - return obj != null && (!ArrayBuffer.isView(obj)) && - (Array.isArray(obj) || - (typeof obj === 'object' && !(obj instanceof Tensor))); -} -/** - * Determine whether the argument can be converted to Tensor. - * - * Tensors, primitives, arrays, and TypedArrays all qualify; anything else does - * not. - * - * @returns true if the argument can be converted to Tensor. - */ -// tslint:disable-next-line:no-any -function canTensorify(obj) { - return obj == null || isPrimitive(obj) || Array.isArray(obj) || - (typeof obj === 'object' && (obj instanceof Tensor)) || - util.isTypedArray(obj); -} -/** - * Returns true if the given `value` is a primitive type. Otherwise returns - * false. This is equivalant to node util.isPrimitive - */ -function isPrimitive(value) { - return (value === null || - (typeof value !== 'object' && typeof value !== 'function')); -} - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -function deepClone(container) { - return deepMap(container, cloneIfTensor); -} -// tslint:disable-next-line: no-any -function cloneIfTensor(item) { - if (item instanceof Tensor) { - return ({ value: item.clone(), recurse: false }); - } - else if (isIterable(item)) { - return { value: null, recurse: true }; - } - else { - return { value: item, recurse: false }; - } -} - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/** - * A ring buffer, providing O(1) FIFO, LIFO, and related operations. - */ -class RingBuffer { - /** - * Constructs a `RingBuffer`. - * @param capacity The number of items that the buffer can accomodate. - */ - constructor(capacity) { - this.capacity = capacity; - // Note we store the indices in the range 0 <= index < 2*capacity. - // This allows us to distinguish the full from the empty case. - // See https://www.snellman.net/blog/archive/2016-12-13-ring-buffers/ - this.begin = 0; // inclusive - this.end = 0; // exclusive - if (capacity == null) { - throw new RangeError('Can\'t create a ring buffer of unknown capacity.'); - } - if (capacity < 1) { - throw new RangeError('Can\'t create ring buffer of capacity < 1.'); - } - this.data = new Array(capacity); - this.doubledCapacity = 2 * capacity; - } - /** - * Map any index into the range 0 <= index < 2*capacity. - */ - wrap(index) { - // don't trust % on negative numbers - while (index < 0) { - index += this.doubledCapacity; - } - return index % this.doubledCapacity; - } - get(index) { - if (index < 0) { - throw new RangeError('Can\'t get item at a negative index.'); - } - return this.data[index % this.capacity]; - } - set(index, value) { - if (index < 0) { - throw new RangeError('Can\'t set item at a negative index.'); - } - this.data[index % this.capacity] = value; - } - /** - * Returns the current number of items in the buffer. - */ - length() { - let length = this.end - this.begin; - if (length < 0) { - length = this.doubledCapacity + length; - } - return length; - } - /** - * Reports whether the buffer is full. - * @returns true if the number of items in the buffer equals its capacity, and - * false otherwise. - */ - isFull() { - return this.length() === this.capacity; - } - /** - * Reports whether the buffer is empty. - * @returns true if the number of items in the buffer equals zero, and - * false otherwise. - */ - isEmpty() { - return this.length() === 0; - } - /** - * Adds an item to the end of the buffer. - */ - push(value) { - if (this.isFull()) { - throw new RangeError('Ring buffer is full.'); - } - this.set(this.end, value); - this.end = this.wrap(this.end + 1); - } - /** - * Adds many items to the end of the buffer, in order. - */ - pushAll(values) { - for (const value of values) { - this.push(value); - } - } - /** - * Removes and returns the last item in the buffer. - */ - pop() { - if (this.isEmpty()) { - throw new RangeError('Ring buffer is empty.'); - } - this.end = this.wrap(this.end - 1); - const result = this.get(this.end); - this.set(this.end, undefined); - return result; - } - /** - * Adds an item to the beginning of the buffer. - */ - unshift(value) { - if (this.isFull()) { - throw new RangeError('Ring buffer is full.'); - } - this.begin = this.wrap(this.begin - 1); - this.set(this.begin, value); - } - /** - * Removes and returns the first item in the buffer. - */ - shift() { - if (this.isEmpty()) { - throw new RangeError('Ring buffer is empty.'); - } - const result = this.get(this.begin); - this.set(this.begin, undefined); - this.begin = this.wrap(this.begin + 1); - return result; - } - /** - * Removes and returns a specific item in the buffer, and moves the last item - * to the vacated slot. This is useful for implementing a shuffling stream. - * Note that this operation necessarily scrambles the original order. - * - * @param relativeIndex: the index of the item to remove, relative to the - * first item in the buffer (e.g., hiding the ring nature of the underlying - * storage). - */ - shuffleExcise(relativeIndex) { - if (this.isEmpty()) { - throw new RangeError('Ring buffer is empty.'); - } - const index = this.wrap(this.begin + relativeIndex); - const result = this.get(index); - this.set(index, this.pop()); - return result; - } -} - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -class GrowingRingBuffer extends RingBuffer { - /** - * Constructs a `GrowingRingBuffer`. - */ - constructor() { - super(GrowingRingBuffer.INITIAL_CAPACITY); - } - isFull() { - return false; - } - push(value) { - if (super.isFull()) { - this.expand(); - } - super.push(value); - } - unshift(value) { - if (super.isFull()) { - this.expand(); - } - super.unshift(value); - } - /** - * Doubles the capacity of the buffer. - */ - expand() { - const newCapacity = this.capacity * 2; - const newData = new Array(newCapacity); - const len = this.length(); - // Rotate the buffer to start at index 0 again, since we can't just - // allocate more space at the end. - for (let i = 0; i < len; i++) { - newData[i] = this.get(this.wrap(this.begin + i)); - } - this.data = newData; - this.capacity = newCapacity; - this.doubledCapacity = 2 * this.capacity; - this.begin = 0; - this.end = len; - } -} -GrowingRingBuffer.INITIAL_CAPACITY = 32; - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -// Here we implement a simple asynchronous iterator. -// This lets us avoid using either third-party stream libraries or -// recent TypeScript language support requiring polyfills. -/** - * Create a `LazyIterator` from an array of items. - */ -function iteratorFromItems(items) { - return new ArrayIterator(items); -} -/** - * Create a `LazyIterator` from a function. - * - * ```js - * let i = -1; - * const func = () => - * ++i < 5 ? {value: i, done: false} : {value: null, done: true}; - * const iter = tf.data.iteratorFromFunction(func); - * await iter.forEachAsync(e => console.log(e)); - * ``` - * - * @param func A function that produces data on each call. - */ -function iteratorFromFunction(func) { - return new FunctionCallIterator(func); -} -/** - * Create a `LazyIterator` by concatenating underlying streams, which are - * themselves provided as a stream. - * - * This can also be thought of as a "stream flatten" operation. - * - * @param baseIterators A stream of streams to be concatenated. - * @param baseErrorHandler An optional function that can intercept `Error`s - * raised during a `next()` call on the base stream. This function can decide - * whether the error should be propagated, whether the error should be - * ignored, or whether the base stream should be terminated. - */ -function iteratorFromConcatenated(baseIterators, baseErrorHandler) { - return new ChainedIterator(baseIterators, baseErrorHandler); -} -/** - * Create a `LazyIterator` by zipping together an array, dict, or nested - * structure of `LazyIterator`s (and perhaps additional constants). - * - * The underlying streams must provide elements in a consistent order such - * that they correspond. - * - * Typically, the underlying streams should have the same number of - * elements. If they do not, the behavior is determined by the - * `mismatchMode` argument. - * - * The nested structure of the `iterators` argument determines the - * structure of elements in the resulting iterator. - * - * @param iterators: An array or object containing LazyIterators at the - * leaves. - * @param mismatchMode: Determines what to do when one underlying iterator - * is exhausted before the others. `ZipMismatchMode.FAIL` (the default) - * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST` - * causes the zipped iterator to terminate with the furst underlying - * streams, so elements remaining on the longer streams are ignored. - * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling - * in nulls for the exhausted streams, until all streams are exhausted. - */ -function iteratorFromZipped(iterators, mismatchMode = ZipMismatchMode.FAIL) { - return new ZipIterator(iterators, mismatchMode); -} -/** - * An asynchronous iterator, providing lazy access to a potentially - * unbounded stream of elements. - * - * Iterator can be obtained from a dataset: - * `const iter = await dataset.iterator();` - */ -class LazyIterator { - /** - * Collect all remaining elements of a bounded stream into an array. - * Obviously this will succeed only for small streams that fit in memory. - * Useful for testing. - * - * @returns A Promise for an array of stream elements, which will resolve - * when the stream is exhausted. - */ - async toArray() { - const result = []; - let x = await this.next(); - while (!x.done) { - result.push(x.value); - x = await this.next(); - } - 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). - * - * @returns A Promise for an array of stream elements, which will resolve - * when the stream is exhausted. - */ - async toArrayForTest() { - const stream = this.prefetch(100); - const result = []; - let x = await stream.next(); - while (!x.done) { - result.push(x.value); - x = await stream.next(); - } - return result; - } - /** - * Draw items from the stream until it is exhausted. - * - * This can be useful when the stream has side effects but no output. In - * that case, calling this function guarantees that the stream will be - * fully processed. - */ - async resolveFully() { - let x = await this.next(); - while (!x.done) { - x = await this.next(); - } - } - /** - * Draw items from the stream until it is exhausted, or a predicate fails. - * - * This can be useful when the stream has side effects but no output. In - * that case, calling this function guarantees that the stream will be - * fully processed. - */ - async resolveWhile(predicate) { - let x = await this.next(); - let shouldContinue = predicate(x.value); - while ((!x.done) && shouldContinue) { - x = await this.next(); - shouldContinue = predicate(x.value); - } - } - /** - * Handles errors thrown on this stream using a provided handler function. - * - * @param handler A function that handles any `Error` thrown during a `next()` - * call and returns true if the stream should continue (dropping the failed - * call) or false if the stream should quietly terminate. If the handler - * itself throws (or rethrows) an `Error`, that will be propagated. - * - * @returns A `LazyIterator` of elements passed through from upstream, - * possibly filtering or terminating on upstream `next()` calls that - * throw an `Error`. - */ - handleErrors(handler) { - return new ErrorHandlingLazyIterator(this, handler); - } - // TODO(soergel): Implement reduce() etc. - /** - * Filters this stream according to `predicate`. - * - * @param predicate A function mapping a stream element to a boolean or a - * `Promise` for one. - * - * @returns A `LazyIterator` of elements for which the predicate was true. - */ - filter(predicate) { - return new FilterIterator(this, predicate); - } - /** - * Maps this stream through a 1-to-1 transform. - * - * @param transform A function mapping a stream element to a transformed - * element. - * - * @returns A `LazyIterator` of transformed elements. - */ - map(transform) { - return new MapIterator(this, transform); - } - /** - * Maps this stream through an async 1-to-1 transform. - * - * @param transform A function mapping a stream element to a `Promise` for a - * transformed stream element. - * - * @returns A `LazyIterator` of transformed elements. - */ - mapAsync(transform) { - return new AsyncMapIterator(this, transform); - } - /** - * Maps this stream through a 1-to-1 transform, forcing serial execution. - * - * @param transform A function mapping a stream element to a transformed - * element. - * - * @returns A `LazyIterator` of transformed elements. - */ - serialMapAsync(transform) { - return new AsyncMapIterator(this, transform).serial(); - } - /** - * Maps this stream through a 1-to-many transform. - * - * @param transform A function mapping a stream element to an array of - * transformed elements. - * - * @returns A `DataStream` of transformed elements. - */ - flatmap(transform) { - return new FlatmapIterator(this, transform); - } - /** - * Apply a function to every element of the stream. - * - * @param f A function to apply to each stream element. - */ - async forEachAsync(f) { - return this.map(f).resolveFully(); - } - /** - * Apply a function to every element of the stream, forcing serial execution. - * - * @param f A function to apply to each stream element. Should return 'true' - * to indicate that the stream should continue, or 'false' to cause it to - * terminate. - */ - async serialForEach(f) { - return this.serialMapAsync(f).resolveWhile(x => (x === true)); - } - /** - * Groups elements into batches, represented as arrays of elements. - * - * We can think of the elements of this iterator as 'rows' (even if they are - * nested structures). By the same token, consecutive values for a given - * key within the elements form a 'column'. This matches the usual sense of - * 'row' and 'column' when processing tabular data (e.g., parsing a CSV). - * - * Thus, "Row-major" means that the resulting batch is simply a collection of - * rows: `[row1, row2, row3, ...]`. This is contrast to the column-major - * form, which is needed for vectorized computation. - * - * @param batchSize The number of elements desired per batch. - * @param smallLastBatch Whether to emit the final batch when it has fewer - * than batchSize elements. Default true. - * @returns A `LazyIterator` of batches of elements, represented as arrays - * of the original element type. - */ - rowMajorBatch(batchSize, smallLastBatch = true) { - return new RowMajorBatchIterator(this, batchSize, smallLastBatch); - } - /** - * Groups elements into batches, represented in column-major form. - * - * We can think of the elements of this iterator as 'rows' (even if they are - * nested structures). By the same token, consecutive values for a given - * key within the elements form a 'column'. This matches the usual sense of - * 'row' and 'column' when processing tabular data (e.g., parsing a CSV). - * - * Thus, "column-major" means that the resulting batch is a (potentially - * nested) structure representing the columns. Each column entry, then, - * contains a collection of the values found in that column for a range of - * input elements. This representation allows for vectorized computation, in - * contrast to the row-major form. - * - * The inputs should all have the same nested structure (i.e., of arrays and - * dicts). The result is a single object with the same nested structure, - * where the leaves are arrays collecting the values of the inputs at that - * location (or, optionally, the result of a custom function applied to those - * arrays). - * - * @param batchSize The number of elements desired per batch. - * @param smallLastBatch Whether to emit the final batch when it has fewer - * than batchSize elements. Default true. - * @param zipFn: (optional) A function that expects an array of elements at a - * single node of the object tree, and returns a `DeepMapResult`. The - * `DeepMapResult` either provides a result value for that node (i.e., - * representing the subtree), or indicates that the node should be processed - * recursively. The default zipFn recurses as far as possible and places - * arrays at the leaves. - * @returns A `LazyIterator` of batches of elements, represented as an object - * with collections at the leaves. - */ - columnMajorBatch(batchSize, smallLastBatch = true, - // tslint:disable-next-line:no-any - zipFn = zipToList) { - // First collect the desired number of input elements as a row-major batch. - const rowBatches = this.rowMajorBatch(batchSize, smallLastBatch); - // Now 'rotate' or 'pivot' the data, collecting all values from each column - // in the batch (i.e., for each key within the elements) into an array. - return rowBatches.map(x => deepZip(x, zipFn)); - } - /** - * Concatenate this `LazyIterator` with another. - * - * @param iterator A `LazyIterator` to be concatenated onto this one. - * @param baseErrorHandler An optional function that can intercept `Error`s - * raised during a `next()` call on the base stream. This function can - * decide whether the error should be propagated, whether the error should - * be ignored, or whether the base stream should be terminated. - * @returns A `LazyIterator`. - */ - concatenate(iterator, baseErrorHandler) { - return new ChainedIterator(iteratorFromItems([this, iterator]), baseErrorHandler); - } - /** - * Limits this stream to return at most `count` items. - * - * @param count The maximum number of items to provide from the stream. If - * a negative or undefined value is given, the entire stream is returned - * unaltered. - */ - take(count) { - if (count < 0 || count == null) { - return this; - } - return new TakeIterator(this, count); - } - /** - * Skips the first `count` items in this stream. - * - * @param count The number of items to skip. If a negative or undefined - * value is given, the entire stream is returned unaltered. - */ - skip(count) { - if (count < 0 || count == null) { - return this; - } - return new SkipIterator(this, count); - } - /** - * Prefetch the first `bufferSize` items in this stream. - * - * Note this prefetches Promises, but makes no guarantees about when those - * Promises resolve. - * - * @param bufferSize: An integer specifying the number of elements to be - * prefetched. - */ - prefetch(bufferSize) { - return new PrefetchIterator(this, bufferSize); - } - // TODO(soergel): deep sharded shuffle, where supported - /** - * Randomly shuffles the elements of this stream. - * - * @param bufferSize: An integer specifying the number of elements from - * this stream from which the new stream will sample. - * @param seed: (Optional.) An integer specifying the random seed that - * will be used to create the distribution. - */ - shuffle(windowSize, seed) { - return new ShuffleIterator(this, windowSize, seed); - } - /** - * Force an iterator to execute serially: each next() call will await the - * prior one, so that they cannot execute concurrently. - */ - serial() { - return new SerialIterator(this); - } -} -// ============================================================================ -// The following private classes serve to implement the chainable methods -// on LazyIterator. Unfortunately they can't be placed in separate files, -// due to resulting trouble with circular imports. -// ============================================================================ -// Iterators that just extend LazyIterator directly -// ============================================================================ -class ArrayIterator extends LazyIterator { - constructor(items) { - super(); - this.items = items; - this.trav = 0; - } - summary() { - return `Array of ${this.items.length} items`; - } - async next() { - if (this.trav >= this.items.length) { - return { value: null, done: true }; - } - const item = this.items[this.trav]; - this.trav++; - return { value: deepClone(item), done: false }; - } -} -class FunctionCallIterator extends LazyIterator { - constructor(nextFn) { - super(); - this.nextFn = nextFn; - } - summary() { - return `Function call`; - } - async next() { - try { - return this.nextFn(); - } - catch (e) { - // Modify the error message but leave the stack trace intact - e.message = - `Error thrown while iterating through a dataset: ${e.message}`; - throw e; - } - } -} -class SerialIterator extends LazyIterator { - constructor(upstream) { - super(); - this.upstream = upstream; - this.lastRead = Promise.resolve({ value: null, done: false }); - } - summary() { - return `${this.upstream.summary()} -> Serial`; - } - async next() { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(() => this.serialNext()); - return this.lastRead; - } - async serialNext() { - return this.upstream.next(); - } -} -class SkipIterator extends LazyIterator { - constructor(upstream, maxCount) { - super(); - this.upstream = upstream; - this.maxCount = maxCount; - // Local state that should not be clobbered by out-of-order execution. - this.count = 0; - this.lastRead = Promise.resolve({ value: null, done: false }); - } - summary() { - return `${this.upstream.summary()} -> Skip`; - } - async next() { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(() => this.serialNext()); - return this.lastRead; - } - async serialNext() { - // TODO(soergel): consider tradeoffs of reading in parallel, eg. - // collecting next() promises in an Array and then waiting for - // Promise.all() of those. Benefit: pseudo-parallel execution. Drawback: - // maybe delayed GC. - while (this.count++ < this.maxCount) { - const skipped = await this.upstream.next(); - // short-circuit if upstream is already empty - if (skipped.done) { - return skipped; - } - dispose(skipped.value); - } - return this.upstream.next(); - } -} -class TakeIterator extends LazyIterator { - constructor(upstream, maxCount) { - super(); - this.upstream = upstream; - this.maxCount = maxCount; - this.count = 0; - } - summary() { - return `${this.upstream.summary()} -> Take`; - } - async next() { - if (this.count++ >= this.maxCount) { - return { value: null, done: true }; - } - return this.upstream.next(); - } -} -// Note this batch just groups items into row-wise element arrays. -// Rotating these to a column-wise representation happens only at the dataset -// level. -class RowMajorBatchIterator extends LazyIterator { - constructor(upstream, batchSize, enableSmallLastBatch = true) { - super(); - this.upstream = upstream; - this.batchSize = batchSize; - this.enableSmallLastBatch = enableSmallLastBatch; - this.lastRead = Promise.resolve({ value: null, done: false }); - } - summary() { - return `${this.upstream.summary()} -> RowMajorBatch`; - } - async next() { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(() => this.serialNext()); - return this.lastRead; - } - async serialNext() { - const batch = []; - while (batch.length < this.batchSize) { - const item = await this.upstream.next(); - if (item.done) { - if (this.enableSmallLastBatch && batch.length > 0) { - return { value: batch, done: false }; - } - return { value: null, done: true }; - } - batch.push(item.value); - } - return { value: batch, done: false }; - } -} -class FilterIterator extends LazyIterator { - constructor(upstream, predicate) { - super(); - this.upstream = upstream; - this.predicate = predicate; - this.lastRead = Promise.resolve({ value: null, done: false }); - } - summary() { - return `${this.upstream.summary()} -> Filter`; - } - async next() { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(() => this.serialNext()); - return this.lastRead; - } - async serialNext() { - while (true) { - const item = await this.upstream.next(); - if (item.done || this.predicate(item.value)) { - return item; - } - dispose(item.value); - } - } -} -class MapIterator extends LazyIterator { - constructor(upstream, transform) { - super(); - this.upstream = upstream; - this.transform = transform; - } - summary() { - return `${this.upstream.summary()} -> Map`; - } - async next() { - const item = await this.upstream.next(); - if (item.done) { - return { value: null, done: true }; - } - const inputTensors = tensor_util.getTensorsInContainer(item.value); - // Careful: the transform may mutate the item in place. - // That's why we have to remember the input Tensors above, and then - // below dispose only those that were not passed through to the output. - // Note too that the transform function is responsible for tidying - // any intermediate Tensors. Here we are concerned only about the - // inputs. - const mapped = this.transform(item.value); - const outputTensors = tensor_util.getTensorsInContainer(mapped); - // TODO(soergel) faster intersection - // TODO(soergel) move to tf.disposeExcept(in, out)? - for (const t of inputTensors) { - if (!tensor_util.isTensorInList(t, outputTensors)) { - t.dispose(); - } - } - return { value: mapped, done: false }; - } -} -class ErrorHandlingLazyIterator extends LazyIterator { - constructor(upstream, handler) { - super(); - this.upstream = upstream; - this.handler = handler; - this.count = 0; - this.lastRead = Promise.resolve({ value: null, done: false }); - } - summary() { - return `${this.upstream.summary()} -> handleErrors`; - } - async next() { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(() => this.serialNext()); - return this.lastRead; - } - async serialNext() { - while (true) { - try { - return await this.upstream.next(); - } - catch (e) { - if (!this.handler(e)) { - return { value: null, done: true }; - } - // If the handler returns true, loop and fetch the next upstream item. - // If the upstream iterator throws an endless stream of errors, and if - // the handler says to ignore them, then we loop forever here. That is - // the correct behavior-- it's up to the handler to decide when to stop. - } - } - } -} -class AsyncMapIterator extends LazyIterator { - constructor(upstream, transform) { - super(); - this.upstream = upstream; - this.transform = transform; - } - summary() { - return `${this.upstream.summary()} -> AsyncMap`; - } - async next() { - const item = await this.upstream.next(); - if (item.done) { - return { value: null, done: true }; - } - const inputTensors = tensor_util.getTensorsInContainer(item.value); - // Careful: the transform may mutate the item in place. - // That's why we have to remember the input Tensors above, and then - // below dispose only those that were not passed through to the output. - // Note too that the transform function is responsible for tidying - // any intermediate Tensors. Here we are concerned only about the - // inputs. - const mapped = await this.transform(item.value); - const outputTensors = tensor_util.getTensorsInContainer(mapped); - // TODO(soergel) faster intersection - // TODO(soergel) move to tf.disposeExcept(in, out)? - for (const t of inputTensors) { - if (!tensor_util.isTensorInList(t, outputTensors)) { - t.dispose(); - } - } - return { value: mapped, done: false }; - } -} -// Iterators that maintain a queue of pending items -// ============================================================================ -/** - * A base class for transforming streams that operate by maintaining an - * output queue of elements that are ready to return via next(). This is - * commonly required when the transformation is 1-to-many: A call to next() - * may trigger a call to the underlying stream, which will produce many - * mapped elements of this stream-- of which we need to return only one, so - * we have to queue the rest. - */ -class OneToManyIterator extends LazyIterator { - constructor() { - super(); - this.outputQueue = new GrowingRingBuffer(); - this.lastRead = Promise.resolve({ value: null, done: false }); - } - async next() { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(() => this.serialNext()); - return this.lastRead; - } - async serialNext() { - // Fetch so that the queue contains at least one item if possible. - // If the upstream source is exhausted, AND there are no items left in - // the output queue, then this stream is also exhausted. - while (this.outputQueue.length() === 0) { - // TODO(soergel): consider parallel reads. - if (!await this.pump()) { - return { value: null, done: true }; - } - } - return { value: this.outputQueue.shift(), done: false }; - } -} -class FlatmapIterator extends OneToManyIterator { - constructor(upstream, transform) { - super(); - this.upstream = upstream; - this.transform = transform; - } - summary() { - return `${this.upstream.summary()} -> Flatmap`; - } - async pump() { - const item = await this.upstream.next(); - if (item.done) { - return false; - } - const inputTensors = tensor_util.getTensorsInContainer(item.value); - // Careful: the transform may mutate the item in place. - // that's why we have to remember the input Tensors above, and then - // below dispose only those that were not passed through to the output. - // Note too that the transform function is responsible for tidying any - // intermediate Tensors. Here we are concerned only about the inputs. - const mappedArray = this.transform(item.value); - const outputTensors = tensor_util.getTensorsInContainer(mappedArray); - this.outputQueue.pushAll(mappedArray); - // TODO(soergel) faster intersection, and deduplicate outputTensors - // TODO(soergel) move to tf.disposeExcept(in, out)? - for (const t of inputTensors) { - if (!tensor_util.isTensorInList(t, outputTensors)) { - t.dispose(); - } - } - return true; - } -} -/** - * Provides a `LazyIterator` that concatenates a stream of underlying - * streams. - * - * Doing this in a concurrency-safe way requires some trickery. In - * particular, we want this stream to return the elements from the - * underlying streams in the correct order according to when next() was - * called, even if the resulting Promises resolve in a different order. - */ -class ChainedIterator extends LazyIterator { - constructor(iterators, baseErrorHandler) { - super(); - this.baseErrorHandler = baseErrorHandler; - // Strict Promise execution order: - // a next() call may not even begin until the previous one completes. - this.lastRead = null; - // Local state that should not be clobbered by out-of-order execution. - this.iterator = null; - this.moreIterators = iterators; - } - summary() { - const upstreamSummaries = 'TODO: fill in upstream of chained summaries'; - return `${upstreamSummaries} -> Chained`; - } - async next() { - this.lastRead = this.readFromChain(this.lastRead); - return this.lastRead; - } - async readFromChain(lastRead) { - // Must await on the previous read since the previous read may have advanced - // the stream of streams, from which we need to read. - // This is unfortunate since we can't parallelize reads. Which means - // prefetching of chained streams is a no-op. - // One solution is to prefetch immediately upstream of this. - await lastRead; - if (this.iterator == null) { - const iteratorResult = await this.moreIterators.next(); - if (iteratorResult.done) { - // No more streams to stream from. - return { value: null, done: true }; - } - this.iterator = iteratorResult.value; - if (this.baseErrorHandler != null) { - this.iterator = this.iterator.handleErrors(this.baseErrorHandler); - } - } - const itemResult = await this.iterator.next(); - if (itemResult.done) { - this.iterator = null; - return this.readFromChain(lastRead); - } - return itemResult; - } -} -var ZipMismatchMode; -(function (ZipMismatchMode) { - ZipMismatchMode[ZipMismatchMode["FAIL"] = 0] = "FAIL"; - ZipMismatchMode[ZipMismatchMode["SHORTEST"] = 1] = "SHORTEST"; - ZipMismatchMode[ZipMismatchMode["LONGEST"] = 2] = "LONGEST"; // use nulls for exhausted streams; use up the longest stream. -})(ZipMismatchMode || (ZipMismatchMode = {})); -/** - * Provides a `LazyIterator` that zips together an array, dict, or nested - * structure of `LazyIterator`s (and perhaps additional constants). - * - * The underlying streams must provide elements in a consistent order such - * that they correspond. - * - * Typically, the underlying streams should have the same number of - * elements. If they do not, the behavior is determined by the - * `mismatchMode` argument. - * - * The nested structure of the `iterators` argument determines the - * structure of elements in the resulting iterator. - * - * Doing this in a concurrency-safe way requires some trickery. In - * particular, we want this stream to return the elements from the - * underlying streams in the correct order according to when next() was - * called, even if the resulting Promises resolve in a different order. - * - * @param iterators: An array or object containing LazyIterators at the - * leaves. - * @param mismatchMode: Determines what to do when one underlying iterator - * is exhausted before the others. `ZipMismatchMode.FAIL` (the default) - * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST` - * causes the zipped iterator to terminate with the furst underlying - * streams, so elements remaining on the longer streams are ignored. - * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling - * in nulls for the exhausted streams, until all streams are exhausted. - */ -class ZipIterator extends LazyIterator { - constructor(iterators, mismatchMode = ZipMismatchMode.FAIL) { - super(); - this.iterators = iterators; - this.mismatchMode = mismatchMode; - this.count = 0; - this.currentPromise = null; - } - summary() { - const upstreamSummaries = 'TODO: fill in upstream of zip summaries'; - return `{${upstreamSummaries}} -> Zip`; - } - async nextState(afterState) { - // This chaining ensures that the underlying next() are not even called - // before the previous ones have resolved. - await afterState; - // Collect underlying iterator "done" signals as a side effect in - // getNext() - let numIterators = 0; - let iteratorsDone = 0; - function getNext(container) { - if (container instanceof LazyIterator) { - const result = container.next(); - return { - value: result.then(x => { - numIterators++; - if (x.done) { - iteratorsDone++; - } - return x.value; - }), - recurse: false - }; - } - else { - return { value: null, recurse: true }; - } - } - const mapped = await deepMapAndAwaitAll(this.iterators, getNext); - if (numIterators === iteratorsDone) { - // The streams have all ended. - return { value: null, done: true }; - } - if (iteratorsDone > 0) { - switch (this.mismatchMode) { - case ZipMismatchMode.FAIL: - throw new Error('Zipped streams should have the same length. ' + - `Mismatched at element ${this.count}.`); - case ZipMismatchMode.SHORTEST: - return { value: null, done: true }; - case ZipMismatchMode.LONGEST: - // Continue. The exhausted streams already produced value: null. - } - } - this.count++; - return { value: mapped, done: false }; - } - async next() { - this.currentPromise = this.nextState(this.currentPromise); - return this.currentPromise; - } -} -// Iterators that maintain a ring buffer of pending promises -// ============================================================================ -/** - * A stream that prefetches a given number of items from an upstream source, - * returning them in FIFO order. - * - * Note this prefetches Promises, but makes no guarantees about when those - * Promises resolve. - */ -class PrefetchIterator extends LazyIterator { - constructor(upstream, bufferSize) { - super(); - this.upstream = upstream; - this.bufferSize = bufferSize; - this.buffer = new RingBuffer(bufferSize); - } - summary() { - return `${this.upstream.summary()} -> Prefetch`; - } - /** - * Refill the prefetch buffer. Returns only after the buffer is full, or - * the upstream source is exhausted. - */ - refill() { - while (!this.buffer.isFull()) { - const v = this.upstream.next(); - this.buffer.push(v); - } - } - next() { - this.refill(); - // This shift will never throw an error because the buffer is always - // full after a refill. If the stream is exhausted, the buffer will be - // full of Promises that will resolve to the end-of-stream signal. - return this.buffer.shift(); - } -} -/** - * A stream that performs a sliding-window random shuffle on an upstream - * source. This is like a `PrefetchIterator` except that the items are - * returned in randomized order. Mixing naturally improves as the buffer - * size increases. - */ -class ShuffleIterator extends PrefetchIterator { - constructor(upstream, windowSize, seed) { - super(upstream, windowSize); - this.upstream = upstream; - this.windowSize = windowSize; - // Local state that should not be clobbered by out-of-order execution. - this.upstreamExhausted = false; - this.random = seedrandom_1(seed || util.now().toString()); - this.lastRead = Promise.resolve({ value: null, done: false }); - } - async next() { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(() => this.serialNext()); - return this.lastRead; - } - randomInt(max) { - return Math.floor(this.random() * max); - } - chooseIndex() { - return this.randomInt(this.buffer.length()); - } - async serialNext() { - // TODO(soergel): consider performance - if (!this.upstreamExhausted) { - this.refill(); - } - while (!this.buffer.isEmpty()) { - const chosenIndex = this.chooseIndex(); - const result = await this.buffer.shuffleExcise(chosenIndex); - if (result.done) { - this.upstreamExhausted = true; - } - else { - this.refill(); - return result; - } - } - return { value: null, done: true }; - } -} - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -// TODO(soergel): consider vectorized operations within the pipeline. -/** - * Represents a potentially large list of independent data elements (typically - * 'samples' or 'examples'). - * - * A 'data example' may be a primitive, an array, a map from string keys to - * values, or any nested structure of these. - * - * A `Dataset` represents an ordered collection of elements, together with a - * chain of transformations to be performed on those elements. Each - * transformation is a method of `Dataset` that returns another `Dataset`, so - * these may be chained, e.g. - * `const processedDataset = rawDataset.filter(...).map(...).batch(...)`. - * - * Data loading and transformation is done in a lazy, streaming fashion. The - * dataset may be iterated over multiple times; each iteration starts the data - * loading anew and recapitulates the transformations. - * - * A `Dataset` is typically processed as a stream of unbatched examples --i.e., - * its transformations are applied one example at a time. Batching produces a - * new `Dataset` where each element is a batch. Batching should usually come - * last in a pipeline, because data transformations are easier to express on a - * per-example basis than on a per-batch basis. - * - * The following code examples are calling `await dataset.forEachAsync(...)` to - * iterate once over the entire dataset in order to print out the data. - * - * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'} - */ -class Dataset { - constructor() { - this.size = null; - } - // TODO(soergel): Make Datasets report whether repeated iterator() calls - // produce the same result (e.g., reading from a file) or different results - // (e.g., from the webcam). Currently we don't make this distinction but it - // could be important for the user to know. - // abstract isDeterministic(): boolean; - /** - * Groups elements into batches. - * - * It is assumed that each of the incoming dataset elements has the same - * structure-- i.e. the same set of keys at each location in an object - * hierarchy. For each key, the resulting `Dataset` provides a batched - * element collecting all of the incoming values for that key. - * - * * Incoming primitives are grouped into a 1-D Tensor. - * * Incoming Tensors are grouped into a new Tensor where the 0'th axis is - * the batch dimension. - * * Incoming arrays are converted to Tensor and then batched. - * * A nested array is interpreted as an n-D Tensor, so the batched result - * has n+1 dimensions. - * * An array that cannot be converted to Tensor produces an error. - * - * If an array should not be batched as a unit, it should first be converted - * to an object with integer keys. - * - * Here are a few examples: - * - * Batch a dataset of numbers: - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8]).batch(4); - * await a.forEachAsync(e => e.print()); - * ``` - * - * Batch a dataset of arrays: - * ```js - * const b = tf.data.array([[1], [2], [3], [4], [5], [6], [7], [8]]).batch(4); - * await b.forEachAsync(e => e.print()); - * ``` - * - * Batch a dataset of objects: - * ```js - * const c = tf.data.array([{a: 1, b: 11}, {a: 2, b: 12}, {a: 3, b: 13}, - * {a: 4, b: 14}, {a: 5, b: 15}, {a: 6, b: 16}, {a: 7, b: 17}, - * {a: 8, b: 18}]).batch(4); - * await c.forEachAsync(e => { - * console.log('{'); - * for(var key in e) { - * console.log(key+':'); - * e[key].print(); - * } - * console.log('}'); - * }) - * ``` - * - * @param batchSize The number of elements desired per batch. - * @param smallLastBatch Whether to emit the final batch when it has fewer - * than batchSize elements. Default true. - * @returns A `Dataset`, from which a stream of batches can be obtained. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - batch(batchSize, smallLastBatch = true) { - const base = this; - util.assert(batchSize > 0, () => `batchSize needs to be positive, but it is - ${batchSize}`); - let size; - if (this.size === Infinity || this.size == null) { - // If the size of this dataset is infinity or null, the new size keeps the - // same. - size = this.size; - } - else if (smallLastBatch) { - // If the size of this dataset is known and include small last batch, the - // new size is full batch count plus last batch. - size = Math.ceil(this.size / batchSize); - } - else { - // If the size of this dataset is known and not include small last batch, - // the new size is full batch count. - size = Math.floor(this.size / batchSize); - } - return datasetFromIteratorFn(async () => { - return (await base.iterator()) - .columnMajorBatch(batchSize, smallLastBatch, deepBatchConcat); - }, size); - } - /** - * Concatenates this `Dataset` with another. - * - * ```js - * const a = tf.data.array([1, 2, 3]); - * const b = tf.data.array([4, 5, 6]); - * const c = a.concatenate(b); - * await c.forEachAsync(e => console.log(e)); - * ``` - * - * @param dataset A `Dataset` to be concatenated onto this one. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - concatenate(dataset) { - const base = this; - let size; - if (this.size === Infinity || dataset.size === Infinity) { - // If the size of any of these two dataset is infinity, new size is - // infinity. - size = Infinity; - } - else if (this.size != null && dataset.size != null) { - // If the size of both datasets are known and not infinity, new size is - // sum the size of these two datasets. - size = this.size + dataset.size; - } - else { - // If neither of these two datasets has infinite size and any of these two - // datasets' size is null, the new size is null. - size = null; - } - return datasetFromIteratorFn(async () => (await base.iterator()).concatenate(await dataset.iterator()), size); - } - /** - * Filters this dataset according to `predicate`. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) - * .filter(x => x%2 === 0); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param predicate A function mapping a dataset element to a boolean or a - * `Promise` for one. - * - * @returns A `Dataset` of elements for which the predicate was true. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - filter(predicate) { - const base = this; - let size; - if (this.size === Infinity) { - // If the size of this dataset is infinity, new size is infinity - size = Infinity; - } - else { - // If this dataset has limited elements, new size is null because it might - // exhausted randomly. - size = null; - } - return datasetFromIteratorFn(async () => { - return (await base.iterator()).filter(x => tidy(() => predicate(x))); - }, size); - } - /** - * Apply a function to every element of the dataset. - * - * After the function is applied to a dataset element, any Tensors contained - * within that element are disposed. - * - * ```js - * const a = tf.data.array([1, 2, 3]); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param f A function to apply to each dataset element. - * @returns A `Promise` that resolves after all elements have been processed. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - async forEachAsync(f) { - return (await this.iterator()).forEachAsync(f); - } - /** - * Maps this dataset through a 1-to-1 transform. - * - * ```js - * const a = tf.data.array([1, 2, 3]).map(x => x*x); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param transform A function mapping a dataset element to a transformed - * dataset element. - * - * @returns A `Dataset` of transformed elements. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - map(transform) { - const base = this; - return datasetFromIteratorFn(async () => { - return (await base.iterator()).map(x => tidy(() => transform(x))); - }, this.size); - } - /** - * Maps this dataset through an async 1-to-1 transform. - * - * ```js - * const a = - * tf.data.array([1, 2, 3]).mapAsync(x => new Promise(function(resolve){ - * setTimeout(() => { - * resolve(x * x); - * }, Math.random()*1000 + 500); - * })); - * console.log(await a.toArray()); - * ``` - * - * @param transform A function mapping a dataset element to a `Promise` for a - * transformed dataset element. This transform is responsible for disposing - * any intermediate `Tensor`s, i.e. by wrapping its computation in - * `tf.tidy()`; that cannot be automated here (as it is in the synchronous - * `map()` case). - * - * @returns A `Dataset` of transformed elements. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - mapAsync(transform) { - const base = this; - return datasetFromIteratorFn(async () => { - return (await base.iterator()).mapAsync(transform); - }, this.size); - } - /** - * Creates a `Dataset` that prefetches elements from this dataset. - * - * @param bufferSize: An integer specifying the number of elements to be - * prefetched. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - prefetch(bufferSize) { - if (bufferSize == null) { - throw new RangeError('`Dataset.prefetch()` requires bufferSize to be specified.'); - } - const base = this; - return datasetFromIteratorFn(async () => (await base.iterator()).prefetch(bufferSize), this.size); - } - /** - * Repeats this dataset `count` times. - * - * NOTE: If this dataset is a function of global state (e.g. a random number - * generator), then different repetitions may produce different elements. - * - * ```js - * const a = tf.data.array([1, 2, 3]).repeat(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param count: (Optional) An integer, representing the number of times - * the dataset should be repeated. The default behavior (if `count` is - * `undefined` or negative) is for the dataset be repeated indefinitely. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - repeat(count) { - const base = this; - let size; - if (this.size != null && count > 0) { - // If this dataset has size and count is positive, new size is current - // size multiply count. This also covers the case that current size is - // infinity. - size = this.size * count; - } - else if (count === 0) { - // If count is 0, new size is 0. - size = 0; - } - else if (this.size != null && (count === undefined || count < 0)) { - // If this dataset has size and count is undefined or negative, the - // dataset will be repeated indefinitely and new size is infinity. - size = Infinity; - } - else { - // If the size of this dataset is null, the new dataset's size is null. - size = null; - } - return datasetFromIteratorFn(async () => { - const iteratorIterator = iteratorFromFunction(async () => ({ value: await base.iterator(), done: false })); - return iteratorFromConcatenated(iteratorIterator.take(count)); - }, size); - } - /** - * Creates a `Dataset` that skips `count` initial elements from this dataset. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]).skip(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param count: The number of elements of this dataset that should be skipped - * to form the new dataset. If `count` is greater than the size of this - * dataset, the new dataset will contain no elements. If `count` - * is `undefined` or negative, skips the entire dataset. - * - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - skip(count) { - const base = this; - let size; - if (this.size != null && count >= 0 && this.size >= count) { - // If the size of this dataset is greater than count, the new dataset's - // size is current size minus skipped size.This also covers the case that - // current size is infinity. - size = this.size - count; - } - else if (this.size != null && - (this.size < count || count === undefined || count < 0)) { - // If the size of this dataset is smaller than count, or count is - // undefined or negative, skips the entire dataset and the new size is 0. - size = 0; - } - else { - // If the size of this dataset is null, the new dataset's size is null. - size = null; - } - return datasetFromIteratorFn(async () => (await base.iterator()).skip(count), size); - } - /** - * Pseudorandomly shuffles the elements of this dataset. This is done in a - * streaming manner, by sampling from a given number of prefetched elements. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]).shuffle(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param bufferSize: An integer specifying the number of elements from this - * dataset from which the new dataset will sample. - * @param seed: (Optional) An integer specifying the random seed that will - * be used to create the distribution. - * @param reshuffleEachIteration: (Optional) A boolean, which if true - * indicates that the dataset should be pseudorandomly reshuffled each time - * it is iterated over. If false, elements will be returned in the same - * shuffled order on each iteration. (Defaults to `true`.) - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - shuffle(bufferSize, seed, reshuffleEachIteration = true) { - if (bufferSize == null || bufferSize < 0) { - if (this.size == null) { - throw new RangeError('`Dataset.shuffle()` requires bufferSize to be specified.'); - } - else { - throw new RangeError('`Dataset.shuffle()` requires bufferSize to be specified. ' + - 'If your data fits in main memory (for regular JS objects), ' + - 'and/or GPU memory (for `tf.Tensor`s), consider setting ' + - `bufferSize to the dataset size (${this.size} elements)`); - } - } - const base = this; - const random = seedrandom_1(seed || util.now().toString()); - return datasetFromIteratorFn(async () => { - let seed2 = random.int32(); - if (reshuffleEachIteration) { - seed2 += random.int32(); - } - return (await base.iterator()).shuffle(bufferSize, seed2.toString()); - }, this.size); - } - /** - * Creates a `Dataset` with at most `count` initial elements from this - * dataset. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]).take(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param count: The number of elements of this dataset that should be taken - * to form the new dataset. If `count` is `undefined` or negative, or if - * `count` is greater than the size of this dataset, the new dataset will - * contain all elements of this dataset. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - take(count) { - const base = this; - let size; - if (this.size != null && this.size > count) { - // If the size of this dataset is greater than count, the new dataset's - // size is count. - size = count; - } - else if (this.size != null && this.size <= count) { - // If the size of this dataset is equal or smaller than count, the new - // dataset's size is the size of this dataset. - size = this.size; - } - else { - // If the size of this dataset is null, the new dataset's size is null. - size = null; - } - return datasetFromIteratorFn(async () => (await base.iterator()).take(count), size); - } - /** - * Collect all elements of this dataset into an array. - * - * Obviously this will succeed only for small datasets that fit in memory. - * Useful for testing and generally should be avoided if possible. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]); - * console.log(await a.toArray()); - * ``` - * - * @returns A Promise for an array of elements, which will resolve - * when a new stream has been obtained and fully consumed. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - async toArray() { - if (this.size === Infinity) { - throw new Error('Can not convert infinite data stream to array.'); - } - return (await this.iterator()).toArray(); - } - /** - * 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. - */ - async toArrayForTest() { - if (this.size === Infinity) { - throw new Error('Can not convert infinite data stream to array.'); - } - return (await this.iterator()).toArrayForTest(); - } -} -// TODO(soergel): deep sharded shuffle, where supported -Dataset.MAX_BUFFER_SIZE = 10000; -/** - * Create a `Dataset` defined by a provided iterator() function. - * - * ```js - * let i = -1; - * const func = () => - * ++i < 5 ? {value: i, done: false} : {value: null, done: true}; - * const iter = tf.data.iteratorFromFunction(func); - * const ds = tf.data.datasetFromIteratorFn(iter); - * await ds.forEachAsync(e => console.log(e)); - * ``` - */ -function datasetFromIteratorFn(iteratorFn, size = null) { - return new class extends Dataset { - constructor() { - super(...arguments); - this.size = size; - } - /* - * Provide a new stream of elements. Note this will also start new streams - * from any underlying `Dataset`s. - */ - async iterator() { - return iteratorFn(); - } - }(); -} -/** - * Create a `Dataset` from an array of elements. - * - * Create a Dataset from an array of objects: - * ```js - * const a = tf.data.array([{'item': 1}, {'item': 2}, {'item': 3}]); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * Create a Dataset from an array of numbers: - * ```js - * const a = tf.data.array([4, 5, 6]); - * await a.forEachAsync(e => console.log(e)); - * ``` - * @param items An array of elements that will be parsed as items in a dataset. - * - * @doc {heading: 'Data', subheading: 'Creation', namespace: 'data'} - */ -function array(items) { - return datasetFromIteratorFn(async () => iteratorFromItems(items), items.length); -} -/** - * Create a `Dataset` by zipping together an array, dict, or nested - * structure of `Dataset`s (and perhaps additional constants). - * The underlying datasets must provide elements in a consistent order such that - * they correspond. - * - * The number of elements in the resulting dataset is the same as the size of - * the smallest dataset in datasets. - * - * The nested structure of the `datasets` argument determines the - * structure of elements in the resulting iterator. - * - * Note this means that, given an array of two datasets that produce dict - * elements, the result is a dataset that produces elements that are arrays - * of two dicts: - * - * Zip an array of datasets: - * ```js - * console.log('Zip two datasets of objects:'); - * const ds1 = tf.data.array([{a: 1}, {a: 2}, {a: 3}]); - * const ds2 = tf.data.array([{b: 4}, {b: 5}, {b: 6}]); - * const ds3 = tf.data.zip([ds1, ds2]); - * await ds3.forEachAsync(e => console.log(JSON.stringify(e))); - * - * // If the goal is to merge the dicts in order to produce elements like - * // {a: ..., b: ...}, this requires a second step such as: - * console.log('Merge the objects:'); - * const ds4 = ds3.map(x => {return {a: x[0].a, b: x[1].b}}); - * await ds4.forEachAsync(e => console.log(e)); - * ``` - * - * Zip a dict of datasets: - * ```js - * const a = tf.data.array([{a: 1}, {a: 2}, {a: 3}]); - * const b = tf.data.array([{b: 4}, {b: 5}, {b: 6}]); - * const c = tf.data.zip({c: a, d: b}); - * await c.forEachAsync(e => console.log(JSON.stringify(e))); - * ``` - * - * @doc {heading: 'Data', subheading: 'Operations', namespace: 'data'} - */ -function zip(datasets) { - // manually type-check the argument for JS users - if (!isIterable(datasets)) { - throw new Error('The argument to zip() must be an object or array.'); - } - let size; - if (Array.isArray(datasets)) { - for (let i = 0; i < datasets.length; i++) { - size = size == null ? datasets[i].size : - Math.min(size, datasets[i].size); - } - } - else if (datasets instanceof Object) { - for (const ds in datasets) { - size = size == null ? datasets[ds].size : - Math.min(size, datasets[ds].size); - } - } - return datasetFromIteratorFn(async () => { - const streams = await deepMapAndAwaitAll(datasets, d => { - if (d instanceof Dataset) { - return { value: d.iterator(), recurse: false }; - } - else if (isIterable(d)) { - return { value: null, recurse: true }; - } - else { - throw new Error('Leaves of the structure passed to zip() must be Datasets, ' + - 'not primitives.'); - } - }); - return iteratorFromZipped(streams, ZipMismatchMode.SHORTEST); - }, size); -} -/** - * A zip function for use with deepZip, passed via the columnMajorBatch call. - * - * Accepts an array of identically-structured nested elements and either batches - * them (if they are primitives, numeric arrays, or Tensors) or requests - * recursion (if not). - */ -// tslint:disable-next-line:no-any -function deepBatchConcat(rows) { - if (rows === null) { - return null; - } - // use the first item to decide whether to recurse or batch here. - const exampleRow = rows[0]; - if (canTensorify(exampleRow)) { - // rows is an array of primitives, Tensors, or arrays. Batch them. - const value = batchConcat(rows); - return { value, recurse: false }; - } - // the example row is an object, so recurse into it. - return { value: null, recurse: true }; -} -/** - * Assembles a list of same-shaped numbers, number arrays, or Tensors - * into a single new Tensor where axis 0 is the batch dimension. - */ -function batchConcat(arrays) { - if (arrays.length === 0) { - // We can't return an empty Tensor because we don't know the element shape. - throw new Error('Can\'t make a batch of zero elements.'); - } - if (arrays[0] instanceof Tensor) { - // Input is an array of Tensors - return stack(arrays); - } - else { - // Input is a possibly-nested array of numbers. - return tensor(arrays); - } -} - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/** - * Represents a potentially large collection of text lines. - * - * The results are not batched. - */ -class TextLineDataset extends Dataset { - /** - * Create a `TextLineDataset`. - * - * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream. - */ - constructor(input) { - super(); - this.input = input; - } - async iterator() { - const inputIterator = await this.input.iterator(); - const utf8Iterator = inputIterator.decodeUTF8(); - const lineIterator = utf8Iterator.split('\n').map(line => { - // Windows/DOS format text file has extra line breaker at the end of line. - if (line.endsWith('\r')) { - line = line.slice(0, -1); - } - return line; - }); - return lineIterator; - } -} - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -const CODE_QUOTE = '"'; -const STATE_OUT = Symbol('out'); -const STATE_FIELD = Symbol('field'); -const STATE_QUOTE = Symbol('quote'); -const STATE_QUOTE_AFTER_QUOTE = Symbol('quoteafterquote'); -const STATE_WITHIN_QUOTE_IN_QUOTE = Symbol('quoteinquote'); -/** - * Represents a potentially large collection of delimited text records. - * - * The produced `TensorContainer`s each contain one key-value pair for - * every column of the table. When a field is empty in the incoming data, the - * resulting value is `undefined`, or throw error if it is required. Values - * that can be parsed as numbers are emitted as type `number`, other values - * are parsed as `string`. - * - * The results are not batched. - * - * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'} - */ -class CSVDataset extends Dataset { - /** - * Create a `CSVDataset`. - * - * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream. - * @param csvConfig (Optional) A CSVConfig object that contains configurations - * of reading and decoding from CSV file(s). - * - * hasHeader: (Optional) A boolean value that indicates whether the first - * row of provided CSV file is a header line with column names, and should - * not be included in the data. Defaults to `true`. - * - * columnNames: (Optional) A list of strings that corresponds to - * the CSV column names, in order. If provided, it ignores the column - * names inferred from the header row. If not provided, infers the column - * names from the first row of the records. If hasHeader is false and - * columnNames is not provided, this method throws an error. - * - * columnConfigs: (Optional) A dictionary whose key is column names, value - * is an object stating if this column is required, column's data type, - * default value, and if this column is label. If provided, keys must - * correspond to names provided in columnNames or inferred from the file - * header lines. If isLabel is true any column, returns an array of two - * items: the first item is a dict of features key/value pairs, the second - * item is a dict of labels key/value pairs. If no feature is marked as - * label, returns a dict of features only. - * - * configuredColumnsOnly (Optional) If true, only columns provided in - * columnConfigs will be parsed and provided during iteration. - * - * delimiter (Optional) The string used to parse each line of the input - * file. Defaults to `,`. - */ - constructor(input, csvConfig) { - super(); - this.input = input; - this.hasHeader = true; - this.fullColumnNames = null; - this.columnNamesValidated = false; - this.columnConfigs = null; - this.configuredColumnsOnly = false; - this.delimiter = ','; - this.delimWhitespace = false; - this.base = new TextLineDataset(input); - if (!csvConfig) { - csvConfig = {}; - } - this.hasHeader = csvConfig.hasHeader === false ? false : true; - this.fullColumnNames = csvConfig.columnNames; - this.columnConfigs = csvConfig.columnConfigs; - this.configuredColumnsOnly = csvConfig.configuredColumnsOnly; - if (csvConfig.delimWhitespace) { - util.assert(csvConfig.delimiter == null, () => 'Delimiter should not be provided when delimWhitespace is true.'); - this.delimWhitespace = true; - this.delimiter = ' '; - } - else { - this.delimiter = csvConfig.delimiter ? csvConfig.delimiter : ','; - } - } - /** - * Returns column names of the csv dataset. If `configuredColumnsOnly` is - * true, return column names in `columnConfigs`. If `configuredColumnsOnly` is - * false and `columnNames` is provided, `columnNames`. If - * `configuredColumnsOnly` is false and `columnNames` is not provided, return - * all column names parsed from the csv file. For example usage please go to - * `tf.data.csv`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - async columnNames() { - if (!this.columnNamesValidated) { - await this.setColumnNames(); - } - return this.configuredColumnsOnly ? Object.keys(this.columnConfigs) : - this.fullColumnNames; - } - /* 1) If `columnNames` is provided as string[], use this string[] as output - * keys in corresponding order. The length must match the number of inferred - * columns if `hasHeader` is true . - * 2) If `columnNames` is not provided, parse header line as `columnNames` if - * hasHeader is true. If `hasHeader` is false, throw an error. - * 3) If `columnConfigs` is provided, all the keys in `columnConfigs` must - * exist in parsed `columnNames`. - */ - async setColumnNames() { - const columnNamesFromFile = await this.maybeReadHeaderLine(); - if (!this.fullColumnNames && !columnNamesFromFile) { - // Throw an error if columnNames is not provided and no header line. - throw new Error('Column names must be provided if there is no header line.'); - } - else if (this.fullColumnNames && columnNamesFromFile) { - // Check provided columnNames match header line. - util.assert(columnNamesFromFile.length === this.fullColumnNames.length, () => 'The length of provided columnNames (' + - this.fullColumnNames.length.toString() + - ') does not match the length of the header line read from ' + - 'file (' + columnNamesFromFile.length.toString() + ').'); - } - if (!this.fullColumnNames) { - this.fullColumnNames = columnNamesFromFile; - } - // Check if there are duplicate column names. - const counts = this.fullColumnNames.reduce((countAcc, name) => { - countAcc[name] = (countAcc[name] + 1) || 1; - return countAcc; - }, {}); - const duplicateNames = Object.keys(counts).filter((name) => (counts[name] > 1)); - util.assert(duplicateNames.length === 0, () => 'Duplicate column names found: ' + duplicateNames.toString()); - // Check if keys in columnConfigs match columnNames. - if (this.columnConfigs) { - for (const key of Object.keys(this.columnConfigs)) { - const index = this.fullColumnNames.indexOf(key); - if (index === -1) { - throw new Error('The key "' + key + - '" provided in columnConfigs does not match any of the column ' + - 'names (' + this.fullColumnNames.toString() + ').'); - } - } - } - this.columnNamesValidated = true; - } - async maybeReadHeaderLine() { - if (this.hasHeader) { - const iter = await this.base.iterator(); - const firstElement = await iter.next(); - if (firstElement.done) { - throw new Error('No data was found for CSV parsing.'); - } - const firstLine = firstElement.value; - const headers = this.parseRow(firstLine, false); - return headers; - } - else { - return null; - } - } - async iterator() { - if (!this.columnNamesValidated) { - await this.setColumnNames(); - } - let lines = await this.base.iterator(); - if (this.hasHeader) { - // We previously read the first line to get the columnNames. - // Now that we're providing data, skip it. - lines = lines.skip(1); - } - return lines.map(x => this.makeDataElement(x)); - } - makeDataElement(line) { - const values = this.parseRow(line); - const features = {}; - const labels = {}; - for (let i = 0; i < this.fullColumnNames.length; i++) { - const key = this.fullColumnNames[i]; - const config = this.columnConfigs ? this.columnConfigs[key] : null; - if (this.configuredColumnsOnly && !config) { - // This column is not selected. - continue; - } - else { - const value = values[i]; - let parsedValue = null; - if (value === '') { - // If default value is provided, use it. If default value is not - // provided, set as undefined. - if (config && config.default !== undefined) { - parsedValue = config.default; - } - else if (config && (config.required || config.isLabel)) { - throw new Error(`Required column ${key} is empty in this line: ${line}`); - } - else { - parsedValue = undefined; - } - } - else { - // A value is present, so parse it based on type - const valueAsNum = Number(value); - if (isNaN(valueAsNum)) { - // The value is a string and this column is declared as boolean - // in config, parse it as boolean. - if (config && config.dtype === 'bool') { - parsedValue = this.getBoolean(value); - } - else { - // Set value as string - parsedValue = value; - } - } - else if (!config || !config.dtype) { - // If this value is a number and no type config is provided, return - // it as number. - parsedValue = valueAsNum; - } - else { - // If this value is a number and data type is provided, parse it - // according to provided data type. - switch (config.dtype) { - case 'float32': - parsedValue = valueAsNum; - break; - case 'int32': - parsedValue = Math.floor(valueAsNum); - break; - case 'bool': - parsedValue = this.getBoolean(value); - break; - default: - parsedValue = valueAsNum; - } - } - } - // Check if this column is label. - (config && config.isLabel) ? labels[key] = parsedValue : - features[key] = parsedValue; - } - } - // If label exists, return an object of features and labels as {xs:features, - // ys:labels}, otherwise return features only. - if (Object.keys(labels).length === 0) { - return features; - } - else { - return { xs: features, ys: labels }; - } - } - getBoolean(value) { - if (value === '1' || value.toLowerCase() === 'true') { - return 1; - } - else { - return 0; - } - } - // adapted from https://beta.observablehq.com/@mbostock/streaming-csv - parseRow(line, validateElementCount = true) { - const result = []; - let readOffset = 0; - const readLength = line.length; - let currentState = STATE_OUT; - // Goes through the line to parse quote. - for (let i = 0; i < readLength; i++) { - switch (currentState) { - // Before enter a new field - case STATE_OUT: - switch (line.charAt(i)) { - // Enter a quoted field - case CODE_QUOTE: - readOffset = i + 1; - currentState = STATE_QUOTE; - break; - // Read an empty field - case this.delimiter: - readOffset = i + 1; - // If delimiter is white space and configured to collapse - // multiple white spaces, ignore this white space. - if (this.delimiter === ' ' && this.delimWhitespace) { - break; - } - result.push(''); - currentState = STATE_OUT; - break; - // Enter an unquoted field - default: - currentState = STATE_FIELD; - readOffset = i; - break; - } - break; - // In an unquoted field - case STATE_FIELD: - switch (line.charAt(i)) { - // Exit an unquoted field, add it to result - case this.delimiter: - result.push(line.substring(readOffset, i)); - currentState = STATE_OUT; - readOffset = i + 1; - break; - } - break; - // In a quoted field - case STATE_QUOTE: - switch (line.charAt(i)) { - // Read a quote after a quote - case CODE_QUOTE: - currentState = STATE_QUOTE_AFTER_QUOTE; - break; - } - break; - // This state means it's right after a second quote in a field - case STATE_QUOTE_AFTER_QUOTE: - switch (line.charAt(i)) { - // Finished a quoted field - case this.delimiter: - result.push(line.substring(readOffset, i - 1)); - currentState = STATE_OUT; - readOffset = i + 1; - break; - // Finished a quoted part in a quoted field - case CODE_QUOTE: - currentState = STATE_QUOTE; - break; - // In a quoted part in a quoted field - default: - currentState = STATE_WITHIN_QUOTE_IN_QUOTE; - break; - } - break; - case STATE_WITHIN_QUOTE_IN_QUOTE: - switch (line.charAt(i)) { - // Exit a quoted part in a quoted field - case CODE_QUOTE: - currentState = STATE_QUOTE; - break; - } - break; - } - } - // Adds last item based on if it is quoted. - if (currentState === STATE_QUOTE_AFTER_QUOTE) { - result.push(line.substring(readOffset, readLength - 1)); - } - else { - result.push(line.substring(readOffset)); - } - // Check if each row has the same number of elements as column names. - if (validateElementCount && result.length !== this.fullColumnNames.length) { - throw new Error(`Invalid row in csv file. Should have ${this.fullColumnNames.length} elements in a row, but got ${result}`); - } - return result; - } -} -// TODO(soergel): add more basic datasets for parity with tf.data -// tf.data.FixedLengthRecordDataset() -// tf.data.TFRecordDataset() - -/** - * @license - * Copyright 2019 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/** - * Provide a stream of tensors from microphone audio stream. The tensors are - * representing audio data as frequency-domain spectrogram generated with - * browser's native FFT. Tensors representing time-domain waveform is available - * based on configuration. Only works in browser environment. - */ -class MicrophoneIterator extends LazyIterator { - constructor(microphoneConfig) { - super(); - this.microphoneConfig = microphoneConfig; - this.isClosed = false; - this.fftSize = microphoneConfig.fftSize || 1024; - const fftSizeLog2 = Math.log2(this.fftSize); - if (this.fftSize < 0 || fftSizeLog2 < 4 || fftSizeLog2 > 14 || - !Number.isInteger(fftSizeLog2)) { - throw new Error(`Invalid fftSize: it must be a power of 2 between ` + - `2 to 4 and 2 to 14, but got ${this.fftSize}`); - } - this.numFrames = microphoneConfig.numFramesPerSpectrogram || 43; - this.sampleRateHz = microphoneConfig.sampleRateHz; - this.columnTruncateLength = - microphoneConfig.columnTruncateLength || this.fftSize; - this.audioTrackConstraints = microphoneConfig.audioTrackConstraints; - this.smoothingTimeConstant = microphoneConfig.smoothingTimeConstant || 0; - this.includeSpectrogram = - microphoneConfig.includeSpectrogram === false ? false : true; - this.includeWaveform = - microphoneConfig.includeWaveform === true ? true : false; - if (!this.includeSpectrogram && !this.includeWaveform) { - throw new Error('Both includeSpectrogram and includeWaveform are false. ' + - 'At least one type of data should be returned.'); - } - } - summary() { - return `microphone`; - } - // Construct a MicrophoneIterator and start the audio stream. - static async create(microphoneConfig = {}) { - if (env().get('IS_NODE')) { - throw new Error('microphone API is only supported in browser environment.'); - } - const microphoneIterator = new MicrophoneIterator(microphoneConfig); - // Call async function start() to initialize the audio stream. - await microphoneIterator.start(); - return microphoneIterator; - } - // Start the audio stream and FFT. - async start() { - try { - this.stream = await navigator.mediaDevices.getUserMedia({ - audio: this.audioTrackConstraints == null ? true : - this.audioTrackConstraints, - video: false - }); - } - catch (e) { - throw new Error(`Error thrown while initializing video stream: ${e.message}`); - } - if (!this.stream) { - throw new Error('Could not obtain audio from microphone.'); - } - const ctxConstructor = - // tslint:disable-next-line:no-any - window.AudioContext || window.webkitAudioContext; - this.audioContext = new ctxConstructor(); - if (!this.sampleRateHz) { - // If sample rate is not provided, use the available sample rate on - // device. - this.sampleRateHz = this.audioContext.sampleRate; - } - else if (this.audioContext.sampleRate !== this.sampleRateHz) { - throw new Error(`Mismatch in sampling rate: ` + - `Expected: ${this.sampleRateHz}; ` + - `Actual: ${this.audioContext.sampleRate}`); - } - const streamSource = this.audioContext.createMediaStreamSource(this.stream); - this.analyser = this.audioContext.createAnalyser(); - this.analyser.fftSize = this.fftSize * 2; - this.analyser.smoothingTimeConstant = this.smoothingTimeConstant; - streamSource.connect(this.analyser); - this.freqData = new Float32Array(this.fftSize); - this.timeData = new Float32Array(this.fftSize); - return; - } - async next() { - if (this.isClosed) { - return { value: null, done: true }; - } - let spectrogramTensor; - let waveformTensor; - const audioDataQueue = await this.getAudioData(); - if (this.includeSpectrogram) { - const freqData = this.flattenQueue(audioDataQueue.freqDataQueue); - spectrogramTensor = this.getTensorFromAudioDataArray(freqData, [this.numFrames, this.columnTruncateLength, 1]); - } - if (this.includeWaveform) { - const timeData = this.flattenQueue(audioDataQueue.timeDataQueue); - waveformTensor = this.getTensorFromAudioDataArray(timeData, [this.numFrames * this.fftSize, 1]); - } - return { - value: { 'spectrogram': spectrogramTensor, 'waveform': waveformTensor }, - done: false - }; - } - // Capture one result from the audio stream, and extract the value from - // iterator.next() result. - async capture() { - return (await this.next()).value; - } - async getAudioData() { - const freqDataQueue = []; - const timeDataQueue = []; - let currentFrames = 0; - return new Promise(resolve => { - const intervalID = setInterval(() => { - if (this.includeSpectrogram) { - this.analyser.getFloatFrequencyData(this.freqData); - // If the audio stream is initializing, return empty queue. - if (this.freqData[0] === -Infinity) { - resolve({ freqDataQueue, timeDataQueue }); - } - freqDataQueue.push(this.freqData.slice(0, this.columnTruncateLength)); - } - if (this.includeWaveform) { - this.analyser.getFloatTimeDomainData(this.timeData); - timeDataQueue.push(this.timeData.slice()); - } - // Clean interval and return when all frames have been collected - if (++currentFrames === this.numFrames) { - clearInterval(intervalID); - resolve({ freqDataQueue, timeDataQueue }); - } - }, this.fftSize / this.sampleRateHz * 1e3); - }); - } - // Stop the audio stream and pause the iterator. - stop() { - if (!this.isClosed) { - this.isClosed = true; - this.analyser.disconnect(); - this.audioContext.close(); - if (this.stream != null && this.stream.getTracks().length > 0) { - this.stream.getTracks()[0].stop(); - } - } - } - // Override toArray() function to prevent collecting. - toArray() { - throw new Error('Can not convert infinite audio stream to array.'); - } - // Return audio sampling rate in Hz - getSampleRate() { - return this.sampleRateHz; - } - flattenQueue(queue) { - const frameSize = queue[0].length; - const freqData = new Float32Array(queue.length * frameSize); - queue.forEach((data, i) => freqData.set(data, i * frameSize)); - return freqData; - } - getTensorFromAudioDataArray(freqData, shape) { - const vals = new Float32Array(util.sizeFromShape(shape)); - // If the data is less than the output shape, the rest is padded with zeros. - vals.set(freqData, vals.length - freqData.length); - return tensor(vals, shape); - } -} - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/** - * Provide a stream of image tensors from webcam video stream. Only works in - * browser environment. - */ -class WebcamIterator extends LazyIterator { - constructor(webcamVideoElement, webcamConfig) { - super(); - this.webcamVideoElement = webcamVideoElement; - this.webcamConfig = webcamConfig; - this.isClosed = true; - this.resize = false; - if (this.needToResize()) { - this.resize = true; - this.cropSize = - [this.webcamConfig.resizeHeight, this.webcamConfig.resizeWidth]; - this.cropBoxInd = tensor1d([0], 'int32'); - if (this.webcamConfig.centerCrop) { - // Calculate the box based on resizing shape. - const widthCroppingRatio = this.webcamConfig.resizeWidth * 1.0 / this.webcamVideoElement.width; - const heightCroppingRatio = this.webcamConfig.resizeHeight * 1.0 / - this.webcamVideoElement.height; - const widthCropStart = (1 - widthCroppingRatio) / 2; - const heightCropStart = (1 - heightCroppingRatio) / 2; - const widthCropEnd = widthCropStart + widthCroppingRatio; - const heightCropEnd = heightCroppingRatio + heightCropStart; - this.cropBox = tensor2d([heightCropStart, widthCropStart, heightCropEnd, widthCropEnd], [1, 4]); - } - else { - this.cropBox = tensor2d([0, 0, 1, 1], [1, 4]); - } - } - } - summary() { - return `webcam`; - } - // Construct a WebcamIterator and start it's video stream. - static async create(webcamVideoElement, webcamConfig = {}) { - if (env().get('IS_NODE')) { - throw new Error('tf.data.webcam is only supported in browser environment.'); - } - if (!webcamVideoElement) { - // If webcam video element is not provided, create a hidden video element - // with provided width and height. - webcamVideoElement = document.createElement('video'); - if (!webcamConfig.resizeWidth || !webcamConfig.resizeHeight) { - throw new Error('Please provide webcam video element, or resizeWidth and ' + - 'resizeHeight to create a hidden video element.'); - } - webcamVideoElement.width = webcamConfig.resizeWidth; - webcamVideoElement.height = webcamConfig.resizeHeight; - } - const webcamIterator = new WebcamIterator(webcamVideoElement, webcamConfig); - // Call async function to initialize the video stream. - await webcamIterator.start(); - return webcamIterator; - } - // Async function to start video stream. - async start() { - if (this.webcamConfig.facingMode) { - util.assert((this.webcamConfig.facingMode === 'user') || - (this.webcamConfig.facingMode === 'environment'), () => `Invalid webcam facing mode: ${this.webcamConfig.facingMode}. ` + - `Please provide 'user' or 'environment'`); - } - try { - this.stream = await navigator.mediaDevices.getUserMedia({ - video: { - deviceId: this.webcamConfig.deviceId, - facingMode: this.webcamConfig.facingMode ? - this.webcamConfig.facingMode : - 'user', - width: this.webcamVideoElement.width, - height: this.webcamVideoElement.height - } - }); - } - catch (e) { - // Modify the error message but leave the stack trace intact - e.message = `Error thrown while initializing video stream: ${e.message}`; - throw e; - } - if (!this.stream) { - throw new Error('Could not obtain video from webcam.'); - } - // Older browsers may not have srcObject - try { - this.webcamVideoElement.srcObject = this.stream; - } - catch (error) { - console.log(error); - this.webcamVideoElement.src = window.URL.createObjectURL(this.stream); - } - // Start the webcam video stream - this.webcamVideoElement.play(); - this.isClosed = false; - return new Promise(resolve => { - // Add event listener to make sure the webcam has been fully initialized. - this.webcamVideoElement.onloadedmetadata = () => { - resolve(); - }; - }); - } - async next() { - if (this.isClosed) { - return { value: null, done: true }; - } - let img; - try { - img = browser.fromPixels(this.webcamVideoElement); - } - catch (e) { - throw new Error(`Error thrown converting video to pixels: ${JSON.stringify(e)}`); - } - if (this.resize) { - try { - return { value: this.cropAndResizeFrame(img), done: false }; - } - catch (e) { - throw new Error(`Error thrown cropping the video: ${e.message}`); - } - finally { - img.dispose(); - } - } - else { - return { value: img, done: false }; - } - } - needToResize() { - // If resizeWidth and resizeHeight are provided, and different from the - // width and height of original HTMLVideoElement, then resizing and cropping - // is required. - if (this.webcamConfig.resizeWidth && this.webcamConfig.resizeHeight && - (this.webcamVideoElement.width !== this.webcamConfig.resizeWidth || - this.webcamVideoElement.height !== this.webcamConfig.resizeHeight)) { - return true; - } - return false; - } - // Cropping and resizing each frame based on config - cropAndResizeFrame(img) { - return tidy(() => { - const expandedImage = expandDims(cast(img, 'float32'), (0)); - let resizedImage; - resizedImage = image.cropAndResize(expandedImage, this.cropBox, this.cropBoxInd, this.cropSize, 'bilinear'); - // Extract image from batch cropping. - const shape = resizedImage.shape; - return reshape(resizedImage, shape.slice(1)); - }); - } - // Capture one frame from the video stream, and extract the value from - // iterator.next() result. - async capture() { - return (await this.next()).value; - } - // Stop the video stream and pause webcam iterator. - stop() { - const tracks = this.stream.getTracks(); - tracks.forEach(track => track.stop()); - try { - this.webcamVideoElement.srcObject = null; - } - catch (error) { - console.log(error); - this.webcamVideoElement.src = null; - } - this.isClosed = true; - } - // Override toArray() function to prevent collecting. - toArray() { - throw new Error('Can not convert infinite video stream to array.'); - } -} - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/** - * Represents a data source readable as a stream of binary data chunks. - * - * Because `Dataset`s can be read repeatedly (via `Dataset.iterator()`), this - * provides a means to repeatedly create streams from the underlying data - * sources. - */ -class DataSource { -} -// TODO(soergel): consider convenience factory functions here -// in combination with chainable source->dataset above, e.g.: -// tf.data.url(...).asCsvDataset().shuffle().batch() - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -class StringIterator extends LazyIterator { - /** - * Splits a string stream on a given separator. - * - * It is assumed that the incoming chunk boundaries have no semantic meaning, - * so conceptually the incoming stream is treated simply as the concatenation - * of its elements. - * - * The outgoing stream provides chunks corresponding to the results of the - * standard string split() operation (even if such a chunk spanned incoming - * chunks). The separators are not included. - * - * A typical usage is to split a text file (represented as a stream with - * arbitrary chunk boundaries) into lines. - * - * @param upstream A readable stream of strings that can be treated as - * concatenated. - * @param separator A character to split on. - */ - split(separator) { - return new SplitIterator(this, separator); - } -} -// ============================================================================ -// The following private classes serve to implement the chainable methods -// on StringIterator. Unfortunately they can't be placed in separate files, due -// to resulting trouble with circular imports. -// ============================================================================ -// We wanted multiple inheritance, e.g. -// class SplitIterator extends QueueIterator, StringIterator -// but the TypeScript mixin approach is a bit hacky, so we take this adapter -// approach instead. -class SplitIterator extends StringIterator { - constructor(upstream, separator) { - super(); - this.upstream = upstream; - this.impl = new SplitIteratorImpl(upstream, separator); - } - summary() { - return this.impl.summary(); - } - async next() { - return this.impl.next(); - } -} -class SplitIteratorImpl extends OneToManyIterator { - constructor(upstream, separator) { - super(); - this.upstream = upstream; - this.separator = separator; - // A partial string at the end of an upstream chunk - this.carryover = ''; - } - summary() { - return `${this.upstream.summary()} -> Split('${this.separator}')`; - } - async pump() { - const chunkResult = await this.upstream.next(); - if (chunkResult.done) { - if (this.carryover === '') { - return false; - } - // Pretend that the pump succeeded in order to emit the small last batch. - // The next pump() call will actually fail. - this.outputQueue.push(this.carryover); - this.carryover = ''; - return true; - } - const lines = chunkResult.value.split(this.separator); - // Note the behavior: " ab ".split(' ') === ['', 'ab', ''] - // Thus the carryover may be '' if the separator falls on a chunk - // boundary; this produces the correct result. - lines[0] = this.carryover + lines[0]; - for (const line of lines.slice(0, -1)) { - this.outputQueue.push(line); - } - this.carryover = lines[lines.length - 1]; - return true; - } -} - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -class ByteChunkIterator extends LazyIterator { - /** - * Decode a stream of UTF8-encoded byte arrays to a stream of strings. - * - * The byte arrays producetd from the ByteChunkIterator on which this is - * called will be interpreted as concatenated. No assumptions are made about - * the boundaries of the incoming chunks, so a multi-byte UTF8 encoding of a - * character may span the boundary between chunks. This naturally happens, - * for instance, when reading fixed-size byte arrays from a file. - */ - decodeUTF8() { - return new Utf8Iterator(this); - } -} -// ============================================================================ -// The following private classes serve to implement the chainable methods -// on ByteChunkIterator. Unfortunately they can't be placed in separate files, -// due to resulting trouble with circular imports. -// ============================================================================ -// We wanted multiple inheritance, e.g. -// class Utf8Iterator extends QueueIterator, StringIterator -// but the TypeScript mixin approach is a bit hacky, so we take this adapter -// approach instead. -class Utf8Iterator extends StringIterator { - constructor(upstream) { - super(); - this.upstream = upstream; - this.impl = new Utf8IteratorImpl(upstream); - } - summary() { - return this.impl.summary(); - } - async next() { - return this.impl.next(); - } -} -/** - * Decode a stream of UTF8-encoded byte arrays to a stream of strings. - * - * This is tricky because the incoming byte array boundaries may disrupt a - * multi-byte UTF8 character. Thus any incomplete character data at the end of - * a chunk must be carried over and prepended to the next chunk before - * decoding. Luckily with native decoder, TextDecoder in browser and - * string_decoder in node, byte array boundaries are handled automatically. - * - * In the context of an input pipeline for machine learning, UTF8 decoding is - * needed to parse text files containing training examples or prediction - * requests (e.g., formatted as CSV or JSON). We cannot use the built-in - * decoding provided by FileReader.readAsText() because here we are in a - * streaming context, which FileReader does not support. - * - * @param upstream A `LazyIterator` of `Uint8Arrays` containing UTF8-encoded - * text, which should be interpreted as concatenated. No assumptions are - * made about the boundaries of the incoming chunks, so a multi-byte UTF8 - * encoding of a character may span the boundary between chunks. This - * naturally happens, for instance, when reading fixed-size byte arrays from a - * file. - */ -class Utf8IteratorImpl extends OneToManyIterator { - constructor(upstream) { - super(); - this.upstream = upstream; - if (env().get('IS_BROWSER')) { - this.decoder = new TextDecoder('utf-8'); - } - else { - // tslint:disable-next-line:no-require-imports - const { StringDecoder } = require('string_decoder'); - this.decoder = new StringDecoder('utf8'); - } - } - summary() { - return `${this.upstream.summary()} -> Utf8`; - } - async pump() { - const chunkResult = await this.upstream.next(); - let chunk; - if (chunkResult.done) { - return false; - } - else { - chunk = chunkResult.value; - } - let text; - if (env().get('IS_BROWSER')) { - text = this.decoder.decode(chunk, { stream: true }); - } - else { - text = this.decoder.write(Buffer.from(chunk.buffer)); - } - this.outputQueue.push(text); - return true; - } -} - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/** - * Provide a stream of chunks from a File, Blob, or Uint8Array. - * @param file The source File, Blob or Uint8Array. - * @param options Optional settings controlling file reading. - * @returns a lazy Iterator of Uint8Arrays containing sequential chunks of the - * input File, Blob or Uint8Array. - */ -class FileChunkIterator extends ByteChunkIterator { - constructor(file, options = {}) { - super(); - this.file = file; - this.options = options; - util.assert((file instanceof Uint8Array) || - (env().get('IS_BROWSER') ? - (file instanceof File || file instanceof Blob) : - false), () => 'FileChunkIterator only supports File, Blob and Uint8Array ' + - 'right now.'); - this.offset = options.offset || 0; - // default 1MB chunk has tolerable perf on large files - this.chunkSize = options.chunkSize || 1024 * 1024; - } - summary() { - return `FileChunks ${this.file}`; - } - async next() { - if (this.offset >= ((this.file instanceof Uint8Array) ? - this.file.byteLength : - this.file.size)) { - return { value: null, done: true }; - } - const chunk = new Promise((resolve, reject) => { - const end = this.offset + this.chunkSize; - if (this.file instanceof Uint8Array) { - // Note if end > this.uint8Array.byteLength, we just get a small last - // chunk. - resolve(new Uint8Array(this.file.slice(this.offset, end))); - } - else { - // This branch assumes that this.file type is File or Blob, which - // means it is in the browser environment. - // TODO(soergel): is this a performance issue? - const fileReader = new FileReader(); - fileReader.onload = (event) => { - let data = fileReader.result; - // Not sure we can trust the return type of - // FileReader.readAsArrayBuffer See e.g. - // https://github.com/node-file-api/FileReader/issues/2 - if (data instanceof ArrayBuffer) { - data = new Uint8Array(data); - } - if (!(data instanceof Uint8Array)) { - return reject(new TypeError('FileReader returned unknown type.')); - } - resolve(data); - }; - fileReader.onabort = (event) => { - return reject(new Error('Aborted')); - }; - fileReader.onerror = (event) => { - return reject(new Error(event.type)); - }; - // TODO(soergel): better handle onabort, onerror - // Note if end > this.file.size, we just get a small last chunk. - const slice = this.file.slice(this.offset, end); - // We can't use readAsText here (even if we know the file is text) - // because the slice boundary may fall within a multi-byte character. - fileReader.readAsArrayBuffer(slice); - } - this.offset = end; - }); - return { value: (await chunk), done: false }; - } -} - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/** - * Provide a stream of chunks from a URL. - * - * Note this class first downloads the entire file into memory before providing - * the first element from the stream. This is because the Fetch API does not - * yet reliably provide a reader stream for the response body. - */ -async function urlChunkIterator(url, options = {}) { - let urlString; - let requestInit; - if ((typeof url) === 'string') { - urlString = url; - } - else { - urlString = url.url; - requestInit = getRequestInitFromRequest(url); - } - const response = await util.fetch(urlString, requestInit); - if (response.ok) { - const uint8Array = new Uint8Array(await response.arrayBuffer()); - return new FileChunkIterator(uint8Array, options); - } - else { - throw new Error(response.statusText); - } -} -// Generate RequestInit from Request to match tf.util.fetch signature. -const getRequestInitFromRequest = (request) => { - const init = { - method: request.method, - headers: request.headers, - body: request.body, - mode: request.mode, - credentials: request.credentials, - cache: request.cache, - redirect: request.redirect, - referrer: request.referrer, - integrity: request.integrity, - }; - return init; -}; - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -// Skip tslint any type check cause this method is aiming to check type of -// input. -// tslint:disable-next-line:no-any -function isLocalPath(source) { - return (typeof source === 'string') && source.substr(0, 7) === 'file://'; -} - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/** - * Represents a file, blob, or Uint8Array readable as a stream of binary data - * chunks. - */ -class FileDataSource extends DataSource { - /** - * Create a `FileDataSource`. - * - * @param input Local file path, or `File`/`Blob`/`Uint8Array` object to - * read. Local file only works in node environment. - * @param options Options passed to the underlying `FileChunkIterator`s, - * such as {chunksize: 1024}. - */ - constructor(input, options = {}) { - super(); - this.input = input; - this.options = options; - } - async iterator() { - if (isLocalPath(this.input) && env().get('IS_NODE')) { - // tslint:disable-next-line:no-require-imports - const fs = require('fs'); - this.input = fs.readFileSync(this.input.substr(7)); - } - // TODO(kangyizhang): Add LocalFileChunkIterator to split local streaming - // with file in browser. - return new FileChunkIterator(this.input, this.options); - } -} - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/* - * Represents a URL readable as a stream of binary data chunks. - */ -class URLDataSource extends DataSource { - /** - * Create a `URLDataSource`. - * - * @param url A source URL string, or a `Request` object. - * @param options Options passed to the underlying `FileChunkIterator`s, - * such as {chunksize: 1024}. - */ - constructor(url, fileOptions = {}) { - super(); - this.url = url; - this.fileOptions = fileOptions; - } - // TODO(soergel): provide appropriate caching options. Currently this - // will download the URL anew for each call to iterator(). Since we have - // to treat the downloaded file as a blob/buffer anyway, we may as well retain - // it-- but that raises GC issues. Also we may want a persistent disk cache. - async iterator() { - if (isLocalPath(this.url)) { - return (new FileDataSource(this.url, this.fileOptions)) - .iterator(); - } - else { - return urlChunkIterator(this.url, this.fileOptions); - } - } -} - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/** - * Create a `CSVDataset` by reading and decoding CSV file(s) from provided URL - * or local path if it's in Node environment. - * - * Note: If isLabel in columnConfigs is `true` for at least one column, the - * element in returned `CSVDataset` will be an object of - * `{xs:features, ys:labels}`: xs is a dict of features key/value pairs, ys - * is a dict of labels key/value pairs. If no column is marked as label, - * returns a dict of features only. - * - * ```js - * const csvUrl = - * 'https://storage.googleapis.com/tfjs-examples/multivariate-linear-regression/data/boston-housing-train.csv'; - * - * async function run() { - * // We want to predict the column "medv", which represents a median value of - * // a home (in $1000s), so we mark it as a label. - * const csvDataset = tf.data.csv( - * csvUrl, { - * columnConfigs: { - * medv: { - * isLabel: true - * } - * } - * }); - * - * // Number of features is the number of column names minus one for the label - * // column. - * const numOfFeatures = (await csvDataset.columnNames()).length - 1; - * - * // Prepare the Dataset for training. - * const flattenedDataset = - * csvDataset - * .map(({xs, ys}) => - * { - * // Convert xs(features) and ys(labels) from object form (keyed by - * // column name) to array form. - * return {xs:Object.values(xs), ys:Object.values(ys)}; - * }) - * .batch(10); - * - * // Define the model. - * const model = tf.sequential(); - * model.add(tf.layers.dense({ - * inputShape: [numOfFeatures], - * units: 1 - * })); - * model.compile({ - * optimizer: tf.train.sgd(0.000001), - * loss: 'meanSquaredError' - * }); - * - * // Fit the model using the prepared Dataset - * return model.fitDataset(flattenedDataset, { - * epochs: 10, - * callbacks: { - * onEpochEnd: async (epoch, logs) => { - * console.log(epoch + ':' + logs.loss); - * } - * } - * }); - * } - * - * await run(); - * ``` - * - * @param source URL or local path to get CSV file. If it's a local path, it - * must have prefix `file://` and it only works in node environment. - * @param csvConfig (Optional) A CSVConfig object that contains configurations - * of reading and decoding from CSV file(s). - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * configParamIndices: [1] - * } - */ -function csv(source, csvConfig = {}) { - return new CSVDataset(new URLDataSource(source), csvConfig); -} -/** - * Create a `Dataset` that produces each element by calling a provided function. - * - * Note that repeated iterations over this `Dataset` may produce different - * results, because the function will be called anew for each element of each - * iteration. - * - * Also, beware that the sequence of calls to this function may be out of order - * in time with respect to the logical order of the Dataset. This is due to the - * asynchronous lazy nature of stream processing, and depends on downstream - * transformations (e.g. .shuffle()). If the provided function is pure, this is - * no problem, but if it is a closure over a mutable state (e.g., a traversal - * pointer), then the order of the produced elements may be scrambled. - * - * ```js - * let i = -1; - * const func = () => - * ++i < 5 ? {value: i, done: false} : {value: null, done: true}; - * const ds = tf.data.func(func); - * await ds.forEachAsync(e => console.log(e)); - * ``` - * - * @param f A function that produces one data element on each call. - */ -function func(f) { - const iter = iteratorFromFunction(f); - return datasetFromIteratorFn(async () => iter); -} -/** - * Create a `Dataset` that produces each element from provided JavaScript - * generator, which is a function* - * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions), - * or a function that returns an - * iterator - * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions). - * - * The returned iterator should have `.next()` function that returns element in - * format of `{value: TensorContainer, done:boolean}`. - * - * Example of creating a dataset from an iterator factory: - * ```js - * function makeIterator() { - * const numElements = 10; - * let index = 0; - * - * const iterator = { - * next: () => { - * let result; - * if (index < numElements) { - * result = {value: index, done: false}; - * index++; - * return result; - * } - * return {value: index, done: true}; - * } - * }; - * return iterator; - * } - * const ds = tf.data.generator(makeIterator); - * await ds.forEachAsync(e => console.log(e)); - * ``` - * - * Example of creating a dataset from a generator: - * ```js - * function* dataGenerator() { - * const numElements = 10; - * let index = 0; - * while (index < numElements) { - * const x = index; - * index++; - * yield x; - * } - * } - * - * const ds = tf.data.generator(dataGenerator); - * await ds.forEachAsync(e => console.log(e)); - * ``` - * - * @param generator A Javascript generator function that returns a JavaScript - * iterator. - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * configParamIndices: [1] - * } - */ -function generator(generator) { - return datasetFromIteratorFn(async () => { - const gen = await generator(); - return iteratorFromFunction(() => gen.next()); - }); -} -/** - * Create an iterator that generate `Tensor`s from webcam video stream. This API - * only works in Browser environment when the device has webcam. - * - * Note: this code snippet only works when the device has a webcam. It will - * request permission to open the webcam when running. - * ```js - * const videoElement = document.createElement('video'); - * videoElement.width = 100; - * videoElement.height = 100; - * const cam = await tf.data.webcam(videoElement); - * const img = await cam.capture(); - * img.print(); - * cam.stop(); - * ``` - * - * @param webcamVideoElement A `HTMLVideoElement` used to play video from - * webcam. If this element is not provided, a hidden `HTMLVideoElement` will - * be created. In that case, `resizeWidth` and `resizeHeight` must be - * provided to set the generated tensor shape. - * @param webcamConfig A `WebcamConfig` object that contains configurations of - * reading and manipulating data from webcam video stream. - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * ignoreCI: true - * } - */ -async function webcam(webcamVideoElement, webcamConfig) { - return WebcamIterator.create(webcamVideoElement, webcamConfig); -} -/** - * Create an iterator that generate frequency-domain spectrogram `Tensor`s from - * microphone audio stream with browser's native FFT. This API only works in - * browser environment when the device has microphone. - * - * Note: this code snippet only works when the device has a microphone. It will - * request permission to open the microphone when running. - * ```js - * const mic = await tf.data.microphone({ - * fftSize: 1024, - * columnTruncateLength: 232, - * numFramesPerSpectrogram: 43, - * sampleRateHz:44100, - * includeSpectrogram: true, - * includeWaveform: true - * }); - * const audioData = await mic.capture(); - * const spectrogramTensor = audioData.spectrogram; - * spectrogramTensor.print(); - * const waveformTensor = audioData.waveform; - * waveformTensor.print(); - * mic.stop(); - * ``` - * - * @param microphoneConfig A `MicrophoneConfig` object that contains - * configurations of reading audio data from microphone. - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * ignoreCI: true - * } - */ -async function microphone(microphoneConfig) { - return MicrophoneIterator.create(microphoneConfig); -} - -/** @license See the LICENSE file. */ -// This code is auto-generated, do not modify this file! -const version = '3.6.0'; - -export { CSVDataset, Dataset, FileDataSource, TextLineDataset, URLDataSource, array, csv, func, generator, microphone, version as version_data, webcam, zip }; -//# sourceMappingURL=tf-data.fesm.js.map diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.fesm.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.fesm.js.map deleted file mode 100644 index 387f370aa..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.fesm.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tf-data.fesm.js","sources":["../node_modules/seedrandom/lib/alea.js","../node_modules/seedrandom/lib/xor128.js","../node_modules/seedrandom/lib/xorwow.js","../node_modules/seedrandom/lib/xorshift7.js","../node_modules/seedrandom/lib/xor4096.js","../node_modules/seedrandom/lib/tychei.js","../node_modules/seedrandom/seedrandom.js","../node_modules/seedrandom/index.js","../src/util/deep_map.ts","../src/util/deep_clone.ts","../src/util/ring_buffer.ts","../src/util/growing_ring_buffer.ts","../src/iterators/lazy_iterator.ts","../src/dataset.ts","../src/datasets/text_line_dataset.ts","../src/datasets/csv_dataset.ts","../src/iterators/microphone_iterator.ts","../src/iterators/webcam_iterator.ts","../src/datasource.ts","../src/iterators/string_iterator.ts","../src/iterators/byte_chunk_iterator.ts","../src/iterators/file_chunk_iterator.ts","../src/iterators/url_chunk_iterator.ts","../src/util/source_util.ts","../src/sources/file_data_source.ts","../src/sources/url_data_source.ts","../src/readers.ts","../src/version.ts"],"sourcesContent":["// A port of an algorithm by Johannes Baagøe , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baagøe \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xorshift7\" algorithm by\n// François Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n","// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n","// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","/*\nCopyright 2014 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\nvar global = this,\n width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\nmath['seed' + rngname] = seedrandom;\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n}\n\n// End anonymous scope, and pass initial values.\n})(\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n","// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by François Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\n\n// tslint:disable:no-any\n\n/**\n * A return value for a mapping function that can be applied via deepMap.\n *\n * If recurse is true, the value should be empty, and iteration will continue\n * into the object or array.\n */\nexport type DeepMapResult = {\n value: any,\n recurse: boolean\n};\n\n/**\n * Apply a mapping function to a nested structure in a recursive manner.\n *\n * The result of the mapping is an object with the same nested structure (i.e.,\n * of arrays and dicts) as the input, except that some subtrees are replaced,\n * according to the results of the mapping function.\n *\n * Mappings are memoized. Thus, if the nested structure contains the same\n * object in multiple positions, the output will contain the same mapped object\n * in those positions. Cycles are not supported, however.\n *\n * @param input: The object to which to apply the mapping function.\n * @param mapFn: A function that expects a single node of the object tree, and\n * returns a `DeepMapResult`. The `DeepMapResult` either provides a\n * replacement value for that node (i.e., replacing the subtree), or indicates\n * that the node should be processed recursively.\n */\nexport function deepMap(input: any, mapFn: (x: any) => DeepMapResult): any|\n any[] {\n return deepMapInternal(input, mapFn);\n}\n\n/**\n * @param seen: A Map of known object mappings (i.e., memoized results of\n * `mapFn()`)\n * @param containedIn: An set containing objects on the reference path currently\n * being processed (used to detect cycles).\n */\nfunction deepMapInternal(\n input: any, mapFn: (x: any) => DeepMapResult,\n seen: Map = new Map(), containedIn: Set<{}> = new Set()): any|\n any[] {\n if (input == null) {\n return null;\n }\n if (containedIn.has(input)) {\n throw new Error('Circular references are not supported.');\n }\n if (seen.has(input)) {\n return seen.get(input);\n }\n const result = mapFn(input);\n\n if (result.recurse && result.value !== null) {\n throw new Error(\n 'A deep map function may not return both a value and recurse=true.');\n }\n\n if (!result.recurse) {\n seen.set(input, result.value);\n return result.value;\n } else if (isIterable(input)) {\n // tslint:disable-next-line:no-any\n const mappedIterable: any|any[] = Array.isArray(input) ? [] : {};\n containedIn.add(input);\n for (const k in input) {\n const child = input[k];\n const childResult = deepMapInternal(child, mapFn, seen, containedIn);\n mappedIterable[k] = childResult;\n }\n containedIn.delete(input);\n return mappedIterable;\n } else {\n throw new Error(`Can't recurse into non-iterable type: ${input}`);\n }\n}\n\n// TODO(soergel, kangyizhang) Reconsider naming of deepZip() to avoid confusion\n// with zip()\n\n/**\n * Zip nested structures together in a recursive manner.\n *\n * This has the effect of transposing or pivoting data, e.g. converting it from\n * a row-major representation to a column-major representation.\n *\n * For example, `deepZip([{a: 1, b: 2}, {a: 3, b: 4}])` returns\n * `{a: [1, 3], b: [2, 4]}`.\n *\n * The inputs should all have the same nested structure (i.e., of arrays and\n * dicts). The result is a single object with the same nested structure, where\n * the leaves are arrays collecting the values of the inputs at that location\n * (or, optionally, the result of a custom function applied to those arrays).\n *\n * @param inputs: An array of the objects to zip together.\n * @param zipFn: (optional) A function that expects an array of elements at a\n * single node of the object tree, and returns a `DeepMapResult`. The\n * `DeepMapResult` either provides a result value for that node (i.e.,\n * representing the subtree), or indicates that the node should be processed\n * recursively. The default zipFn recurses as far as possible and places\n * arrays at the leaves.\n */\nexport function deepZip(\n inputs: any[], zipFn: (xs: any[]) => DeepMapResult = zipToList): any|any[] {\n return deepZipInternal(inputs, zipFn);\n}\n\n/**\n * @param containedIn: An set containing objects on the reference path currently\n * being processed (used to detect cycles).\n */\nfunction deepZipInternal(\n inputs: any[], zipFn: (xs: any[]) => DeepMapResult,\n containedIn: Set<{}> = new Set()): any|any[] {\n // The recursion follows the structure of input 0; it's assumed that all the\n // other inputs have the same structure.\n const input = inputs[0];\n if (containedIn.has(input)) {\n throw new Error('Circular references are not supported.');\n }\n const result = zipFn(inputs);\n\n if (result.recurse && result.value !== null) {\n throw new Error(\n 'A deep zip function may not return both a value and recurse=true.');\n }\n\n if (!result.recurse) {\n return result.value;\n } else if (isIterable(input)) {\n // tslint:disable-next-line:no-any\n const mappedIterable: any|any[] = Array.isArray(input) ? [] : {};\n containedIn.add(input);\n for (const k in input) {\n const children = inputs.map(x => x[k]);\n const childResult = deepZipInternal(children, zipFn, containedIn);\n mappedIterable[k] = childResult;\n }\n containedIn.delete(input);\n return mappedIterable;\n } else {\n throw new Error(`Can't recurse into non-iterable type: ${input}`);\n }\n}\n\n// tslint:disable-next-line:no-any\nexport function zipToList(x: any[]): DeepMapResult {\n if (x === null) {\n return null;\n }\n // TODO(soergel): validate array type?\n\n if (isIterable(x[0])) {\n return {value: null, recurse: true};\n } else {\n return {value: x, recurse: false};\n }\n}\n\n/**\n * A return value for an async map function for use with deepMapAndAwaitAll.\n *\n * If recurse is true, the value should be empty, and iteration will continue\n * into the object or array.\n */\nexport type DeepMapAsyncResult = {\n value: Promise,\n recurse: boolean\n};\n\n/**\n * Apply an async mapping function to a nested structure in a recursive manner.\n *\n * This first creates a nested structure of Promises, and then awaits all of\n * those, resulting in a single Promise for a resolved nested structure.\n *\n * The result of the mapping is an object with the same nested structure (i.e.,\n * of arrays and dicts) as the input, except that some subtrees are replaced,\n * according to the results of the mapping function.\n *\n * Mappings are memoized. Thus, if the nested structure contains the same\n * object in multiple positions, the output will contain the same mapped object\n * in those positions. Cycles are not supported, however.\n *\n * @param input: The object to which to apply the mapping function.\n * @param mapFn: A function that expects a single node of the object tree, and\n * returns a `DeepMapAsyncResult`. The `DeepMapAsyncResult` either provides\n * a `Promise` for a replacement value for that node (i.e., replacing the\n * subtree), or indicates that the node should be processed recursively. Note\n * that the decision whether or not to recurse must be made immediately; only\n * the mapped value may be promised.\n */\nexport async function deepMapAndAwaitAll(\n input: any, mapFn: (x: any) => DeepMapAsyncResult): Promise {\n const seen: Map> = new Map();\n\n // First do a normal deepMap, collecting Promises in 'seen' as a side effect.\n deepMapInternal(input, mapFn, seen);\n\n // Replace the Promises in 'seen' in place.\n // Note TypeScript provides no async map iteration, and regular map iteration\n // is broken too, so sadly we have to do Array.from() to make it work.\n // (There's no advantage to Promise.all(), and that would be tricky anyway.)\n for (const key of Array.from(seen.keys())) {\n const value = seen.get(key);\n if (tf.util.isPromise(value)) {\n const mappedValue = await value;\n seen.set(key, mappedValue);\n }\n }\n\n // Normal deepMap again, this time filling in the resolved values.\n // It's unfortunate that we have to do two passes.\n // TODO(soergel): test performance and think harder about a fast solution.\n const result = deepMapInternal(input, mapFn, seen);\n return result;\n}\n\n/**\n * Determine whether the argument is iterable.\n *\n * @returns true if the argument is an array or any non-Tensor object.\n */\n// tslint:disable-next-line:no-any\nexport function isIterable(obj: any): boolean {\n return obj != null && (!ArrayBuffer.isView(obj)) &&\n (Array.isArray(obj) ||\n (typeof obj === 'object' && !(obj instanceof tf.Tensor)));\n}\n\n/**\n * Determine whether the argument can be converted to Tensor.\n *\n * Tensors, primitives, arrays, and TypedArrays all qualify; anything else does\n * not.\n *\n * @returns true if the argument can be converted to Tensor.\n */\n// tslint:disable-next-line:no-any\nexport function canTensorify(obj: any): boolean {\n return obj == null || isPrimitive(obj) || Array.isArray(obj) ||\n (typeof obj === 'object' && (obj instanceof tf.Tensor)) ||\n tf.util.isTypedArray(obj);\n}\n\n/**\n * Returns true if the given `value` is a primitive type. Otherwise returns\n * false. This is equivalant to node util.isPrimitive\n */\nfunction isPrimitive(value: any): boolean {\n return (\n value === null ||\n (typeof value !== 'object' && typeof value !== 'function'));\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport {deepMap, DeepMapResult, isIterable} from './deep_map';\n\nexport function deepClone(container: T): T {\n return deepMap(container, cloneIfTensor);\n}\n\n// tslint:disable-next-line: no-any\nfunction cloneIfTensor(item: any): DeepMapResult {\n if (item instanceof tf.Tensor) {\n return ({value: item.clone(), recurse: false});\n } else if (isIterable(item)) {\n return {value: null, recurse: true};\n } else {\n return {value: item, recurse: false};\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\n/**\n * A ring buffer, providing O(1) FIFO, LIFO, and related operations.\n */\nexport class RingBuffer {\n // Note we store the indices in the range 0 <= index < 2*capacity.\n // This allows us to distinguish the full from the empty case.\n // See https://www.snellman.net/blog/archive/2016-12-13-ring-buffers/\n protected begin = 0; // inclusive\n protected end = 0; // exclusive\n protected doubledCapacity: number;\n\n protected data: T[];\n\n /**\n * Constructs a `RingBuffer`.\n * @param capacity The number of items that the buffer can accomodate.\n */\n constructor(public capacity: number) {\n if (capacity == null) {\n throw new RangeError('Can\\'t create a ring buffer of unknown capacity.');\n }\n if (capacity < 1) {\n throw new RangeError('Can\\'t create ring buffer of capacity < 1.');\n }\n this.data = new Array(capacity);\n this.doubledCapacity = 2 * capacity;\n }\n\n /**\n * Map any index into the range 0 <= index < 2*capacity.\n */\n protected wrap(index: number) {\n // don't trust % on negative numbers\n while (index < 0) {\n index += this.doubledCapacity;\n }\n return index % this.doubledCapacity;\n }\n\n protected get(index: number) {\n if (index < 0) {\n throw new RangeError('Can\\'t get item at a negative index.');\n }\n return this.data[index % this.capacity];\n }\n\n protected set(index: number, value: T) {\n if (index < 0) {\n throw new RangeError('Can\\'t set item at a negative index.');\n }\n this.data[index % this.capacity] = value;\n }\n\n /**\n * Returns the current number of items in the buffer.\n */\n length(): number {\n let length = this.end - this.begin;\n if (length < 0) {\n length = this.doubledCapacity + length;\n }\n return length;\n }\n\n /**\n * Reports whether the buffer is full.\n * @returns true if the number of items in the buffer equals its capacity, and\n * false otherwise.\n */\n isFull() {\n return this.length() === this.capacity;\n }\n\n /**\n * Reports whether the buffer is empty.\n * @returns true if the number of items in the buffer equals zero, and\n * false otherwise.\n */\n isEmpty() {\n return this.length() === 0;\n }\n\n /**\n * Adds an item to the end of the buffer.\n */\n push(value: T) {\n if (this.isFull()) {\n throw new RangeError('Ring buffer is full.');\n }\n this.set(this.end, value);\n this.end = this.wrap(this.end + 1);\n }\n\n /**\n * Adds many items to the end of the buffer, in order.\n */\n pushAll(values: T[]) {\n for (const value of values) {\n this.push(value);\n }\n }\n\n /**\n * Removes and returns the last item in the buffer.\n */\n pop(): T {\n if (this.isEmpty()) {\n throw new RangeError('Ring buffer is empty.');\n }\n this.end = this.wrap(this.end - 1);\n const result = this.get(this.end);\n this.set(this.end, undefined);\n return result;\n }\n\n /**\n * Adds an item to the beginning of the buffer.\n */\n unshift(value: T) {\n if (this.isFull()) {\n throw new RangeError('Ring buffer is full.');\n }\n this.begin = this.wrap(this.begin - 1);\n this.set(this.begin, value);\n }\n\n /**\n * Removes and returns the first item in the buffer.\n */\n shift(): T {\n if (this.isEmpty()) {\n throw new RangeError('Ring buffer is empty.');\n }\n const result = this.get(this.begin);\n this.set(this.begin, undefined);\n this.begin = this.wrap(this.begin + 1);\n return result;\n }\n\n /**\n * Removes and returns a specific item in the buffer, and moves the last item\n * to the vacated slot. This is useful for implementing a shuffling stream.\n * Note that this operation necessarily scrambles the original order.\n *\n * @param relativeIndex: the index of the item to remove, relative to the\n * first item in the buffer (e.g., hiding the ring nature of the underlying\n * storage).\n */\n shuffleExcise(relativeIndex: number): T {\n if (this.isEmpty()) {\n throw new RangeError('Ring buffer is empty.');\n }\n const index = this.wrap(this.begin + relativeIndex);\n const result = this.get(index);\n this.set(index, this.pop());\n return result;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {RingBuffer} from './ring_buffer';\n\nexport class GrowingRingBuffer extends RingBuffer {\n private static INITIAL_CAPACITY = 32;\n\n /**\n * Constructs a `GrowingRingBuffer`.\n */\n constructor() {\n super(GrowingRingBuffer.INITIAL_CAPACITY);\n }\n\n isFull() {\n return false;\n }\n\n push(value: T) {\n if (super.isFull()) {\n this.expand();\n }\n super.push(value);\n }\n\n unshift(value: T) {\n if (super.isFull()) {\n this.expand();\n }\n super.unshift(value);\n }\n\n /**\n * Doubles the capacity of the buffer.\n */\n private expand() {\n const newCapacity = this.capacity * 2;\n const newData = new Array(newCapacity);\n const len = this.length();\n\n // Rotate the buffer to start at index 0 again, since we can't just\n // allocate more space at the end.\n for (let i = 0; i < len; i++) {\n newData[i] = this.get(this.wrap(this.begin + i));\n }\n\n this.data = newData;\n this.capacity = newCapacity;\n this.doubledCapacity = 2 * this.capacity;\n this.begin = 0;\n this.end = len;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport * as seedrandom from 'seedrandom';\n\nimport {Container} from '../types';\nimport {deepClone} from '../util/deep_clone';\nimport {deepMapAndAwaitAll, DeepMapAsyncResult, DeepMapResult, deepZip, zipToList} from '../util/deep_map';\nimport {GrowingRingBuffer} from '../util/growing_ring_buffer';\nimport {RingBuffer} from '../util/ring_buffer';\n\n/**\n * A nested structure of LazyIterators, used as the input to zip().\n */\nexport type IteratorContainer = Container>;\n\n// Here we implement a simple asynchronous iterator.\n// This lets us avoid using either third-party stream libraries or\n// recent TypeScript language support requiring polyfills.\n\n/**\n * Create a `LazyIterator` from an array of items.\n */\nexport function iteratorFromItems(items: T[]): LazyIterator {\n return new ArrayIterator(items);\n}\n\n/**\n * Create a `LazyIterator` of incrementing integers.\n */\nexport function iteratorFromIncrementing(start: number): LazyIterator {\n let i = start;\n return iteratorFromFunction(() => ({value: i++, done: false}));\n}\n\n/**\n * Create a `LazyIterator` from a function.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const iter = tf.data.iteratorFromFunction(func);\n * await iter.forEachAsync(e => console.log(e));\n * ```\n *\n * @param func A function that produces data on each call.\n */\nexport function iteratorFromFunction(\n func: () =>\n IteratorResult| Promise>): LazyIterator {\n return new FunctionCallIterator(func);\n}\n\n/**\n * Create a `LazyIterator` by concatenating underlying streams, which are\n * themselves provided as a stream.\n *\n * This can also be thought of as a \"stream flatten\" operation.\n *\n * @param baseIterators A stream of streams to be concatenated.\n * @param baseErrorHandler An optional function that can intercept `Error`s\n * raised during a `next()` call on the base stream. This function can decide\n * whether the error should be propagated, whether the error should be\n * ignored, or whether the base stream should be terminated.\n */\nexport function iteratorFromConcatenated(\n baseIterators: LazyIterator>,\n baseErrorHandler?: (e: Error) => boolean): LazyIterator {\n return new ChainedIterator(baseIterators, baseErrorHandler);\n}\n\n/**\n * Create a `LazyIterator` by concatenating streams produced by calling a\n * stream-generating function a given number of times.\n *\n * Since a `LazyIterator` is read-once, it cannot be repeated, but this\n * function can be used to achieve a similar effect:\n *\n * LazyIterator.ofConcatenatedFunction(() => new MyIterator(), 6);\n *\n * @param iteratorFunc: A function that produces a new stream on each call.\n * @param count: The number of times to call the function.\n * @param baseErrorHandler An optional function that can intercept `Error`s\n * raised during a `next()` call on the base stream. This function can decide\n * whether the error should be propagated, whether the error should be\n * ignored, or whether the base stream should be terminated.\n */\nexport function iteratorFromConcatenatedFunction(\n iteratorFunc: () => IteratorResult>, count: number,\n baseErrorHandler?: (e: Error) => boolean): LazyIterator {\n return iteratorFromConcatenated(\n iteratorFromFunction(iteratorFunc).take(count), baseErrorHandler);\n}\n\n/**\n * Create a `LazyIterator` by zipping together an array, dict, or nested\n * structure of `LazyIterator`s (and perhaps additional constants).\n *\n * The underlying streams must provide elements in a consistent order such\n * that they correspond.\n *\n * Typically, the underlying streams should have the same number of\n * elements. If they do not, the behavior is determined by the\n * `mismatchMode` argument.\n *\n * The nested structure of the `iterators` argument determines the\n * structure of elements in the resulting iterator.\n *\n * @param iterators: An array or object containing LazyIterators at the\n * leaves.\n * @param mismatchMode: Determines what to do when one underlying iterator\n * is exhausted before the others. `ZipMismatchMode.FAIL` (the default)\n * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST`\n * causes the zipped iterator to terminate with the furst underlying\n * streams, so elements remaining on the longer streams are ignored.\n * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling\n * in nulls for the exhausted streams, until all streams are exhausted.\n */\nexport function iteratorFromZipped(\n iterators: IteratorContainer,\n mismatchMode: ZipMismatchMode = ZipMismatchMode.FAIL): LazyIterator {\n return new ZipIterator(iterators, mismatchMode);\n}\n\n/**\n * An asynchronous iterator, providing lazy access to a potentially\n * unbounded stream of elements.\n *\n * Iterator can be obtained from a dataset:\n * `const iter = await dataset.iterator();`\n */\nexport abstract class LazyIterator {\n // This class implements AsyncIterator, but we have not yet set the\n // TypeScript --downlevelIteration flag to enable that.\n\n abstract summary(): string;\n\n /**\n * Returns a `Promise` for the next element in the stream.\n *\n * When an item can be provided successfully, the return value is\n * `{value:T, done:false}`.\n *\n * Calling next() on a closed stream returns `{value:null, done:true}`.\n */\n abstract async next(): Promise>;\n\n /**\n * Collect all remaining elements of a bounded stream into an array.\n * Obviously this will succeed only for small streams that fit in memory.\n * Useful for testing.\n *\n * @returns A Promise for an array of stream elements, which will resolve\n * when the stream is exhausted.\n */\n async toArray(): Promise {\n const result: T[] = [];\n let x = await this.next();\n while (!x.done) {\n result.push(x.value);\n x = await this.next();\n }\n return result;\n }\n\n /**\n * Collect all elements of this dataset into an array with prefetching 100\n * elements. This is useful for testing, because the prefetch changes the\n * order in which the Promises are resolved along the processing pipeline.\n * This may help expose bugs where results are dependent on the order of\n * Promise resolution rather than on the logical order of the stream (i.e.,\n * due to hidden mutable state).\n *\n * @returns A Promise for an array of stream elements, which will resolve\n * when the stream is exhausted.\n */\n async toArrayForTest(): Promise {\n const stream = this.prefetch(100);\n const result: T[] = [];\n let x = await stream.next();\n while (!x.done) {\n result.push(x.value);\n x = await stream.next();\n }\n return result;\n }\n\n /**\n * Draw items from the stream until it is exhausted.\n *\n * This can be useful when the stream has side effects but no output. In\n * that case, calling this function guarantees that the stream will be\n * fully processed.\n */\n async resolveFully(): Promise {\n let x = await this.next();\n while (!x.done) {\n x = await this.next();\n }\n }\n\n /**\n * Draw items from the stream until it is exhausted, or a predicate fails.\n *\n * This can be useful when the stream has side effects but no output. In\n * that case, calling this function guarantees that the stream will be\n * fully processed.\n */\n async resolveWhile(predicate: (r: T) => boolean): Promise {\n let x = await this.next();\n let shouldContinue = predicate(x.value);\n while ((!x.done) && shouldContinue) {\n x = await this.next();\n shouldContinue = predicate(x.value);\n }\n }\n\n /**\n * Handles errors thrown on this stream using a provided handler function.\n *\n * @param handler A function that handles any `Error` thrown during a `next()`\n * call and returns true if the stream should continue (dropping the failed\n * call) or false if the stream should quietly terminate. If the handler\n * itself throws (or rethrows) an `Error`, that will be propagated.\n *\n * @returns A `LazyIterator` of elements passed through from upstream,\n * possibly filtering or terminating on upstream `next()` calls that\n * throw an `Error`.\n */\n handleErrors(handler: (error: Error) => boolean): LazyIterator {\n return new ErrorHandlingLazyIterator(this, handler);\n }\n\n // TODO(soergel): Implement reduce() etc.\n\n /**\n * Filters this stream according to `predicate`.\n *\n * @param predicate A function mapping a stream element to a boolean or a\n * `Promise` for one.\n *\n * @returns A `LazyIterator` of elements for which the predicate was true.\n */\n filter(predicate: (value: T) => boolean): LazyIterator {\n return new FilterIterator(this, predicate);\n }\n\n /**\n * Maps this stream through a 1-to-1 transform.\n *\n * @param transform A function mapping a stream element to a transformed\n * element.\n *\n * @returns A `LazyIterator` of transformed elements.\n */\n map(transform: (value: T) => O): LazyIterator {\n return new MapIterator(this, transform);\n }\n\n /**\n * Maps this stream through an async 1-to-1 transform.\n *\n * @param transform A function mapping a stream element to a `Promise` for a\n * transformed stream element.\n *\n * @returns A `LazyIterator` of transformed elements.\n */\n mapAsync(transform: (value: T) => Promise): LazyIterator {\n return new AsyncMapIterator(this, transform);\n }\n\n /**\n * Maps this stream through a 1-to-1 transform, forcing serial execution.\n *\n * @param transform A function mapping a stream element to a transformed\n * element.\n *\n * @returns A `LazyIterator` of transformed elements.\n */\n serialMapAsync(transform: (value: T) => Promise): LazyIterator {\n return new AsyncMapIterator(this, transform).serial();\n }\n\n /**\n * Maps this stream through a 1-to-many transform.\n *\n * @param transform A function mapping a stream element to an array of\n * transformed elements.\n *\n * @returns A `DataStream` of transformed elements.\n */\n flatmap(transform: (value: T) => O[]): LazyIterator {\n return new FlatmapIterator(this, transform);\n }\n\n /**\n * Apply a function to every element of the stream.\n *\n * @param f A function to apply to each stream element.\n */\n async forEachAsync(f: (value: T) => void): Promise {\n return this.map(f).resolveFully();\n }\n\n /**\n * Apply a function to every element of the stream, forcing serial execution.\n *\n * @param f A function to apply to each stream element. Should return 'true'\n * to indicate that the stream should continue, or 'false' to cause it to\n * terminate.\n */\n async serialForEach(f: (value: T) => Promise): Promise {\n return this.serialMapAsync(f).resolveWhile(x => (x === true));\n }\n\n /**\n * Groups elements into batches, represented as arrays of elements.\n *\n * We can think of the elements of this iterator as 'rows' (even if they are\n * nested structures). By the same token, consecutive values for a given\n * key within the elements form a 'column'. This matches the usual sense of\n * 'row' and 'column' when processing tabular data (e.g., parsing a CSV).\n *\n * Thus, \"Row-major\" means that the resulting batch is simply a collection of\n * rows: `[row1, row2, row3, ...]`. This is contrast to the column-major\n * form, which is needed for vectorized computation.\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @returns A `LazyIterator` of batches of elements, represented as arrays\n * of the original element type.\n */\n rowMajorBatch(batchSize: number, smallLastBatch = true): LazyIterator {\n return new RowMajorBatchIterator(this, batchSize, smallLastBatch);\n }\n\n /**\n * Groups elements into batches, represented in column-major form.\n *\n * We can think of the elements of this iterator as 'rows' (even if they are\n * nested structures). By the same token, consecutive values for a given\n * key within the elements form a 'column'. This matches the usual sense of\n * 'row' and 'column' when processing tabular data (e.g., parsing a CSV).\n *\n * Thus, \"column-major\" means that the resulting batch is a (potentially\n * nested) structure representing the columns. Each column entry, then,\n * contains a collection of the values found in that column for a range of\n * input elements. This representation allows for vectorized computation, in\n * contrast to the row-major form.\n *\n * The inputs should all have the same nested structure (i.e., of arrays and\n * dicts). The result is a single object with the same nested structure,\n * where the leaves are arrays collecting the values of the inputs at that\n * location (or, optionally, the result of a custom function applied to those\n * arrays).\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @param zipFn: (optional) A function that expects an array of elements at a\n * single node of the object tree, and returns a `DeepMapResult`. The\n * `DeepMapResult` either provides a result value for that node (i.e.,\n * representing the subtree), or indicates that the node should be processed\n * recursively. The default zipFn recurses as far as possible and places\n * arrays at the leaves.\n * @returns A `LazyIterator` of batches of elements, represented as an object\n * with collections at the leaves.\n */\n columnMajorBatch(\n batchSize: number, smallLastBatch = true,\n // tslint:disable-next-line:no-any\n zipFn: (xs: any[]) => DeepMapResult = zipToList):\n LazyIterator {\n // First collect the desired number of input elements as a row-major batch.\n const rowBatches = this.rowMajorBatch(batchSize, smallLastBatch);\n // Now 'rotate' or 'pivot' the data, collecting all values from each column\n // in the batch (i.e., for each key within the elements) into an array.\n return rowBatches.map(x => deepZip(x, zipFn));\n }\n\n /**\n * Concatenate this `LazyIterator` with another.\n *\n * @param iterator A `LazyIterator` to be concatenated onto this one.\n * @param baseErrorHandler An optional function that can intercept `Error`s\n * raised during a `next()` call on the base stream. This function can\n * decide whether the error should be propagated, whether the error should\n * be ignored, or whether the base stream should be terminated.\n * @returns A `LazyIterator`.\n */\n concatenate(\n iterator: LazyIterator,\n baseErrorHandler?: (e: Error) => boolean): LazyIterator {\n return new ChainedIterator(\n iteratorFromItems([this, iterator]), baseErrorHandler);\n }\n\n /**\n * Limits this stream to return at most `count` items.\n *\n * @param count The maximum number of items to provide from the stream. If\n * a negative or undefined value is given, the entire stream is returned\n * unaltered.\n */\n take(count: number): LazyIterator {\n if (count < 0 || count == null) {\n return this;\n }\n return new TakeIterator(this, count);\n }\n\n /**\n * Skips the first `count` items in this stream.\n *\n * @param count The number of items to skip. If a negative or undefined\n * value is given, the entire stream is returned unaltered.\n */\n skip(count: number): LazyIterator {\n if (count < 0 || count == null) {\n return this;\n }\n return new SkipIterator(this, count);\n }\n\n /**\n * Prefetch the first `bufferSize` items in this stream.\n *\n * Note this prefetches Promises, but makes no guarantees about when those\n * Promises resolve.\n *\n * @param bufferSize: An integer specifying the number of elements to be\n * prefetched.\n */\n prefetch(bufferSize: number): LazyIterator {\n return new PrefetchIterator(this, bufferSize);\n }\n\n // TODO(soergel): deep sharded shuffle, where supported\n\n /**\n * Randomly shuffles the elements of this stream.\n *\n * @param bufferSize: An integer specifying the number of elements from\n * this stream from which the new stream will sample.\n * @param seed: (Optional.) An integer specifying the random seed that\n * will be used to create the distribution.\n */\n shuffle(windowSize: number, seed?: string): LazyIterator {\n return new ShuffleIterator(this, windowSize, seed);\n }\n\n /**\n * Force an iterator to execute serially: each next() call will await the\n * prior one, so that they cannot execute concurrently.\n */\n serial(): LazyIterator {\n return new SerialIterator(this);\n }\n}\n\n// ============================================================================\n// The following private classes serve to implement the chainable methods\n// on LazyIterator. Unfortunately they can't be placed in separate files,\n// due to resulting trouble with circular imports.\n// ============================================================================\n\n// Iterators that just extend LazyIterator directly\n// ============================================================================\n\nclass ArrayIterator extends LazyIterator {\n private trav = 0;\n constructor(protected items: T[]) {\n super();\n }\n\n summary() {\n return `Array of ${this.items.length} items`;\n }\n\n async next(): Promise> {\n if (this.trav >= this.items.length) {\n return {value: null, done: true};\n }\n const item = this.items[this.trav];\n this.trav++;\n return {value: deepClone(item), done: false};\n }\n}\n\nclass FunctionCallIterator extends LazyIterator {\n constructor(\n protected nextFn: () => IteratorResult| Promise>) {\n super();\n }\n\n summary() {\n return `Function call`;\n }\n\n async next(): Promise> {\n try {\n return this.nextFn();\n } catch (e) {\n // Modify the error message but leave the stack trace intact\n e.message =\n `Error thrown while iterating through a dataset: ${e.message}`;\n throw e;\n }\n }\n}\n\nclass SerialIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n constructor(protected upstream: LazyIterator) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> Serial`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n return this.upstream.next();\n }\n}\n\nclass SkipIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n // Local state that should not be clobbered by out-of-order execution.\n count = 0;\n\n constructor(protected upstream: LazyIterator, protected maxCount: number) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> Skip`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n // TODO(soergel): consider tradeoffs of reading in parallel, eg.\n // collecting next() promises in an Array and then waiting for\n // Promise.all() of those. Benefit: pseudo-parallel execution. Drawback:\n // maybe delayed GC.\n while (this.count++ < this.maxCount) {\n const skipped = await this.upstream.next();\n // short-circuit if upstream is already empty\n if (skipped.done) {\n return skipped;\n }\n tf.dispose(skipped.value as {});\n }\n return this.upstream.next();\n }\n}\n\nclass TakeIterator extends LazyIterator {\n count = 0;\n constructor(protected upstream: LazyIterator, protected maxCount: number) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Take`;\n }\n\n async next(): Promise> {\n if (this.count++ >= this.maxCount) {\n return {value: null, done: true};\n }\n return this.upstream.next();\n }\n}\n\n// Note this batch just groups items into row-wise element arrays.\n// Rotating these to a column-wise representation happens only at the dataset\n// level.\nclass RowMajorBatchIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n constructor(\n protected upstream: LazyIterator, protected batchSize: number,\n protected enableSmallLastBatch = true) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> RowMajorBatch`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n const batch: T[] = [];\n while (batch.length < this.batchSize) {\n const item = await this.upstream.next();\n if (item.done) {\n if (this.enableSmallLastBatch && batch.length > 0) {\n return {value: batch, done: false};\n }\n return {value: null, done: true};\n }\n batch.push(item.value);\n }\n return {value: batch, done: false};\n }\n}\n\nclass FilterIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n constructor(\n protected upstream: LazyIterator,\n protected predicate: (value: T) => boolean) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> Filter`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n while (true) {\n const item = await this.upstream.next();\n if (item.done || this.predicate(item.value)) {\n return item;\n }\n tf.dispose(item.value as {});\n }\n }\n}\n\nclass MapIterator extends LazyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected transform: (value: I) => O) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Map`;\n }\n\n async next(): Promise> {\n const item = await this.upstream.next();\n if (item.done) {\n return {value: null, done: true};\n }\n const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {});\n // Careful: the transform may mutate the item in place.\n // That's why we have to remember the input Tensors above, and then\n // below dispose only those that were not passed through to the output.\n // Note too that the transform function is responsible for tidying\n // any intermediate Tensors. Here we are concerned only about the\n // inputs.\n const mapped = this.transform(item.value);\n const outputTensors = tf.tensor_util.getTensorsInContainer(mapped as {});\n\n // TODO(soergel) faster intersection\n // TODO(soergel) move to tf.disposeExcept(in, out)?\n for (const t of inputTensors) {\n if (!tf.tensor_util.isTensorInList(t, outputTensors)) {\n t.dispose();\n }\n }\n return {value: mapped, done: false};\n }\n}\n\nclass ErrorHandlingLazyIterator extends LazyIterator {\n count = 0;\n constructor(\n protected upstream: LazyIterator,\n protected handler: (error: Error) => boolean) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> handleErrors`;\n }\n\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n async serialNext(): Promise> {\n while (true) {\n try {\n return await this.upstream.next();\n } catch (e) {\n if (!this.handler(e)) {\n return {value: null, done: true};\n }\n // If the handler returns true, loop and fetch the next upstream item.\n\n // If the upstream iterator throws an endless stream of errors, and if\n // the handler says to ignore them, then we loop forever here. That is\n // the correct behavior-- it's up to the handler to decide when to stop.\n }\n }\n }\n}\n\nclass AsyncMapIterator extends LazyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected transform: (value: I) => Promise) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> AsyncMap`;\n }\n\n async next(): Promise> {\n const item = await this.upstream.next();\n if (item.done) {\n return {value: null, done: true};\n }\n const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {});\n // Careful: the transform may mutate the item in place.\n // That's why we have to remember the input Tensors above, and then\n // below dispose only those that were not passed through to the output.\n // Note too that the transform function is responsible for tidying\n // any intermediate Tensors. Here we are concerned only about the\n // inputs.\n const mapped = await this.transform(item.value);\n const outputTensors = tf.tensor_util.getTensorsInContainer(mapped as {});\n\n // TODO(soergel) faster intersection\n // TODO(soergel) move to tf.disposeExcept(in, out)?\n for (const t of inputTensors) {\n if (!tf.tensor_util.isTensorInList(t, outputTensors)) {\n t.dispose();\n }\n }\n return {value: mapped, done: false};\n }\n}\n\n// Iterators that maintain a queue of pending items\n// ============================================================================\n\n/**\n * A base class for transforming streams that operate by maintaining an\n * output queue of elements that are ready to return via next(). This is\n * commonly required when the transformation is 1-to-many: A call to next()\n * may trigger a call to the underlying stream, which will produce many\n * mapped elements of this stream-- of which we need to return only one, so\n * we have to queue the rest.\n */\nexport abstract class OneToManyIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n // Local state that should not be clobbered by out-of-order execution.\n protected outputQueue: RingBuffer;\n\n constructor() {\n super();\n this.outputQueue = new GrowingRingBuffer();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n /**\n * Read one or more chunks from upstream and process them, possibly\n * reading or writing a carryover, and adding processed items to the\n * output queue. Note it's possible that no items are added to the queue\n * on a given pump() call, even if the upstream stream is not closed\n * (e.g., because items are filtered).\n *\n * @return `true` if any action was taken, i.e. fetching items from the\n * upstream source OR adding items to the output queue. `false` if the\n * upstream source is exhausted AND nothing was added to the queue\n * (i.e., any remaining carryover).\n */\n protected abstract async pump(): Promise;\n\n async serialNext(): Promise> {\n // Fetch so that the queue contains at least one item if possible.\n // If the upstream source is exhausted, AND there are no items left in\n // the output queue, then this stream is also exhausted.\n while (this.outputQueue.length() === 0) {\n // TODO(soergel): consider parallel reads.\n if (!await this.pump()) {\n return {value: null, done: true};\n }\n }\n return {value: this.outputQueue.shift(), done: false};\n }\n}\nclass FlatmapIterator extends OneToManyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected transform: (value: I) => O[]) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Flatmap`;\n }\n\n async pump(): Promise {\n const item = await this.upstream.next();\n if (item.done) {\n return false;\n }\n const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {});\n // Careful: the transform may mutate the item in place.\n // that's why we have to remember the input Tensors above, and then\n // below dispose only those that were not passed through to the output.\n // Note too that the transform function is responsible for tidying any\n // intermediate Tensors. Here we are concerned only about the inputs.\n const mappedArray = this.transform(item.value);\n const outputTensors =\n tf.tensor_util.getTensorsInContainer(mappedArray as {});\n this.outputQueue.pushAll(mappedArray);\n\n // TODO(soergel) faster intersection, and deduplicate outputTensors\n // TODO(soergel) move to tf.disposeExcept(in, out)?\n for (const t of inputTensors) {\n if (!tf.tensor_util.isTensorInList(t, outputTensors)) {\n t.dispose();\n }\n }\n\n return true;\n }\n}\n\n/**\n * Provides a `LazyIterator` that concatenates a stream of underlying\n * streams.\n *\n * Doing this in a concurrency-safe way requires some trickery. In\n * particular, we want this stream to return the elements from the\n * underlying streams in the correct order according to when next() was\n * called, even if the resulting Promises resolve in a different order.\n */\nexport class ChainedIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise> = null;\n\n // Local state that should not be clobbered by out-of-order execution.\n private iterator: LazyIterator = null;\n private moreIterators: LazyIterator>;\n\n constructor(\n iterators: LazyIterator>,\n private readonly baseErrorHandler?: (e: Error) => boolean) {\n super();\n this.moreIterators = iterators;\n }\n\n summary() {\n const upstreamSummaries = 'TODO: fill in upstream of chained summaries';\n return `${upstreamSummaries} -> Chained`;\n }\n\n async next(): Promise> {\n this.lastRead = this.readFromChain(this.lastRead);\n return this.lastRead;\n }\n\n private async readFromChain(lastRead: Promise>):\n Promise> {\n // Must await on the previous read since the previous read may have advanced\n // the stream of streams, from which we need to read.\n // This is unfortunate since we can't parallelize reads. Which means\n // prefetching of chained streams is a no-op.\n // One solution is to prefetch immediately upstream of this.\n await lastRead;\n if (this.iterator == null) {\n const iteratorResult = await this.moreIterators.next();\n if (iteratorResult.done) {\n // No more streams to stream from.\n return {value: null, done: true};\n }\n this.iterator = iteratorResult.value;\n if (this.baseErrorHandler != null) {\n this.iterator = this.iterator.handleErrors(this.baseErrorHandler);\n }\n }\n const itemResult = await this.iterator.next();\n if (itemResult.done) {\n this.iterator = null;\n return this.readFromChain(lastRead);\n }\n return itemResult;\n }\n}\n\nexport enum ZipMismatchMode {\n FAIL, // require zipped streams to have the same length\n SHORTEST, // terminate zip when the first stream is exhausted\n LONGEST // use nulls for exhausted streams; use up the longest stream.\n}\n\n/**\n * Provides a `LazyIterator` that zips together an array, dict, or nested\n * structure of `LazyIterator`s (and perhaps additional constants).\n *\n * The underlying streams must provide elements in a consistent order such\n * that they correspond.\n *\n * Typically, the underlying streams should have the same number of\n * elements. If they do not, the behavior is determined by the\n * `mismatchMode` argument.\n *\n * The nested structure of the `iterators` argument determines the\n * structure of elements in the resulting iterator.\n *\n * Doing this in a concurrency-safe way requires some trickery. In\n * particular, we want this stream to return the elements from the\n * underlying streams in the correct order according to when next() was\n * called, even if the resulting Promises resolve in a different order.\n *\n * @param iterators: An array or object containing LazyIterators at the\n * leaves.\n * @param mismatchMode: Determines what to do when one underlying iterator\n * is exhausted before the others. `ZipMismatchMode.FAIL` (the default)\n * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST`\n * causes the zipped iterator to terminate with the furst underlying\n * streams, so elements remaining on the longer streams are ignored.\n * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling\n * in nulls for the exhausted streams, until all streams are exhausted.\n */\nclass ZipIterator extends LazyIterator {\n private count = 0;\n private currentPromise: Promise> = null;\n\n constructor(\n protected readonly iterators: IteratorContainer,\n protected readonly mismatchMode: ZipMismatchMode = ZipMismatchMode.FAIL) {\n super();\n }\n\n summary() {\n const upstreamSummaries = 'TODO: fill in upstream of zip summaries';\n return `{${upstreamSummaries}} -> Zip`;\n }\n\n private async nextState(afterState: Promise>):\n Promise> {\n // This chaining ensures that the underlying next() are not even called\n // before the previous ones have resolved.\n await afterState;\n\n // Collect underlying iterator \"done\" signals as a side effect in\n // getNext()\n let numIterators = 0;\n let iteratorsDone = 0;\n\n function getNext(container: IteratorContainer): DeepMapAsyncResult {\n if (container instanceof LazyIterator) {\n const result = container.next();\n return {\n value: result.then(x => {\n numIterators++;\n if (x.done) {\n iteratorsDone++;\n }\n return x.value;\n }),\n recurse: false\n };\n } else {\n return {value: null, recurse: true};\n }\n }\n\n const mapped: O = await deepMapAndAwaitAll(this.iterators, getNext);\n\n if (numIterators === iteratorsDone) {\n // The streams have all ended.\n return {value: null, done: true};\n }\n if (iteratorsDone > 0) {\n switch (this.mismatchMode) {\n case ZipMismatchMode.FAIL:\n throw new Error(\n 'Zipped streams should have the same length. ' +\n `Mismatched at element ${this.count}.`);\n case ZipMismatchMode.SHORTEST:\n return {value: null, done: true};\n case ZipMismatchMode.LONGEST:\n default:\n // Continue. The exhausted streams already produced value: null.\n }\n }\n\n this.count++;\n return {value: mapped, done: false};\n }\n\n async next(): Promise> {\n this.currentPromise = this.nextState(this.currentPromise);\n return this.currentPromise;\n }\n}\n\n// Iterators that maintain a ring buffer of pending promises\n// ============================================================================\n\n/**\n * A stream that prefetches a given number of items from an upstream source,\n * returning them in FIFO order.\n *\n * Note this prefetches Promises, but makes no guarantees about when those\n * Promises resolve.\n */\nexport class PrefetchIterator extends LazyIterator {\n protected buffer: RingBuffer>>;\n\n constructor(\n protected upstream: LazyIterator, protected bufferSize: number) {\n super();\n this.buffer = new RingBuffer>>(bufferSize);\n }\n\n summary() {\n return `${this.upstream.summary()} -> Prefetch`;\n }\n\n /**\n * Refill the prefetch buffer. Returns only after the buffer is full, or\n * the upstream source is exhausted.\n */\n protected refill() {\n while (!this.buffer.isFull()) {\n const v = this.upstream.next();\n this.buffer.push(v);\n }\n }\n\n next(): Promise> {\n this.refill();\n // This shift will never throw an error because the buffer is always\n // full after a refill. If the stream is exhausted, the buffer will be\n // full of Promises that will resolve to the end-of-stream signal.\n return this.buffer.shift();\n }\n}\n\n/**\n * A stream that performs a sliding-window random shuffle on an upstream\n * source. This is like a `PrefetchIterator` except that the items are\n * returned in randomized order. Mixing naturally improves as the buffer\n * size increases.\n */\nexport class ShuffleIterator extends PrefetchIterator {\n private readonly random: seedrandom.prng;\n\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n // Local state that should not be clobbered by out-of-order execution.\n private upstreamExhausted = false;\n\n constructor(\n protected upstream: LazyIterator, protected windowSize: number,\n seed?: string) {\n super(upstream, windowSize);\n this.random = seedrandom.alea(seed || tf.util.now().toString());\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private randomInt(max: number) {\n return Math.floor(this.random() * max);\n }\n\n protected chooseIndex(): number {\n return this.randomInt(this.buffer.length());\n }\n\n async serialNext(): Promise> {\n // TODO(soergel): consider performance\n if (!this.upstreamExhausted) {\n this.refill();\n }\n while (!this.buffer.isEmpty()) {\n const chosenIndex = this.chooseIndex();\n const result = await this.buffer.shuffleExcise(chosenIndex);\n if (result.done) {\n this.upstreamExhausted = true;\n } else {\n this.refill();\n return result;\n }\n }\n return {value: null, done: true};\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport {TensorContainer, TensorLike} from '@tensorflow/tfjs-core';\nimport * as seedrandom from 'seedrandom';\n\nimport {iteratorFromConcatenated, iteratorFromFunction, iteratorFromItems, iteratorFromZipped, LazyIterator, ZipMismatchMode} from './iterators/lazy_iterator';\nimport {Container} from './types';\nimport {canTensorify, deepMapAndAwaitAll, DeepMapResult, isIterable} from './util/deep_map';\n\n/**\n * A nested structure of Datasets, used as the input to zip().\n */\nexport type DatasetContainer = Container>;\n\n// TODO(soergel): consider vectorized operations within the pipeline.\n\n/**\n * Represents a potentially large list of independent data elements (typically\n * 'samples' or 'examples').\n *\n * A 'data example' may be a primitive, an array, a map from string keys to\n * values, or any nested structure of these.\n *\n * A `Dataset` represents an ordered collection of elements, together with a\n * chain of transformations to be performed on those elements. Each\n * transformation is a method of `Dataset` that returns another `Dataset`, so\n * these may be chained, e.g.\n * `const processedDataset = rawDataset.filter(...).map(...).batch(...)`.\n *\n * Data loading and transformation is done in a lazy, streaming fashion. The\n * dataset may be iterated over multiple times; each iteration starts the data\n * loading anew and recapitulates the transformations.\n *\n * A `Dataset` is typically processed as a stream of unbatched examples --i.e.,\n * its transformations are applied one example at a time. Batching produces a\n * new `Dataset` where each element is a batch. Batching should usually come\n * last in a pipeline, because data transformations are easier to express on a\n * per-example basis than on a per-batch basis.\n *\n * The following code examples are calling `await dataset.forEachAsync(...)` to\n * iterate once over the entire dataset in order to print out the data.\n *\n * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'}\n */\nexport abstract class Dataset {\n /*\n * Provide a new stream of elements. Note this will also start new streams\n * from any underlying `Dataset`s.\n *\n * CAUTION: Any Tensors contained within the elements returned from\n * this stream *must* be manually disposed to avoid a GPU memory leak.\n * The tf.tidy() approach cannot be used in an asynchronous context.\n */\n abstract async iterator(): Promise>;\n\n readonly size: number = null;\n\n // TODO(soergel): Make Datasets report whether repeated iterator() calls\n // produce the same result (e.g., reading from a file) or different results\n // (e.g., from the webcam). Currently we don't make this distinction but it\n // could be important for the user to know.\n // abstract isDeterministic(): boolean;\n\n /**\n * Groups elements into batches.\n *\n * It is assumed that each of the incoming dataset elements has the same\n * structure-- i.e. the same set of keys at each location in an object\n * hierarchy. For each key, the resulting `Dataset` provides a batched\n * element collecting all of the incoming values for that key.\n *\n * * Incoming primitives are grouped into a 1-D Tensor.\n * * Incoming Tensors are grouped into a new Tensor where the 0'th axis is\n * the batch dimension.\n * * Incoming arrays are converted to Tensor and then batched.\n * * A nested array is interpreted as an n-D Tensor, so the batched result\n * has n+1 dimensions.\n * * An array that cannot be converted to Tensor produces an error.\n *\n * If an array should not be batched as a unit, it should first be converted\n * to an object with integer keys.\n *\n * Here are a few examples:\n *\n * Batch a dataset of numbers:\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8]).batch(4);\n * await a.forEachAsync(e => e.print());\n * ```\n *\n * Batch a dataset of arrays:\n * ```js\n * const b = tf.data.array([[1], [2], [3], [4], [5], [6], [7], [8]]).batch(4);\n * await b.forEachAsync(e => e.print());\n * ```\n *\n * Batch a dataset of objects:\n * ```js\n * const c = tf.data.array([{a: 1, b: 11}, {a: 2, b: 12}, {a: 3, b: 13},\n * {a: 4, b: 14}, {a: 5, b: 15}, {a: 6, b: 16}, {a: 7, b: 17},\n * {a: 8, b: 18}]).batch(4);\n * await c.forEachAsync(e => {\n * console.log('{');\n * for(var key in e) {\n * console.log(key+':');\n * e[key].print();\n * }\n * console.log('}');\n * })\n * ```\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @returns A `Dataset`, from which a stream of batches can be obtained.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n batch(batchSize: number, smallLastBatch = true): Dataset {\n const base = this;\n tf.util.assert(\n batchSize > 0, () => `batchSize needs to be positive, but it is\n ${batchSize}`);\n let size;\n if (this.size === Infinity || this.size == null) {\n // If the size of this dataset is infinity or null, the new size keeps the\n // same.\n size = this.size;\n } else if (smallLastBatch) {\n // If the size of this dataset is known and include small last batch, the\n // new size is full batch count plus last batch.\n size = Math.ceil(this.size / batchSize);\n } else {\n // If the size of this dataset is known and not include small last batch,\n // the new size is full batch count.\n size = Math.floor(this.size / batchSize);\n }\n return datasetFromIteratorFn(async () => {\n return (await base.iterator())\n .columnMajorBatch(batchSize, smallLastBatch, deepBatchConcat);\n }, size);\n }\n\n /**\n * Concatenates this `Dataset` with another.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]);\n * const b = tf.data.array([4, 5, 6]);\n * const c = a.concatenate(b);\n * await c.forEachAsync(e => console.log(e));\n * ```\n *\n * @param dataset A `Dataset` to be concatenated onto this one.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n concatenate(dataset: Dataset): Dataset {\n const base = this;\n let size;\n if (this.size === Infinity || dataset.size === Infinity) {\n // If the size of any of these two dataset is infinity, new size is\n // infinity.\n size = Infinity;\n } else if (this.size != null && dataset.size != null) {\n // If the size of both datasets are known and not infinity, new size is\n // sum the size of these two datasets.\n size = this.size + dataset.size;\n } else {\n // If neither of these two datasets has infinite size and any of these two\n // datasets' size is null, the new size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () =>\n (await base.iterator()).concatenate(await dataset.iterator()),\n size);\n }\n\n /**\n * Filters this dataset according to `predicate`.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])\n * .filter(x => x%2 === 0);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param predicate A function mapping a dataset element to a boolean or a\n * `Promise` for one.\n *\n * @returns A `Dataset` of elements for which the predicate was true.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n filter(predicate: (value: T) => boolean): Dataset {\n const base = this;\n let size;\n if (this.size === Infinity) {\n // If the size of this dataset is infinity, new size is infinity\n size = Infinity;\n } else {\n // If this dataset has limited elements, new size is null because it might\n // exhausted randomly.\n size = null;\n }\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).filter(x => tf.tidy(() => predicate(x)));\n }, size);\n }\n\n /**\n * Apply a function to every element of the dataset.\n *\n * After the function is applied to a dataset element, any Tensors contained\n * within that element are disposed.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param f A function to apply to each dataset element.\n * @returns A `Promise` that resolves after all elements have been processed.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async forEachAsync(f: (input: T) => void): Promise {\n return (await this.iterator()).forEachAsync(f);\n }\n\n /**\n * Maps this dataset through a 1-to-1 transform.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]).map(x => x*x);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param transform A function mapping a dataset element to a transformed\n * dataset element.\n *\n * @returns A `Dataset` of transformed elements.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n map(transform: (value: T) => O): Dataset {\n const base = this;\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).map(x => tf.tidy(() => transform(x)));\n }, this.size);\n }\n\n /**\n * Maps this dataset through an async 1-to-1 transform.\n *\n * ```js\n * const a =\n * tf.data.array([1, 2, 3]).mapAsync(x => new Promise(function(resolve){\n * setTimeout(() => {\n * resolve(x * x);\n * }, Math.random()*1000 + 500);\n * }));\n * console.log(await a.toArray());\n * ```\n *\n * @param transform A function mapping a dataset element to a `Promise` for a\n * transformed dataset element. This transform is responsible for disposing\n * any intermediate `Tensor`s, i.e. by wrapping its computation in\n * `tf.tidy()`; that cannot be automated here (as it is in the synchronous\n * `map()` case).\n *\n * @returns A `Dataset` of transformed elements.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n mapAsync(transform: (value: T) => Promise):\n Dataset {\n const base = this;\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).mapAsync(transform);\n }, this.size);\n }\n\n /**\n * Creates a `Dataset` that prefetches elements from this dataset.\n *\n * @param bufferSize: An integer specifying the number of elements to be\n * prefetched.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n prefetch(bufferSize: number): Dataset {\n if (bufferSize == null) {\n throw new RangeError(\n '`Dataset.prefetch()` requires bufferSize to be specified.');\n }\n\n const base = this;\n return datasetFromIteratorFn(\n async () => (await base.iterator()).prefetch(bufferSize), this.size);\n }\n\n /**\n * Repeats this dataset `count` times.\n *\n * NOTE: If this dataset is a function of global state (e.g. a random number\n * generator), then different repetitions may produce different elements.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]).repeat(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: (Optional) An integer, representing the number of times\n * the dataset should be repeated. The default behavior (if `count` is\n * `undefined` or negative) is for the dataset be repeated indefinitely.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n repeat(count?: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && count > 0) {\n // If this dataset has size and count is positive, new size is current\n // size multiply count. This also covers the case that current size is\n // infinity.\n size = this.size * count;\n } else if (count === 0) {\n // If count is 0, new size is 0.\n size = 0;\n } else if (this.size != null && (count === undefined || count < 0)) {\n // If this dataset has size and count is undefined or negative, the\n // dataset will be repeated indefinitely and new size is infinity.\n size = Infinity;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(async () => {\n const iteratorIterator = iteratorFromFunction(\n async () => ({value: await base.iterator(), done: false}));\n return iteratorFromConcatenated(iteratorIterator.take(count));\n }, size);\n }\n\n /**\n * Creates a `Dataset` that skips `count` initial elements from this dataset.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).skip(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: The number of elements of this dataset that should be skipped\n * to form the new dataset. If `count` is greater than the size of this\n * dataset, the new dataset will contain no elements. If `count`\n * is `undefined` or negative, skips the entire dataset.\n *\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n skip(count: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && count >= 0 && this.size >= count) {\n // If the size of this dataset is greater than count, the new dataset's\n // size is current size minus skipped size.This also covers the case that\n // current size is infinity.\n size = this.size - count;\n } else if (\n this.size != null &&\n (this.size < count || count === undefined || count < 0)) {\n // If the size of this dataset is smaller than count, or count is\n // undefined or negative, skips the entire dataset and the new size is 0.\n size = 0;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () => (await base.iterator()).skip(count), size);\n }\n\n // TODO(soergel): deep sharded shuffle, where supported\n\n static readonly MAX_BUFFER_SIZE = 10000;\n\n /**\n * Pseudorandomly shuffles the elements of this dataset. This is done in a\n * streaming manner, by sampling from a given number of prefetched elements.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).shuffle(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param bufferSize: An integer specifying the number of elements from this\n * dataset from which the new dataset will sample.\n * @param seed: (Optional) An integer specifying the random seed that will\n * be used to create the distribution.\n * @param reshuffleEachIteration: (Optional) A boolean, which if true\n * indicates that the dataset should be pseudorandomly reshuffled each time\n * it is iterated over. If false, elements will be returned in the same\n * shuffled order on each iteration. (Defaults to `true`.)\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n shuffle(bufferSize: number, seed?: string, reshuffleEachIteration = true):\n Dataset {\n if (bufferSize == null || bufferSize < 0) {\n if (this.size == null) {\n throw new RangeError(\n '`Dataset.shuffle()` requires bufferSize to be specified.');\n } else {\n throw new RangeError(\n '`Dataset.shuffle()` requires bufferSize to be specified. ' +\n 'If your data fits in main memory (for regular JS objects), ' +\n 'and/or GPU memory (for `tf.Tensor`s), consider setting ' +\n `bufferSize to the dataset size (${this.size} elements)`);\n }\n }\n const base = this;\n const random = seedrandom.alea(seed || tf.util.now().toString());\n return datasetFromIteratorFn(async () => {\n let seed2 = random.int32();\n if (reshuffleEachIteration) {\n seed2 += random.int32();\n }\n return (await base.iterator()).shuffle(bufferSize, seed2.toString());\n }, this.size);\n }\n\n /**\n * Creates a `Dataset` with at most `count` initial elements from this\n * dataset.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).take(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: The number of elements of this dataset that should be taken\n * to form the new dataset. If `count` is `undefined` or negative, or if\n * `count` is greater than the size of this dataset, the new dataset will\n * contain all elements of this dataset.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n take(count: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && this.size > count) {\n // If the size of this dataset is greater than count, the new dataset's\n // size is count.\n size = count;\n } else if (this.size != null && this.size <= count) {\n // If the size of this dataset is equal or smaller than count, the new\n // dataset's size is the size of this dataset.\n size = this.size;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () => (await base.iterator()).take(count), size);\n }\n\n /**\n * Collect all elements of this dataset into an array.\n *\n * Obviously this will succeed only for small datasets that fit in memory.\n * Useful for testing and generally should be avoided if possible.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]);\n * console.log(await a.toArray());\n * ```\n *\n * @returns A Promise for an array of elements, which will resolve\n * when a new stream has been obtained and fully consumed.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async toArray() {\n if (this.size === Infinity) {\n throw new Error('Can not convert infinite data stream to array.');\n }\n return (await this.iterator()).toArray();\n }\n\n /**\n * Collect all elements of this dataset into an array with prefetching 100\n * elements. This is useful for testing, because the prefetch changes the\n * order in which the Promises are resolved along the processing pipeline.\n * This may help expose bugs where results are dependent on the order of\n * Promise resolution rather than on the logical order of the stream (i.e.,\n * due to hidden mutable state).\n *\n * @returns A Promise for an array of elements, which will resolve\n * when a new stream has been obtained and fully consumed.\n */\n async toArrayForTest() {\n if (this.size === Infinity) {\n throw new Error('Can not convert infinite data stream to array.');\n }\n return (await this.iterator()).toArrayForTest();\n }\n}\n\n/**\n * Create a `Dataset` defined by a provided iterator() function.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const iter = tf.data.iteratorFromFunction(func);\n * const ds = tf.data.datasetFromIteratorFn(iter);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n */\nexport function datasetFromIteratorFn(\n iteratorFn: () => Promise>,\n size: number = null): Dataset {\n return new class extends Dataset {\n size = size;\n\n /*\n * Provide a new stream of elements. Note this will also start new streams\n * from any underlying `Dataset`s.\n */\n async iterator(): Promise> {\n return iteratorFn();\n }\n }\n ();\n}\n\n/**\n * Create a `Dataset` from an array of elements.\n *\n * Create a Dataset from an array of objects:\n * ```js\n * const a = tf.data.array([{'item': 1}, {'item': 2}, {'item': 3}]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * Create a Dataset from an array of numbers:\n * ```js\n * const a = tf.data.array([4, 5, 6]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n * @param items An array of elements that will be parsed as items in a dataset.\n *\n * @doc {heading: 'Data', subheading: 'Creation', namespace: 'data'}\n */\nexport function array(items: T[]): Dataset {\n return datasetFromIteratorFn(\n async () => iteratorFromItems(items), items.length);\n}\n\n/**\n * Create a `Dataset` by zipping together an array, dict, or nested\n * structure of `Dataset`s (and perhaps additional constants).\n * The underlying datasets must provide elements in a consistent order such that\n * they correspond.\n *\n * The number of elements in the resulting dataset is the same as the size of\n * the smallest dataset in datasets.\n *\n * The nested structure of the `datasets` argument determines the\n * structure of elements in the resulting iterator.\n *\n * Note this means that, given an array of two datasets that produce dict\n * elements, the result is a dataset that produces elements that are arrays\n * of two dicts:\n *\n * Zip an array of datasets:\n * ```js\n * console.log('Zip two datasets of objects:');\n * const ds1 = tf.data.array([{a: 1}, {a: 2}, {a: 3}]);\n * const ds2 = tf.data.array([{b: 4}, {b: 5}, {b: 6}]);\n * const ds3 = tf.data.zip([ds1, ds2]);\n * await ds3.forEachAsync(e => console.log(JSON.stringify(e)));\n *\n * // If the goal is to merge the dicts in order to produce elements like\n * // {a: ..., b: ...}, this requires a second step such as:\n * console.log('Merge the objects:');\n * const ds4 = ds3.map(x => {return {a: x[0].a, b: x[1].b}});\n * await ds4.forEachAsync(e => console.log(e));\n * ```\n *\n * Zip a dict of datasets:\n * ```js\n * const a = tf.data.array([{a: 1}, {a: 2}, {a: 3}]);\n * const b = tf.data.array([{b: 4}, {b: 5}, {b: 6}]);\n * const c = tf.data.zip({c: a, d: b});\n * await c.forEachAsync(e => console.log(JSON.stringify(e)));\n * ```\n *\n * @doc {heading: 'Data', subheading: 'Operations', namespace: 'data'}\n */\nexport function zip(datasets: DatasetContainer):\n Dataset {\n // manually type-check the argument for JS users\n if (!isIterable(datasets)) {\n throw new Error('The argument to zip() must be an object or array.');\n }\n let size;\n if (Array.isArray(datasets)) {\n for (let i = 0; i < datasets.length; i++) {\n size = size == null ? (datasets[i] as Dataset).size :\n Math.min(size, (datasets[i] as Dataset).size);\n }\n } else if (datasets instanceof Object) {\n for (const ds in datasets) {\n size = size == null ? (datasets[ds] as Dataset).size :\n Math.min(size, (datasets[ds] as Dataset).size);\n }\n }\n return datasetFromIteratorFn(async () => {\n const streams = await deepMapAndAwaitAll(datasets, d => {\n if (d instanceof Dataset) {\n return {value: d.iterator(), recurse: false};\n } else if (isIterable(d)) {\n return {value: null, recurse: true};\n } else {\n throw new Error(\n 'Leaves of the structure passed to zip() must be Datasets, ' +\n 'not primitives.');\n }\n });\n return iteratorFromZipped(streams, ZipMismatchMode.SHORTEST);\n }, size);\n}\n\n/**\n * A zip function for use with deepZip, passed via the columnMajorBatch call.\n *\n * Accepts an array of identically-structured nested elements and either batches\n * them (if they are primitives, numeric arrays, or Tensors) or requests\n * recursion (if not).\n */\n// tslint:disable-next-line:no-any\nfunction deepBatchConcat(rows: any[]): DeepMapResult {\n if (rows === null) {\n return null;\n }\n\n // use the first item to decide whether to recurse or batch here.\n const exampleRow = rows[0];\n\n if (canTensorify(exampleRow)) {\n // rows is an array of primitives, Tensors, or arrays. Batch them.\n const value = batchConcat(rows);\n return {value, recurse: false};\n }\n\n // the example row is an object, so recurse into it.\n return {value: null, recurse: true};\n}\n\n/**\n * Assembles a list of same-shaped numbers, number arrays, or Tensors\n * into a single new Tensor where axis 0 is the batch dimension.\n */\nfunction batchConcat(arrays: T[]):\n tf.Tensor {\n if (arrays.length === 0) {\n // We can't return an empty Tensor because we don't know the element shape.\n throw new Error('Can\\'t make a batch of zero elements.');\n }\n\n if (arrays[0] instanceof tf.Tensor) {\n // Input is an array of Tensors\n return tf.stack(arrays as tf.Tensor[]);\n } else {\n // Input is a possibly-nested array of numbers.\n return tf.tensor(arrays as TensorLike);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {Dataset} from '../dataset';\nimport {DataSource} from '../datasource';\nimport {LazyIterator} from '../iterators/lazy_iterator';\n\n/**\n * Represents a potentially large collection of text lines.\n *\n * The results are not batched.\n */\nexport class TextLineDataset extends Dataset {\n /**\n * Create a `TextLineDataset`.\n *\n * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream.\n */\n constructor(protected readonly input: DataSource) {\n super();\n }\n\n async iterator(): Promise> {\n const inputIterator = await this.input.iterator();\n const utf8Iterator = inputIterator.decodeUTF8();\n const lineIterator = utf8Iterator.split('\\n').map(line => {\n // Windows/DOS format text file has extra line breaker at the end of line.\n if (line.endsWith('\\r')) {\n line = line.slice(0, -1);\n }\n return line;\n });\n return lineIterator;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {TensorContainer, util} from '@tensorflow/tfjs-core';\nimport {Dataset} from '../dataset';\nimport {DataSource} from '../datasource';\nimport {LazyIterator} from '../iterators/lazy_iterator';\nimport {ColumnConfig, CSVConfig} from '../types';\nimport {TextLineDataset} from './text_line_dataset';\n\nconst CODE_QUOTE = '\"';\nconst STATE_OUT = Symbol('out');\nconst STATE_FIELD = Symbol('field');\nconst STATE_QUOTE = Symbol('quote');\nconst STATE_QUOTE_AFTER_QUOTE = Symbol('quoteafterquote');\nconst STATE_WITHIN_QUOTE_IN_QUOTE = Symbol('quoteinquote');\n\n/**\n * Represents a potentially large collection of delimited text records.\n *\n * The produced `TensorContainer`s each contain one key-value pair for\n * every column of the table. When a field is empty in the incoming data, the\n * resulting value is `undefined`, or throw error if it is required. Values\n * that can be parsed as numbers are emitted as type `number`, other values\n * are parsed as `string`.\n *\n * The results are not batched.\n *\n * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'}\n */\nexport class CSVDataset extends Dataset {\n base: TextLineDataset;\n private hasHeader = true;\n private fullColumnNames: string[] = null;\n private columnNamesValidated = false;\n private columnConfigs: {[key: string]: ColumnConfig} = null;\n private configuredColumnsOnly = false;\n private delimiter = ',';\n private delimWhitespace = false;\n\n /**\n * Returns column names of the csv dataset. If `configuredColumnsOnly` is\n * true, return column names in `columnConfigs`. If `configuredColumnsOnly` is\n * false and `columnNames` is provided, `columnNames`. If\n * `configuredColumnsOnly` is false and `columnNames` is not provided, return\n * all column names parsed from the csv file. For example usage please go to\n * `tf.data.csv`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async columnNames() {\n if (!this.columnNamesValidated) {\n await this.setColumnNames();\n }\n return this.configuredColumnsOnly ? Object.keys(this.columnConfigs) :\n this.fullColumnNames;\n }\n\n /* 1) If `columnNames` is provided as string[], use this string[] as output\n * keys in corresponding order. The length must match the number of inferred\n * columns if `hasHeader` is true .\n * 2) If `columnNames` is not provided, parse header line as `columnNames` if\n * hasHeader is true. If `hasHeader` is false, throw an error.\n * 3) If `columnConfigs` is provided, all the keys in `columnConfigs` must\n * exist in parsed `columnNames`.\n */\n private async setColumnNames() {\n const columnNamesFromFile = await this.maybeReadHeaderLine();\n if (!this.fullColumnNames && !columnNamesFromFile) {\n // Throw an error if columnNames is not provided and no header line.\n throw new Error(\n 'Column names must be provided if there is no header line.');\n } else if (this.fullColumnNames && columnNamesFromFile) {\n // Check provided columnNames match header line.\n util.assert(\n columnNamesFromFile.length === this.fullColumnNames.length,\n () => 'The length of provided columnNames (' +\n this.fullColumnNames.length.toString() +\n ') does not match the length of the header line read from ' +\n 'file (' + columnNamesFromFile.length.toString() + ').');\n }\n if (!this.fullColumnNames) {\n this.fullColumnNames = columnNamesFromFile;\n }\n // Check if there are duplicate column names.\n const counts: {[key: string]: number} = this.fullColumnNames.reduce(\n (countAcc: {[key: string]: number}, name) => {\n countAcc[name] = (countAcc[name] + 1) || 1;\n return countAcc;\n },\n {});\n const duplicateNames =\n Object.keys(counts).filter((name) => (counts[name] > 1));\n util.assert(\n duplicateNames.length === 0,\n () => 'Duplicate column names found: ' + duplicateNames.toString());\n // Check if keys in columnConfigs match columnNames.\n if (this.columnConfigs) {\n for (const key of Object.keys(this.columnConfigs)) {\n const index = this.fullColumnNames.indexOf(key);\n if (index === -1) {\n throw new Error(\n 'The key \"' + key +\n '\" provided in columnConfigs does not match any of the column ' +\n 'names (' + this.fullColumnNames.toString() + ').');\n }\n }\n }\n this.columnNamesValidated = true;\n }\n\n private async maybeReadHeaderLine() {\n if (this.hasHeader) {\n const iter = await this.base.iterator();\n const firstElement = await iter.next();\n if (firstElement.done) {\n throw new Error('No data was found for CSV parsing.');\n }\n const firstLine: string = firstElement.value;\n const headers = this.parseRow(firstLine, false);\n return headers;\n } else {\n return null;\n }\n }\n\n /**\n * Create a `CSVDataset`.\n *\n * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream.\n * @param csvConfig (Optional) A CSVConfig object that contains configurations\n * of reading and decoding from CSV file(s).\n *\n * hasHeader: (Optional) A boolean value that indicates whether the first\n * row of provided CSV file is a header line with column names, and should\n * not be included in the data. Defaults to `true`.\n *\n * columnNames: (Optional) A list of strings that corresponds to\n * the CSV column names, in order. If provided, it ignores the column\n * names inferred from the header row. If not provided, infers the column\n * names from the first row of the records. If hasHeader is false and\n * columnNames is not provided, this method throws an error.\n *\n * columnConfigs: (Optional) A dictionary whose key is column names, value\n * is an object stating if this column is required, column's data type,\n * default value, and if this column is label. If provided, keys must\n * correspond to names provided in columnNames or inferred from the file\n * header lines. If isLabel is true any column, returns an array of two\n * items: the first item is a dict of features key/value pairs, the second\n * item is a dict of labels key/value pairs. If no feature is marked as\n * label, returns a dict of features only.\n *\n * configuredColumnsOnly (Optional) If true, only columns provided in\n * columnConfigs will be parsed and provided during iteration.\n *\n * delimiter (Optional) The string used to parse each line of the input\n * file. Defaults to `,`.\n */\n constructor(protected readonly input: DataSource, csvConfig?: CSVConfig) {\n super();\n this.base = new TextLineDataset(input);\n if (!csvConfig) {\n csvConfig = {};\n }\n this.hasHeader = csvConfig.hasHeader === false ? false : true;\n this.fullColumnNames = csvConfig.columnNames;\n this.columnConfigs = csvConfig.columnConfigs;\n this.configuredColumnsOnly = csvConfig.configuredColumnsOnly;\n if (csvConfig.delimWhitespace) {\n util.assert(\n csvConfig.delimiter == null,\n () =>\n 'Delimiter should not be provided when delimWhitespace is true.');\n this.delimWhitespace = true;\n this.delimiter = ' ';\n } else {\n this.delimiter = csvConfig.delimiter ? csvConfig.delimiter : ',';\n }\n }\n\n async iterator(): Promise> {\n if (!this.columnNamesValidated) {\n await this.setColumnNames();\n }\n let lines = await this.base.iterator();\n if (this.hasHeader) {\n // We previously read the first line to get the columnNames.\n // Now that we're providing data, skip it.\n lines = lines.skip(1);\n }\n return lines.map(x => this.makeDataElement(x));\n }\n\n makeDataElement(line: string): TensorContainer {\n const values = this.parseRow(line);\n const features: {[key: string]: TensorContainer} = {};\n const labels: {[key: string]: TensorContainer} = {};\n\n for (let i = 0; i < this.fullColumnNames.length; i++) {\n const key = this.fullColumnNames[i];\n const config = this.columnConfigs ? this.columnConfigs[key] : null;\n if (this.configuredColumnsOnly && !config) {\n // This column is not selected.\n continue;\n } else {\n const value = values[i];\n let parsedValue = null;\n if (value === '') {\n // If default value is provided, use it. If default value is not\n // provided, set as undefined.\n if (config && config.default !== undefined) {\n parsedValue = config.default;\n } else if (config && (config.required || config.isLabel)) {\n throw new Error(\n `Required column ${key} is empty in this line: ${line}`);\n } else {\n parsedValue = undefined;\n }\n } else {\n // A value is present, so parse it based on type\n const valueAsNum = Number(value);\n if (isNaN(valueAsNum)) {\n // The value is a string and this column is declared as boolean\n // in config, parse it as boolean.\n if (config && config.dtype === 'bool') {\n parsedValue = this.getBoolean(value);\n } else {\n // Set value as string\n parsedValue = value;\n }\n } else if (!config || !config.dtype) {\n // If this value is a number and no type config is provided, return\n // it as number.\n parsedValue = valueAsNum;\n } else {\n // If this value is a number and data type is provided, parse it\n // according to provided data type.\n switch (config.dtype) {\n case 'float32':\n parsedValue = valueAsNum;\n break;\n case 'int32':\n parsedValue = Math.floor(valueAsNum);\n break;\n case 'bool':\n parsedValue = this.getBoolean(value);\n break;\n default:\n parsedValue = valueAsNum;\n }\n }\n }\n // Check if this column is label.\n (config && config.isLabel) ? labels[key] = parsedValue :\n features[key] = parsedValue;\n }\n }\n // If label exists, return an object of features and labels as {xs:features,\n // ys:labels}, otherwise return features only.\n if (Object.keys(labels).length === 0) {\n return features;\n\n } else {\n return {xs: features, ys: labels};\n }\n }\n\n private getBoolean(value: string): number {\n if (value === '1' || value.toLowerCase() === 'true') {\n return 1;\n } else {\n return 0;\n }\n }\n\n // adapted from https://beta.observablehq.com/@mbostock/streaming-csv\n private parseRow(line: string, validateElementCount = true): string[] {\n const result: string[] = [];\n let readOffset = 0;\n const readLength = line.length;\n let currentState = STATE_OUT;\n // Goes through the line to parse quote.\n for (let i = 0; i < readLength; i++) {\n switch (currentState) {\n // Before enter a new field\n case STATE_OUT:\n switch (line.charAt(i)) {\n // Enter a quoted field\n case CODE_QUOTE:\n readOffset = i + 1;\n currentState = STATE_QUOTE;\n break;\n // Read an empty field\n case this.delimiter:\n readOffset = i + 1;\n // If delimiter is white space and configured to collapse\n // multiple white spaces, ignore this white space.\n if (this.delimiter === ' ' && this.delimWhitespace) {\n break;\n }\n result.push('');\n currentState = STATE_OUT;\n break;\n // Enter an unquoted field\n default:\n currentState = STATE_FIELD;\n readOffset = i;\n break;\n }\n break;\n // In an unquoted field\n case STATE_FIELD:\n switch (line.charAt(i)) {\n // Exit an unquoted field, add it to result\n case this.delimiter:\n result.push(line.substring(readOffset, i));\n currentState = STATE_OUT;\n readOffset = i + 1;\n break;\n default:\n }\n break;\n // In a quoted field\n case STATE_QUOTE:\n switch (line.charAt(i)) {\n // Read a quote after a quote\n case CODE_QUOTE:\n currentState = STATE_QUOTE_AFTER_QUOTE;\n break;\n default:\n }\n break;\n // This state means it's right after a second quote in a field\n case STATE_QUOTE_AFTER_QUOTE:\n switch (line.charAt(i)) {\n // Finished a quoted field\n case this.delimiter:\n result.push(line.substring(readOffset, i - 1));\n currentState = STATE_OUT;\n readOffset = i + 1;\n break;\n // Finished a quoted part in a quoted field\n case CODE_QUOTE:\n currentState = STATE_QUOTE;\n break;\n // In a quoted part in a quoted field\n default:\n currentState = STATE_WITHIN_QUOTE_IN_QUOTE;\n break;\n }\n break;\n case STATE_WITHIN_QUOTE_IN_QUOTE:\n switch (line.charAt(i)) {\n // Exit a quoted part in a quoted field\n case CODE_QUOTE:\n currentState = STATE_QUOTE;\n break;\n default:\n }\n break;\n default:\n }\n }\n // Adds last item based on if it is quoted.\n if (currentState === STATE_QUOTE_AFTER_QUOTE) {\n result.push(line.substring(readOffset, readLength - 1));\n } else {\n result.push(line.substring(readOffset));\n }\n // Check if each row has the same number of elements as column names.\n if (validateElementCount && result.length !== this.fullColumnNames.length) {\n throw new Error(`Invalid row in csv file. Should have ${\n this.fullColumnNames.length} elements in a row, but got ${result}`);\n }\n return result;\n }\n}\n\n// TODO(soergel): add more basic datasets for parity with tf.data\n// tf.data.FixedLengthRecordDataset()\n// tf.data.TFRecordDataset()\n","/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {env, Tensor, tensor, Tensor2D, Tensor3D, TensorContainer, util} from '@tensorflow/tfjs-core';\nimport {MicrophoneConfig} from '../types';\nimport {LazyIterator} from './lazy_iterator';\n\n/**\n * Provide a stream of tensors from microphone audio stream. The tensors are\n * representing audio data as frequency-domain spectrogram generated with\n * browser's native FFT. Tensors representing time-domain waveform is available\n * based on configuration. Only works in browser environment.\n */\nexport class MicrophoneIterator extends LazyIterator {\n private isClosed = false;\n private stream: MediaStream;\n private readonly fftSize: number;\n private readonly columnTruncateLength: number;\n private freqData: Float32Array;\n private timeData: Float32Array;\n private readonly numFrames: number;\n private analyser: AnalyserNode;\n private audioContext: AudioContext;\n private sampleRateHz: number;\n private readonly audioTrackConstraints: MediaTrackConstraints;\n private readonly smoothingTimeConstant: number;\n private readonly includeSpectrogram: boolean;\n private readonly includeWaveform: boolean;\n\n private constructor(protected readonly microphoneConfig: MicrophoneConfig) {\n super();\n this.fftSize = microphoneConfig.fftSize || 1024;\n const fftSizeLog2 = Math.log2(this.fftSize);\n if (this.fftSize < 0 || fftSizeLog2 < 4 || fftSizeLog2 > 14 ||\n !Number.isInteger(fftSizeLog2)) {\n throw new Error(\n `Invalid fftSize: it must be a power of 2 between ` +\n `2 to 4 and 2 to 14, but got ${this.fftSize}`);\n }\n\n this.numFrames = microphoneConfig.numFramesPerSpectrogram || 43;\n this.sampleRateHz = microphoneConfig.sampleRateHz;\n this.columnTruncateLength =\n microphoneConfig.columnTruncateLength || this.fftSize;\n this.audioTrackConstraints = microphoneConfig.audioTrackConstraints;\n this.smoothingTimeConstant = microphoneConfig.smoothingTimeConstant || 0;\n\n this.includeSpectrogram =\n microphoneConfig.includeSpectrogram === false ? false : true;\n this.includeWaveform =\n microphoneConfig.includeWaveform === true ? true : false;\n if (!this.includeSpectrogram && !this.includeWaveform) {\n throw new Error(\n 'Both includeSpectrogram and includeWaveform are false. ' +\n 'At least one type of data should be returned.');\n }\n }\n\n summary() {\n return `microphone`;\n }\n\n // Construct a MicrophoneIterator and start the audio stream.\n static async create(microphoneConfig: MicrophoneConfig = {}) {\n if (env().get('IS_NODE')) {\n throw new Error(\n 'microphone API is only supported in browser environment.');\n }\n\n const microphoneIterator = new MicrophoneIterator(microphoneConfig);\n\n // Call async function start() to initialize the audio stream.\n await microphoneIterator.start();\n\n return microphoneIterator;\n }\n\n // Start the audio stream and FFT.\n async start(): Promise {\n try {\n this.stream = await navigator.mediaDevices.getUserMedia({\n audio: this.audioTrackConstraints == null ? true :\n this.audioTrackConstraints,\n video: false\n });\n } catch (e) {\n throw new Error(\n `Error thrown while initializing video stream: ${e.message}`);\n }\n\n if (!this.stream) {\n throw new Error('Could not obtain audio from microphone.');\n }\n\n const ctxConstructor =\n // tslint:disable-next-line:no-any\n (window as any).AudioContext || (window as any).webkitAudioContext;\n this.audioContext = new ctxConstructor();\n\n if (!this.sampleRateHz) {\n // If sample rate is not provided, use the available sample rate on\n // device.\n this.sampleRateHz = this.audioContext.sampleRate;\n } else if (this.audioContext.sampleRate !== this.sampleRateHz) {\n throw new Error(\n `Mismatch in sampling rate: ` +\n `Expected: ${this.sampleRateHz}; ` +\n `Actual: ${this.audioContext.sampleRate}`);\n }\n\n const streamSource = this.audioContext.createMediaStreamSource(this.stream);\n this.analyser = this.audioContext.createAnalyser();\n this.analyser.fftSize = this.fftSize * 2;\n this.analyser.smoothingTimeConstant = this.smoothingTimeConstant;\n streamSource.connect(this.analyser);\n this.freqData = new Float32Array(this.fftSize);\n this.timeData = new Float32Array(this.fftSize);\n return;\n }\n\n async next(): Promise> {\n if (this.isClosed) {\n return {value: null, done: true};\n }\n\n let spectrogramTensor: Tensor;\n let waveformTensor: Tensor;\n\n const audioDataQueue = await this.getAudioData();\n if (this.includeSpectrogram) {\n const freqData = this.flattenQueue(audioDataQueue.freqDataQueue);\n spectrogramTensor = this.getTensorFromAudioDataArray(\n freqData, [this.numFrames, this.columnTruncateLength, 1]);\n }\n if (this.includeWaveform) {\n const timeData = this.flattenQueue(audioDataQueue.timeDataQueue);\n waveformTensor = this.getTensorFromAudioDataArray(\n timeData, [this.numFrames * this.fftSize, 1]);\n }\n\n return {\n value: {'spectrogram': spectrogramTensor, 'waveform': waveformTensor},\n done: false\n };\n }\n\n // Capture one result from the audio stream, and extract the value from\n // iterator.next() result.\n async capture(): Promise<{spectrogram: Tensor3D, waveform: Tensor2D}> {\n return (await this.next()).value as\n {spectrogram: Tensor3D, waveform: Tensor2D};\n }\n\n private async getAudioData():\n Promise<{freqDataQueue: Float32Array[], timeDataQueue: Float32Array[]}> {\n const freqDataQueue: Float32Array[] = [];\n const timeDataQueue: Float32Array[] = [];\n let currentFrames = 0;\n return new Promise(resolve => {\n const intervalID = setInterval(() => {\n if (this.includeSpectrogram) {\n this.analyser.getFloatFrequencyData(this.freqData);\n // If the audio stream is initializing, return empty queue.\n if (this.freqData[0] === -Infinity) {\n resolve({freqDataQueue, timeDataQueue});\n }\n freqDataQueue.push(this.freqData.slice(0, this.columnTruncateLength));\n }\n if (this.includeWaveform) {\n this.analyser.getFloatTimeDomainData(this.timeData);\n timeDataQueue.push(this.timeData.slice());\n }\n\n // Clean interval and return when all frames have been collected\n if (++currentFrames === this.numFrames) {\n clearInterval(intervalID);\n resolve({freqDataQueue, timeDataQueue});\n }\n }, this.fftSize / this.sampleRateHz * 1e3);\n });\n }\n\n // Stop the audio stream and pause the iterator.\n stop(): void {\n if (!this.isClosed) {\n this.isClosed = true;\n this.analyser.disconnect();\n this.audioContext.close();\n if (this.stream != null && this.stream.getTracks().length > 0) {\n this.stream.getTracks()[0].stop();\n }\n }\n }\n\n // Override toArray() function to prevent collecting.\n toArray(): Promise {\n throw new Error('Can not convert infinite audio stream to array.');\n }\n\n // Return audio sampling rate in Hz\n getSampleRate(): number {\n return this.sampleRateHz;\n }\n\n private flattenQueue(queue: Float32Array[]): Float32Array {\n const frameSize = queue[0].length;\n const freqData = new Float32Array(queue.length * frameSize);\n queue.forEach((data, i) => freqData.set(data, i * frameSize));\n return freqData;\n }\n\n private getTensorFromAudioDataArray(freqData: Float32Array, shape: number[]):\n Tensor {\n const vals = new Float32Array(util.sizeFromShape(shape));\n // If the data is less than the output shape, the rest is padded with zeros.\n vals.set(freqData, vals.length - freqData.length);\n return tensor(vals, shape);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {browser, cast, env, expandDims, image, reshape, tensor1d, Tensor1D, tensor2d, Tensor2D, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs-core';\nimport {WebcamConfig} from '../types';\nimport {LazyIterator} from './lazy_iterator';\n\n/**\n * Provide a stream of image tensors from webcam video stream. Only works in\n * browser environment.\n */\nexport class WebcamIterator extends LazyIterator {\n private isClosed = true;\n private stream: MediaStream;\n private resize = false;\n private cropSize: [number, number];\n private cropBox: Tensor2D;\n private cropBoxInd: Tensor1D;\n\n private constructor(\n protected readonly webcamVideoElement: HTMLVideoElement,\n protected readonly webcamConfig: WebcamConfig) {\n super();\n if (this.needToResize()) {\n this.resize = true;\n this.cropSize =\n [this.webcamConfig.resizeHeight, this.webcamConfig.resizeWidth];\n this.cropBoxInd = tensor1d([0], 'int32');\n if (this.webcamConfig.centerCrop) {\n // Calculate the box based on resizing shape.\n const widthCroppingRatio =\n this.webcamConfig.resizeWidth * 1.0 / this.webcamVideoElement.width;\n const heightCroppingRatio = this.webcamConfig.resizeHeight * 1.0 /\n this.webcamVideoElement.height;\n const widthCropStart = (1 - widthCroppingRatio) / 2;\n const heightCropStart = (1 - heightCroppingRatio) / 2;\n const widthCropEnd = widthCropStart + widthCroppingRatio;\n const heightCropEnd = heightCroppingRatio + heightCropStart;\n this.cropBox = tensor2d(\n [heightCropStart, widthCropStart, heightCropEnd, widthCropEnd],\n [1, 4]);\n } else {\n this.cropBox = tensor2d([0, 0, 1, 1], [1, 4]);\n }\n }\n }\n\n summary() {\n return `webcam`;\n }\n\n // Construct a WebcamIterator and start it's video stream.\n static async create(\n webcamVideoElement?: HTMLVideoElement, webcamConfig: WebcamConfig = {}) {\n if (env().get('IS_NODE')) {\n throw new Error(\n 'tf.data.webcam is only supported in browser environment.');\n }\n\n if (!webcamVideoElement) {\n // If webcam video element is not provided, create a hidden video element\n // with provided width and height.\n webcamVideoElement = document.createElement('video');\n if (!webcamConfig.resizeWidth || !webcamConfig.resizeHeight) {\n throw new Error(\n 'Please provide webcam video element, or resizeWidth and ' +\n 'resizeHeight to create a hidden video element.');\n }\n webcamVideoElement.width = webcamConfig.resizeWidth;\n webcamVideoElement.height = webcamConfig.resizeHeight;\n }\n const webcamIterator = new WebcamIterator(webcamVideoElement, webcamConfig);\n\n // Call async function to initialize the video stream.\n await webcamIterator.start();\n\n return webcamIterator;\n }\n\n // Async function to start video stream.\n async start(): Promise {\n if (this.webcamConfig.facingMode) {\n util.assert(\n (this.webcamConfig.facingMode === 'user') ||\n (this.webcamConfig.facingMode === 'environment'),\n () =>\n `Invalid webcam facing mode: ${this.webcamConfig.facingMode}. ` +\n `Please provide 'user' or 'environment'`);\n }\n\n try {\n this.stream = await navigator.mediaDevices.getUserMedia({\n video: {\n deviceId: this.webcamConfig.deviceId,\n facingMode: this.webcamConfig.facingMode ?\n this.webcamConfig.facingMode :\n 'user',\n width: this.webcamVideoElement.width,\n height: this.webcamVideoElement.height\n }\n });\n } catch (e) {\n // Modify the error message but leave the stack trace intact\n e.message = `Error thrown while initializing video stream: ${e.message}`;\n throw e;\n }\n\n if (!this.stream) {\n throw new Error('Could not obtain video from webcam.');\n }\n\n // Older browsers may not have srcObject\n try {\n this.webcamVideoElement.srcObject = this.stream;\n } catch (error) {\n console.log(error);\n this.webcamVideoElement.src = window.URL.createObjectURL(this.stream);\n }\n // Start the webcam video stream\n this.webcamVideoElement.play();\n\n this.isClosed = false;\n\n return new Promise(resolve => {\n // Add event listener to make sure the webcam has been fully initialized.\n this.webcamVideoElement.onloadedmetadata = () => {\n resolve();\n };\n });\n }\n\n async next(): Promise> {\n if (this.isClosed) {\n return {value: null, done: true};\n }\n\n let img;\n try {\n img = browser.fromPixels(this.webcamVideoElement);\n } catch (e) {\n throw new Error(\n `Error thrown converting video to pixels: ${JSON.stringify(e)}`);\n }\n if (this.resize) {\n try {\n return {value: this.cropAndResizeFrame(img), done: false};\n } catch (e) {\n throw new Error(`Error thrown cropping the video: ${e.message}`);\n } finally {\n img.dispose();\n }\n } else {\n return {value: img, done: false};\n }\n }\n\n private needToResize() {\n // If resizeWidth and resizeHeight are provided, and different from the\n // width and height of original HTMLVideoElement, then resizing and cropping\n // is required.\n if (this.webcamConfig.resizeWidth && this.webcamConfig.resizeHeight &&\n (this.webcamVideoElement.width !== this.webcamConfig.resizeWidth ||\n this.webcamVideoElement.height !== this.webcamConfig.resizeHeight)) {\n return true;\n }\n return false;\n }\n\n // Cropping and resizing each frame based on config\n cropAndResizeFrame(img: Tensor3D): Tensor3D {\n return tidy(() => {\n const expandedImage: Tensor4D = expandDims(cast(img, 'float32'), (0));\n let resizedImage;\n resizedImage = image.cropAndResize(\n expandedImage, this.cropBox, this.cropBoxInd, this.cropSize,\n 'bilinear');\n // Extract image from batch cropping.\n const shape = resizedImage.shape;\n return reshape(resizedImage, shape.slice(1) as [number, number, number]);\n });\n }\n\n // Capture one frame from the video stream, and extract the value from\n // iterator.next() result.\n async capture(): Promise {\n return (await this.next()).value;\n }\n\n // Stop the video stream and pause webcam iterator.\n stop(): void {\n const tracks = this.stream.getTracks();\n\n tracks.forEach(track => track.stop());\n\n try {\n this.webcamVideoElement.srcObject = null;\n } catch (error) {\n console.log(error);\n this.webcamVideoElement.src = null;\n }\n this.isClosed = true;\n }\n\n // Override toArray() function to prevent collecting.\n toArray(): Promise {\n throw new Error('Can not convert infinite video stream to array.');\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {ByteChunkIterator} from './iterators/byte_chunk_iterator';\n\n/**\n * Represents a data source readable as a stream of binary data chunks.\n *\n * Because `Dataset`s can be read repeatedly (via `Dataset.iterator()`), this\n * provides a means to repeatedly create streams from the underlying data\n * sources.\n */\nexport abstract class DataSource {\n /**\n * Obtain a new stream of binary data chunks.\n *\n * Starts the new stream from the beginning of the data source, even if other\n * streams have been obtained previously.\n */\n abstract async iterator(): Promise;\n\n // TODO(soergel): consider chainable Dataset construction here\n}\n\n// TODO(soergel): consider convenience factory functions here\n// in combination with chainable source->dataset above, e.g.:\n// tf.data.url(...).asCsvDataset().shuffle().batch()\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {LazyIterator, OneToManyIterator} from './lazy_iterator';\n\nexport abstract class StringIterator extends LazyIterator {\n /**\n * Splits a string stream on a given separator.\n *\n * It is assumed that the incoming chunk boundaries have no semantic meaning,\n * so conceptually the incoming stream is treated simply as the concatenation\n * of its elements.\n *\n * The outgoing stream provides chunks corresponding to the results of the\n * standard string split() operation (even if such a chunk spanned incoming\n * chunks). The separators are not included.\n *\n * A typical usage is to split a text file (represented as a stream with\n * arbitrary chunk boundaries) into lines.\n *\n * @param upstream A readable stream of strings that can be treated as\n * concatenated.\n * @param separator A character to split on.\n */\n split(separator: string): StringIterator {\n return new SplitIterator(this, separator);\n }\n}\n\n// ============================================================================\n// The following private classes serve to implement the chainable methods\n// on StringIterator. Unfortunately they can't be placed in separate files, due\n// to resulting trouble with circular imports.\n// ============================================================================\n\n// We wanted multiple inheritance, e.g.\n// class SplitIterator extends QueueIterator, StringIterator\n// but the TypeScript mixin approach is a bit hacky, so we take this adapter\n// approach instead.\n\nclass SplitIterator extends StringIterator {\n private impl: SplitIteratorImpl;\n\n constructor(protected upstream: LazyIterator, separator: string) {\n super();\n this.impl = new SplitIteratorImpl(upstream, separator);\n }\n\n summary() {\n return this.impl.summary();\n }\n\n async next() {\n return this.impl.next();\n }\n}\n\nclass SplitIteratorImpl extends OneToManyIterator {\n // A partial string at the end of an upstream chunk\n carryover = '';\n\n constructor(\n protected upstream: LazyIterator, protected separator: string) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Split('${this.separator}')`;\n }\n\n async pump(): Promise {\n const chunkResult = await this.upstream.next();\n if (chunkResult.done) {\n if (this.carryover === '') {\n return false;\n }\n\n // Pretend that the pump succeeded in order to emit the small last batch.\n // The next pump() call will actually fail.\n this.outputQueue.push(this.carryover);\n this.carryover = '';\n return true;\n }\n const lines = chunkResult.value.split(this.separator);\n // Note the behavior: \" ab \".split(' ') === ['', 'ab', '']\n // Thus the carryover may be '' if the separator falls on a chunk\n // boundary; this produces the correct result.\n\n lines[0] = this.carryover + lines[0];\n for (const line of lines.slice(0, -1)) {\n this.outputQueue.push(line);\n }\n this.carryover = lines[lines.length - 1];\n\n return true;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {env} from '@tensorflow/tfjs-core';\nimport {LazyIterator, OneToManyIterator} from './lazy_iterator';\nimport {StringIterator} from './string_iterator';\n\nexport abstract class ByteChunkIterator extends LazyIterator {\n /**\n * Decode a stream of UTF8-encoded byte arrays to a stream of strings.\n *\n * The byte arrays producetd from the ByteChunkIterator on which this is\n * called will be interpreted as concatenated. No assumptions are made about\n * the boundaries of the incoming chunks, so a multi-byte UTF8 encoding of a\n * character may span the boundary between chunks. This naturally happens,\n * for instance, when reading fixed-size byte arrays from a file.\n */\n decodeUTF8(): StringIterator {\n return new Utf8Iterator(this);\n }\n}\n\n// ============================================================================\n// The following private classes serve to implement the chainable methods\n// on ByteChunkIterator. Unfortunately they can't be placed in separate files,\n// due to resulting trouble with circular imports.\n// ============================================================================\n\n// We wanted multiple inheritance, e.g.\n// class Utf8Iterator extends QueueIterator, StringIterator\n// but the TypeScript mixin approach is a bit hacky, so we take this adapter\n// approach instead.\n\nclass Utf8Iterator extends StringIterator {\n private impl: Utf8IteratorImpl;\n\n constructor(protected upstream: LazyIterator) {\n super();\n this.impl = new Utf8IteratorImpl(upstream);\n }\n\n summary() {\n return this.impl.summary();\n }\n\n async next() {\n return this.impl.next();\n }\n}\n\n/**\n * Decode a stream of UTF8-encoded byte arrays to a stream of strings.\n *\n * This is tricky because the incoming byte array boundaries may disrupt a\n * multi-byte UTF8 character. Thus any incomplete character data at the end of\n * a chunk must be carried over and prepended to the next chunk before\n * decoding. Luckily with native decoder, TextDecoder in browser and\n * string_decoder in node, byte array boundaries are handled automatically.\n *\n * In the context of an input pipeline for machine learning, UTF8 decoding is\n * needed to parse text files containing training examples or prediction\n * requests (e.g., formatted as CSV or JSON). We cannot use the built-in\n * decoding provided by FileReader.readAsText() because here we are in a\n * streaming context, which FileReader does not support.\n *\n * @param upstream A `LazyIterator` of `Uint8Arrays` containing UTF8-encoded\n * text, which should be interpreted as concatenated. No assumptions are\n * made about the boundaries of the incoming chunks, so a multi-byte UTF8\n * encoding of a character may span the boundary between chunks. This\n * naturally happens, for instance, when reading fixed-size byte arrays from a\n * file.\n */\nclass Utf8IteratorImpl extends OneToManyIterator {\n // `decoder` as `any` here to dynamically assign value based on the\n // environment.\n // tslint:disable-next-line:no-any\n decoder: any;\n\n constructor(protected readonly upstream: LazyIterator) {\n super();\n if (env().get('IS_BROWSER')) {\n this.decoder = new TextDecoder('utf-8');\n } else {\n // tslint:disable-next-line:no-require-imports\n const {StringDecoder} = require('string_decoder');\n this.decoder = new StringDecoder('utf8');\n }\n }\n summary() {\n return `${this.upstream.summary()} -> Utf8`;\n }\n\n async pump(): Promise {\n const chunkResult = await this.upstream.next();\n let chunk;\n if (chunkResult.done) {\n return false;\n } else {\n chunk = chunkResult.value;\n }\n\n let text: string;\n if (env().get('IS_BROWSER')) {\n text = this.decoder.decode(chunk, {stream: true});\n } else {\n text = this.decoder.write(Buffer.from(chunk.buffer));\n }\n this.outputQueue.push(text);\n return true;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\n// inspired by https://github.com/maxogden/filereader-stream\nimport {env, util} from '@tensorflow/tfjs-core';\nimport {FileElement} from '../types';\nimport {ByteChunkIterator} from './byte_chunk_iterator';\n\nexport interface FileChunkIteratorOptions {\n /** The byte offset at which to begin reading the File or Blob. Default 0. */\n offset?: number;\n /** The number of bytes to read at a time. Default 1MB. */\n chunkSize?: number;\n}\n\n/**\n * Provide a stream of chunks from a File, Blob, or Uint8Array.\n * @param file The source File, Blob or Uint8Array.\n * @param options Optional settings controlling file reading.\n * @returns a lazy Iterator of Uint8Arrays containing sequential chunks of the\n * input File, Blob or Uint8Array.\n */\nexport class FileChunkIterator extends ByteChunkIterator {\n offset: number;\n chunkSize: number;\n\n constructor(\n protected file: FileElement,\n protected options: FileChunkIteratorOptions = {}) {\n super();\n util.assert(\n (file instanceof Uint8Array) ||\n (env().get('IS_BROWSER') ?\n (file instanceof File || file instanceof Blob) :\n false),\n () => 'FileChunkIterator only supports File, Blob and Uint8Array ' +\n 'right now.');\n this.offset = options.offset || 0;\n // default 1MB chunk has tolerable perf on large files\n this.chunkSize = options.chunkSize || 1024 * 1024;\n }\n\n summary() {\n return `FileChunks ${this.file}`;\n }\n\n async next(): Promise> {\n if (this.offset >= ((this.file instanceof Uint8Array) ?\n this.file.byteLength :\n this.file.size)) {\n return {value: null, done: true};\n }\n const chunk = new Promise((resolve, reject) => {\n const end = this.offset + this.chunkSize;\n if (this.file instanceof Uint8Array) {\n // Note if end > this.uint8Array.byteLength, we just get a small last\n // chunk.\n resolve(new Uint8Array(this.file.slice(this.offset, end)));\n } else {\n // This branch assumes that this.file type is File or Blob, which\n // means it is in the browser environment.\n\n // TODO(soergel): is this a performance issue?\n const fileReader = new FileReader();\n fileReader.onload = (event) => {\n let data: string|ArrayBuffer|Uint8Array = fileReader.result;\n // Not sure we can trust the return type of\n // FileReader.readAsArrayBuffer See e.g.\n // https://github.com/node-file-api/FileReader/issues/2\n if (data instanceof ArrayBuffer) {\n data = new Uint8Array(data);\n }\n if (!(data instanceof Uint8Array)) {\n return reject(new TypeError('FileReader returned unknown type.'));\n }\n resolve(data);\n };\n fileReader.onabort = (event) => {\n return reject(new Error('Aborted'));\n };\n fileReader.onerror = (event) => {\n return reject(new Error(event.type));\n };\n // TODO(soergel): better handle onabort, onerror\n // Note if end > this.file.size, we just get a small last chunk.\n const slice = this.file.slice(this.offset, end);\n // We can't use readAsText here (even if we know the file is text)\n // because the slice boundary may fall within a multi-byte character.\n fileReader.readAsArrayBuffer(slice);\n }\n this.offset = end;\n });\n return {value: (await chunk), done: false};\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {util} from '@tensorflow/tfjs-core';\nimport {FileChunkIterator, FileChunkIteratorOptions} from './file_chunk_iterator';\n\n/**\n * Provide a stream of chunks from a URL.\n *\n * Note this class first downloads the entire file into memory before providing\n * the first element from the stream. This is because the Fetch API does not\n * yet reliably provide a reader stream for the response body.\n */\nexport async function urlChunkIterator(\n url: RequestInfo, options: FileChunkIteratorOptions = {}) {\n let urlString;\n let requestInit;\n if ((typeof url) === 'string') {\n urlString = url as string;\n } else {\n urlString = (url as Request).url;\n requestInit = getRequestInitFromRequest(url as Request);\n }\n const response = await util.fetch(urlString, requestInit);\n if (response.ok) {\n const uint8Array = new Uint8Array(await response.arrayBuffer());\n return new FileChunkIterator(uint8Array, options);\n } else {\n throw new Error(response.statusText);\n }\n}\n\n// Generate RequestInit from Request to match tf.util.fetch signature.\nconst getRequestInitFromRequest = (request: Request) => {\n const init = {\n method: request.method,\n headers: request.headers,\n body: request.body,\n mode: request.mode,\n credentials: request.credentials,\n cache: request.cache,\n redirect: request.redirect,\n referrer: request.referrer,\n integrity: request.integrity,\n };\n return init;\n};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\n// Skip tslint any type check cause this method is aiming to check type of\n// input.\n// tslint:disable-next-line:no-any\nexport function isLocalPath(source: any): boolean {\n return (typeof source === 'string') && source.substr(0, 7) === 'file://';\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {env} from '@tensorflow/tfjs-core';\nimport {DataSource} from '../datasource';\nimport {ByteChunkIterator} from '../iterators/byte_chunk_iterator';\nimport {FileChunkIterator, FileChunkIteratorOptions} from '../iterators/file_chunk_iterator';\nimport {FileElement} from '../types';\nimport {isLocalPath} from '../util/source_util';\n\n/**\n * Represents a file, blob, or Uint8Array readable as a stream of binary data\n * chunks.\n */\nexport class FileDataSource extends DataSource {\n /**\n * Create a `FileDataSource`.\n *\n * @param input Local file path, or `File`/`Blob`/`Uint8Array` object to\n * read. Local file only works in node environment.\n * @param options Options passed to the underlying `FileChunkIterator`s,\n * such as {chunksize: 1024}.\n */\n constructor(\n protected input: FileElement|string,\n protected readonly options: FileChunkIteratorOptions = {}) {\n super();\n }\n\n async iterator(): Promise {\n if (isLocalPath(this.input) && env().get('IS_NODE')) {\n // tslint:disable-next-line:no-require-imports\n const fs = require('fs');\n this.input = fs.readFileSync((this.input as string).substr(7));\n }\n // TODO(kangyizhang): Add LocalFileChunkIterator to split local streaming\n // with file in browser.\n return new FileChunkIterator(this.input as FileElement, this.options);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {DataSource} from '../datasource';\nimport {ByteChunkIterator} from '../iterators/byte_chunk_iterator';\nimport {FileChunkIteratorOptions} from '../iterators/file_chunk_iterator';\nimport {urlChunkIterator} from '../iterators/url_chunk_iterator';\nimport {isLocalPath} from '../util/source_util';\nimport {FileDataSource} from './file_data_source';\n\n/*\n * Represents a URL readable as a stream of binary data chunks.\n */\nexport class URLDataSource extends DataSource {\n /**\n * Create a `URLDataSource`.\n *\n * @param url A source URL string, or a `Request` object.\n * @param options Options passed to the underlying `FileChunkIterator`s,\n * such as {chunksize: 1024}.\n */\n constructor(\n protected readonly url: RequestInfo,\n protected readonly fileOptions: FileChunkIteratorOptions = {}) {\n super();\n }\n\n // TODO(soergel): provide appropriate caching options. Currently this\n // will download the URL anew for each call to iterator(). Since we have\n // to treat the downloaded file as a blob/buffer anyway, we may as well retain\n // it-- but that raises GC issues. Also we may want a persistent disk cache.\n async iterator(): Promise {\n if (isLocalPath(this.url)) {\n return (new FileDataSource(this.url as string, this.fileOptions))\n .iterator();\n } else {\n return urlChunkIterator(this.url, this.fileOptions);\n }\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {TensorContainer} from '@tensorflow/tfjs-core';\nimport {Dataset, datasetFromIteratorFn} from './dataset';\nimport {CSVDataset} from './datasets/csv_dataset';\nimport {iteratorFromFunction} from './iterators/lazy_iterator';\nimport {MicrophoneIterator} from './iterators/microphone_iterator';\nimport {WebcamIterator} from './iterators/webcam_iterator';\nimport {URLDataSource} from './sources/url_data_source';\nimport {CSVConfig, MicrophoneConfig, WebcamConfig} from './types';\n\n/**\n * Create a `CSVDataset` by reading and decoding CSV file(s) from provided URL\n * or local path if it's in Node environment.\n *\n * Note: If isLabel in columnConfigs is `true` for at least one column, the\n * element in returned `CSVDataset` will be an object of\n * `{xs:features, ys:labels}`: xs is a dict of features key/value pairs, ys\n * is a dict of labels key/value pairs. If no column is marked as label,\n * returns a dict of features only.\n *\n * ```js\n * const csvUrl =\n * 'https://storage.googleapis.com/tfjs-examples/multivariate-linear-regression/data/boston-housing-train.csv';\n *\n * async function run() {\n * // We want to predict the column \"medv\", which represents a median value of\n * // a home (in $1000s), so we mark it as a label.\n * const csvDataset = tf.data.csv(\n * csvUrl, {\n * columnConfigs: {\n * medv: {\n * isLabel: true\n * }\n * }\n * });\n *\n * // Number of features is the number of column names minus one for the label\n * // column.\n * const numOfFeatures = (await csvDataset.columnNames()).length - 1;\n *\n * // Prepare the Dataset for training.\n * const flattenedDataset =\n * csvDataset\n * .map(({xs, ys}) =>\n * {\n * // Convert xs(features) and ys(labels) from object form (keyed by\n * // column name) to array form.\n * return {xs:Object.values(xs), ys:Object.values(ys)};\n * })\n * .batch(10);\n *\n * // Define the model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense({\n * inputShape: [numOfFeatures],\n * units: 1\n * }));\n * model.compile({\n * optimizer: tf.train.sgd(0.000001),\n * loss: 'meanSquaredError'\n * });\n *\n * // Fit the model using the prepared Dataset\n * return model.fitDataset(flattenedDataset, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * console.log(epoch + ':' + logs.loss);\n * }\n * }\n * });\n * }\n *\n * await run();\n * ```\n *\n * @param source URL or local path to get CSV file. If it's a local path, it\n * must have prefix `file://` and it only works in node environment.\n * @param csvConfig (Optional) A CSVConfig object that contains configurations\n * of reading and decoding from CSV file(s).\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * configParamIndices: [1]\n * }\n */\nexport function csv(\n source: RequestInfo, csvConfig: CSVConfig = {}): CSVDataset {\n return new CSVDataset(new URLDataSource(source), csvConfig);\n}\n\n/**\n * Create a `Dataset` that produces each element by calling a provided function.\n *\n * Note that repeated iterations over this `Dataset` may produce different\n * results, because the function will be called anew for each element of each\n * iteration.\n *\n * Also, beware that the sequence of calls to this function may be out of order\n * in time with respect to the logical order of the Dataset. This is due to the\n * asynchronous lazy nature of stream processing, and depends on downstream\n * transformations (e.g. .shuffle()). If the provided function is pure, this is\n * no problem, but if it is a closure over a mutable state (e.g., a traversal\n * pointer), then the order of the produced elements may be scrambled.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const ds = tf.data.func(func);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * @param f A function that produces one data element on each call.\n */\nexport function func(\n f: () => IteratorResult| Promise>): Dataset {\n const iter = iteratorFromFunction(f);\n return datasetFromIteratorFn(async () => iter);\n}\n\n/**\n * Create a `Dataset` that produces each element from provided JavaScript\n * generator, which is a function*\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions),\n * or a function that returns an\n * iterator\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions).\n *\n * The returned iterator should have `.next()` function that returns element in\n * format of `{value: TensorContainer, done:boolean}`.\n *\n * Example of creating a dataset from an iterator factory:\n * ```js\n * function makeIterator() {\n * const numElements = 10;\n * let index = 0;\n *\n * const iterator = {\n * next: () => {\n * let result;\n * if (index < numElements) {\n * result = {value: index, done: false};\n * index++;\n * return result;\n * }\n * return {value: index, done: true};\n * }\n * };\n * return iterator;\n * }\n * const ds = tf.data.generator(makeIterator);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * Example of creating a dataset from a generator:\n * ```js\n * function* dataGenerator() {\n * const numElements = 10;\n * let index = 0;\n * while (index < numElements) {\n * const x = index;\n * index++;\n * yield x;\n * }\n * }\n *\n * const ds = tf.data.generator(dataGenerator);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * @param generator A Javascript generator function that returns a JavaScript\n * iterator.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * configParamIndices: [1]\n * }\n */\nexport function generator(\n generator: () => Iterator| Promise>): Dataset {\n return datasetFromIteratorFn(async () => {\n const gen = await generator();\n return iteratorFromFunction(() => gen.next());\n });\n}\n\n/**\n * Create an iterator that generate `Tensor`s from webcam video stream. This API\n * only works in Browser environment when the device has webcam.\n *\n * Note: this code snippet only works when the device has a webcam. It will\n * request permission to open the webcam when running.\n * ```js\n * const videoElement = document.createElement('video');\n * videoElement.width = 100;\n * videoElement.height = 100;\n * const cam = await tf.data.webcam(videoElement);\n * const img = await cam.capture();\n * img.print();\n * cam.stop();\n * ```\n *\n * @param webcamVideoElement A `HTMLVideoElement` used to play video from\n * webcam. If this element is not provided, a hidden `HTMLVideoElement` will\n * be created. In that case, `resizeWidth` and `resizeHeight` must be\n * provided to set the generated tensor shape.\n * @param webcamConfig A `WebcamConfig` object that contains configurations of\n * reading and manipulating data from webcam video stream.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * ignoreCI: true\n * }\n */\nexport async function webcam(\n webcamVideoElement?: HTMLVideoElement,\n webcamConfig?: WebcamConfig): Promise {\n return WebcamIterator.create(webcamVideoElement, webcamConfig);\n}\n\n/**\n * Create an iterator that generate frequency-domain spectrogram `Tensor`s from\n * microphone audio stream with browser's native FFT. This API only works in\n * browser environment when the device has microphone.\n *\n * Note: this code snippet only works when the device has a microphone. It will\n * request permission to open the microphone when running.\n * ```js\n * const mic = await tf.data.microphone({\n * fftSize: 1024,\n * columnTruncateLength: 232,\n * numFramesPerSpectrogram: 43,\n * sampleRateHz:44100,\n * includeSpectrogram: true,\n * includeWaveform: true\n * });\n * const audioData = await mic.capture();\n * const spectrogramTensor = audioData.spectrogram;\n * spectrogramTensor.print();\n * const waveformTensor = audioData.waveform;\n * waveformTensor.print();\n * mic.stop();\n * ```\n *\n * @param microphoneConfig A `MicrophoneConfig` object that contains\n * configurations of reading audio data from microphone.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * ignoreCI: true\n * }\n */\nexport async function microphone(microphoneConfig?: MicrophoneConfig):\n Promise {\n return MicrophoneIterator.create(microphoneConfig);\n}\n","/** @license See the LICENSE file. */\n\n// This code is auto-generated, do not modify this file!\nconst version = '3.6.0';\nexport {version};\n"],"names":["this","define","sr","tf.util","tf.Tensor","tf.dispose","tf.tensor_util","seedrandom.alea","tf.tidy","tf.stack","tf.tensor"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;AAClC;AACA,SAAS,IAAI,CAAC,IAAI,EAAE;AACpB,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,CAAC;AAC/B;AACA,EAAE,EAAE,CAAC,IAAI,GAAG,WAAW;AACvB,IAAI,IAAI,CAAC,GAAG,OAAO,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,sBAAsB,CAAC;AAC5D,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;AAClB,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;AAClB,IAAI,OAAO,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AACtC,GAAG,CAAC;AACJ;AACA;AACA,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC;AACX,EAAE,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;AACpB,EAAE,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;AACpB,EAAE,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;AACpB,EAAE,EAAE,CAAC,EAAE,IAAI,IAAI,CAAC,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GAAG,MAAM,SAAS,EAAE,CAAC;QAC9B,OAAO,oBAAoB,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;KAC/C,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BO,eAAe,MAAM,CACxB,kBAAqC,EACrC,YAA2B;IAC7B,OAAO,cAAc,CAAC,MAAM,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC;AACjE,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCO,eAAe,UAAU,CAAC,gBAAmC;IAElE,OAAO,kBAAkB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;AACrD;;ACzRA;AAEA;MACM,OAAO,GAAG;;;;"} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.fesm.min.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.fesm.min.js deleted file mode 100644 index 7c5147157..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.fesm.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -import{Tensor as t,util as e,dispose as r,tensor_util as s,tidy as n,stack as i,tensor as a,env as o,tensor1d as u,tensor2d as h,browser as l,expandDims as c,cast as f,image as m,reshape as d}from"@tensorflow/tfjs-core";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function p(t,e){return t(e={exports:{}},e.exports),e.exports}var w=p((function(t){!function(t,e,r){function s(t){var e,r=this,s=(e=4022871197,function(t){t=t.toString();for(var r=0;r>>0,e=(s*=e)>>>0,e+=4294967296*(s-=e)}return 2.3283064365386963e-10*(e>>>0)});r.next=function(){var t=2091639*r.s0+2.3283064365386963e-10*r.c;return r.s0=r.s1,r.s1=r.s2,r.s2=t-(r.c=0|t)},r.c=1,r.s0=s(" "),r.s1=s(" "),r.s2=s(" "),r.s0-=s(t),r.s0<0&&(r.s0+=1),r.s1-=s(t),r.s1<0&&(r.s1+=1),r.s2-=s(t),r.s2<0&&(r.s2+=1),s=null}function n(t,e){return e.c=t.c,e.s0=t.s0,e.s1=t.s1,e.s2=t.s2,e}function i(t,e){var r=new s(t),i=e&&e.state,a=r.next;return a.int32=function(){return 4294967296*r.next()|0},a.double=function(){return a()+11102230246251565e-32*(2097152*a()|0)},a.quick=a,i&&("object"==typeof i&&n(i,r),a.state=function(){return n(r,{})}),a}e&&e.exports?e.exports=i:r&&r.amd?r((function(){return i})):this.alea=i}(0,t,!1)})),y=p((function(t){!function(t,e,r){function s(t){var e=this,r="";e.x=0,e.y=0,e.z=0,e.w=0,e.next=function(){var t=e.x^e.x<<11;return e.x=e.y,e.y=e.z,e.z=e.w,e.w^=e.w>>>19^t^t>>>8},t===(0|t)?e.x=t:r+=t;for(var s=0;s>>0)/4294967296};return a.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},a.int32=r.next,a.quick=a,i&&("object"==typeof i&&n(i,r),a.state=function(){return n(r,{})}),a}e&&e.exports?e.exports=i:r&&r.amd?r((function(){return i})):this.xor128=i}(0,t,!1)})),g=p((function(t){!function(t,e,r){function s(t){var e=this,r="";e.next=function(){var t=e.x^e.x>>>2;return e.x=e.y,e.y=e.z,e.z=e.w,e.w=e.v,(e.d=e.d+362437|0)+(e.v=e.v^e.v<<4^t^t<<1)|0},e.x=0,e.y=0,e.z=0,e.w=0,e.v=0,t===(0|t)?e.x=t:r+=t;for(var s=0;s>>4),e.next()}function n(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e.v=t.v,e.d=t.d,e}function i(t,e){var r=new s(t),i=e&&e.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},a.int32=r.next,a.quick=a,i&&("object"==typeof i&&n(i,r),a.state=function(){return n(r,{})}),a}e&&e.exports?e.exports=i:r&&r.amd?r((function(){return i})):this.xorwow=i}(0,t,!1)})),x=p((function(t){!function(t,e,r){function s(t){var e=this;e.next=function(){var t,r,s=e.x,n=e.i;return t=s[n],r=(t^=t>>>7)^t<<24,r^=(t=s[n+1&7])^t>>>10,r^=(t=s[n+3&7])^t>>>3,r^=(t=s[n+4&7])^t<<7,t=s[n+7&7],r^=(t^=t<<13)^t<<9,s[n]=r,e.i=n+1&7,r},function(t,e){var r,s=[];if(e===(0|e))s[0]=e;else for(e=""+e,r=0;r0;--r)t.next()}(e,t)}function n(t,e){return e.x=t.x.slice(),e.i=t.i,e}function i(t,e){null==t&&(t=+new Date);var r=new s(t),i=e&&e.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},a.int32=r.next,a.quick=a,i&&(i.x&&n(i,r),a.state=function(){return n(r,{})}),a}e&&e.exports?e.exports=i:r&&r.amd?r((function(){return i})):this.xorshift7=i}(0,t,!1)})),v=p((function(t){!function(t,e,r){function s(t){var e=this;e.next=function(){var t,r,s=e.w,n=e.X,i=e.i;return e.w=s=s+1640531527|0,r=n[i+34&127],t=n[i=i+1&127],r^=r<<13,t^=t<<17,r^=r>>>15,t^=t>>>12,r=n[i]=r^t,e.i=i,r+(s^s>>>16)|0},function(t,e){var r,s,n,i,a,o=[],u=128;for(e===(0|e)?(s=e,e=null):(e+="\0",s=0,u=Math.max(u,e.length)),n=0,i=-32;i>>15,s^=s<<4,s^=s>>>13,i>=0&&(a=a+1640531527|0,n=0==(r=o[127&i]^=s+a)?n+1:0);for(n>=128&&(o[127&(e&&e.length||0)]=-1),n=127,i=512;i>0;--i)s=o[n+34&127],r=o[n=n+1&127],s^=s<<13,r^=r<<17,s^=s>>>15,r^=r>>>12,o[n]=s^r;t.w=a,t.X=o,t.i=n}(e,t)}function n(t,e){return e.i=t.i,e.w=t.w,e.X=t.X.slice(),e}function i(t,e){null==t&&(t=+new Date);var r=new s(t),i=e&&e.state,a=function(){return(r.next()>>>0)/4294967296};return a.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},a.int32=r.next,a.quick=a,i&&(i.X&&n(i,r),a.state=function(){return n(r,{})}),a}e&&e.exports?e.exports=i:r&&r.amd?r((function(){return i})):this.xor4096=i}(0,t,!1)})),b=p((function(t){!function(t,e,r){function s(t){var e=this,r="";e.next=function(){var t=e.b,r=e.c,s=e.d,n=e.a;return t=t<<25^t>>>7^r,r=r-s|0,s=s<<24^s>>>8^n,n=n-t|0,e.b=t=t<<20^t>>>12^r,e.c=r=r-s|0,e.d=s<<16^r>>>16^n,e.a=n-t|0},e.a=0,e.b=0,e.c=-1640531527,e.d=1367130551,t===Math.floor(t)?(e.a=t/4294967296|0,e.b=0|t):r+=t;for(var s=0;s>>0)/4294967296};return a.double=function(){do{var t=((r.next()>>>11)+(r.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},a.int32=r.next,a.quick=a,i&&("object"==typeof i&&n(i,r),a.state=function(){return n(r,{})}),a}e&&e.exports?e.exports=i:r&&r.amd?r((function(){return i})):this.tychei=i}(0,t,!1)})),C=p((function(t){!function(e,r){var s,n=this,i=256,a=r.pow(i,6),o=r.pow(2,52),u=2*o,h=255;function l(t,h,l){var w=[],y=d(m((h=1==h?{entropy:!0}:h||{}).entropy?[t,p(e)]:null==t?function(){try{var t;return s&&(t=s.randomBytes)?t=t(i):(t=new Uint8Array(i),(n.crypto||n.msCrypto).getRandomValues(t)),p(t)}catch(t){var r=n.navigator,a=r&&r.plugins;return[+new Date,n,a,n.screen,p(e)]}}():t,3),w),g=new c(w),x=function(){for(var t=g.g(6),e=a,r=0;t=u;)t/=2,e/=2,r>>>=1;return(t+r)/e};return x.int32=function(){return 0|g.g(4)},x.quick=function(){return g.g(4)/4294967296},x.double=x,d(p(g.S),e),(h.pass||l||function(t,e,s,n){return n&&(n.S&&f(n,g),t.state=function(){return f(g,{})}),s?(r.random=t,e):t})(x,y,"global"in h?h.global:this==r,h.state)}function c(t){var e,r=t.length,s=this,n=0,a=s.i=s.j=0,o=s.S=[];for(r||(t=[r++]);nt[i])),e,r);n[i]=s}return r.delete(s),n}throw new Error(`Can't recurse into non-iterable type: ${s}`)}return n.value}function T(t){return null===t?null:k(t[0])?{value:null,recurse:!0}:{value:t,recurse:!1}}async function F(t,r){const s=new Map;A(t,r,s);for(const t of Array.from(s.keys())){const r=s.get(t);if(e.isPromise(r)){const e=await r;s.set(t,e)}}return A(t,r,s)}function k(e){return null!=e&&!ArrayBuffer.isView(e)&&(Array.isArray(e)||"object"==typeof e&&!(e instanceof t))}function N(t){return A(t,I)}function I(e){return e instanceof t?{value:e.clone(),recurse:!1}:k(e)?{value:null,recurse:!0}:{value:e,recurse:!1}}class D{constructor(t){if(this.capacity=t,this.begin=0,this.end=0,null==t)throw new RangeError("Can't create a ring buffer of unknown capacity.");if(t<1)throw new RangeError("Can't create ring buffer of capacity < 1.");this.data=new Array(t),this.doubledCapacity=2*t}wrap(t){for(;t<0;)t+=this.doubledCapacity;return t%this.doubledCapacity}get(t){if(t<0)throw new RangeError("Can't get item at a negative index.");return this.data[t%this.capacity]}set(t,e){if(t<0)throw new RangeError("Can't set item at a negative index.");this.data[t%this.capacity]=e}length(){let t=this.end-this.begin;return t<0&&(t=this.doubledCapacity+t),t}isFull(){return this.length()===this.capacity}isEmpty(){return 0===this.length()}push(t){if(this.isFull())throw new RangeError("Ring buffer is full.");this.set(this.end,t),this.end=this.wrap(this.end+1)}pushAll(t){for(const e of t)this.push(e)}pop(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");this.end=this.wrap(this.end-1);const t=this.get(this.end);return this.set(this.end,void 0),t}unshift(t){if(this.isFull())throw new RangeError("Ring buffer is full.");this.begin=this.wrap(this.begin-1),this.set(this.begin,t)}shift(){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");const t=this.get(this.begin);return this.set(this.begin,void 0),this.begin=this.wrap(this.begin+1),t}shuffleExcise(t){if(this.isEmpty())throw new RangeError("Ring buffer is empty.");const e=this.wrap(this.begin+t),r=this.get(e);return this.set(e,this.pop()),r}}class M extends D{constructor(){super(M.INITIAL_CAPACITY)}isFull(){return!1}push(t){super.isFull()&&this.expand(),super.push(t)}unshift(t){super.isFull()&&this.expand(),super.unshift(t)}expand(){const t=2*this.capacity,e=new Array(t),r=this.length();for(let t=0;t!0===t))}rowMajorBatch(t,e=!0){return new W(this,t,e)}columnMajorBatch(t,e=!0,r=T){return this.rowMajorBatch(t,e).map((t=>S(t,r)))}concatenate(t,e){return new Z(O([this,t]),e)}take(t){return t<0||null==t?this:new P(this,t)}skip(t){return t<0||null==t?this:new L(this,t)}prefetch(t){return new Y(this,t)}shuffle(t,e){return new K(this,t,e)}serial(){return new B(this)}}class H extends j{constructor(t){super(),this.items=t,this.trav=0}summary(){return`Array of ${this.items.length} items`}async next(){if(this.trav>=this.items.length)return{value:null,done:!0};const t=this.items[this.trav];return this.trav++,{value:N(t),done:!1}}}class q extends j{constructor(t){super(),this.nextFn=t}summary(){return"Function call"}async next(){try{return this.nextFn()}catch(t){throw t.message=`Error thrown while iterating through a dataset: ${t.message}`,t}}}class B extends j{constructor(t){super(),this.upstream=t,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Serial`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){return this.upstream.next()}}class L extends j{constructor(t,e){super(),this.upstream=t,this.maxCount=e,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Skip`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;this.count++ Take`}async next(){return this.count++>=this.maxCount?{value:null,done:!0}:this.upstream.next()}}class W extends j{constructor(t,e,r=!0){super(),this.upstream=t,this.batchSize=e,this.enableSmallLastBatch=r,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> RowMajorBatch`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){const t=[];for(;t.length0?{value:t,done:!1}:{value:null,done:!0};t.push(e.value)}return{value:t,done:!1}}}class V extends j{constructor(t,e){super(),this.upstream=t,this.predicate=e,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> Filter`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;;){const t=await this.upstream.next();if(t.done||this.predicate(t.value))return t;r(t.value)}}}class U extends j{constructor(t,e){super(),this.upstream=t,this.transform=e}summary(){return`${this.upstream.summary()} -> Map`}async next(){const t=await this.upstream.next();if(t.done)return{value:null,done:!0};const e=s.getTensorsInContainer(t.value),r=this.transform(t.value),n=s.getTensorsInContainer(r);for(const t of e)s.isTensorInList(t,n)||t.dispose();return{value:r,done:!1}}}class Q extends j{constructor(t,e){super(),this.upstream=t,this.handler=e,this.count=0,this.lastRead=Promise.resolve({value:null,done:!1})}summary(){return`${this.upstream.summary()} -> handleErrors`}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;;)try{return await this.upstream.next()}catch(t){if(!this.handler(t))return{value:null,done:!0}}}}class _ extends j{constructor(t,e){super(),this.upstream=t,this.transform=e}summary(){return`${this.upstream.summary()} -> AsyncMap`}async next(){const t=await this.upstream.next();if(t.done)return{value:null,done:!0};const e=s.getTensorsInContainer(t.value),r=await this.transform(t.value),n=s.getTensorsInContainer(r);for(const t of e)s.isTensorInList(t,n)||t.dispose();return{value:r,done:!1}}}class X extends j{constructor(){super(),this.outputQueue=new M,this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}async serialNext(){for(;0===this.outputQueue.length();)if(!await this.pump())return{value:null,done:!0};return{value:this.outputQueue.shift(),done:!1}}}class G extends X{constructor(t,e){super(),this.upstream=t,this.transform=e}summary(){return`${this.upstream.summary()} -> Flatmap`}async pump(){const t=await this.upstream.next();if(t.done)return!1;const e=s.getTensorsInContainer(t.value),r=this.transform(t.value),n=s.getTensorsInContainer(r);this.outputQueue.pushAll(r);for(const t of e)s.isTensorInList(t,n)||t.dispose();return!0}}class Z extends j{constructor(t,e){super(),this.baseErrorHandler=e,this.lastRead=null,this.iterator=null,this.moreIterators=t}summary(){return"TODO: fill in upstream of chained summaries -> Chained"}async next(){return this.lastRead=this.readFromChain(this.lastRead),this.lastRead}async readFromChain(t){if(await t,null==this.iterator){const t=await this.moreIterators.next();if(t.done)return{value:null,done:!0};this.iterator=t.value,null!=this.baseErrorHandler&&(this.iterator=this.iterator.handleErrors(this.baseErrorHandler))}const e=await this.iterator.next();return e.done?(this.iterator=null,this.readFromChain(t)):e}}!function(t){t[t.FAIL=0]="FAIL",t[t.SHORTEST=1]="SHORTEST",t[t.LONGEST=2]="LONGEST"}(z||(z={}));class J extends j{constructor(t,e=z.FAIL){super(),this.iterators=t,this.mismatchMode=e,this.count=0,this.currentPromise=null}summary(){return"{TODO: fill in upstream of zip summaries} -> Zip"}async nextState(t){await t;let e=0,r=0;const s=await F(this.iterators,(function(t){if(t instanceof j){return{value:t.next().then((t=>(e++,t.done&&r++,t.value))),recurse:!1}}return{value:null,recurse:!0}}));if(e===r)return{value:null,done:!0};if(r>0)switch(this.mismatchMode){case z.FAIL:throw new Error(`Zipped streams should have the same length. Mismatched at element ${this.count}.`);case z.SHORTEST:return{value:null,done:!0};case z.LONGEST:}return this.count++,{value:s,done:!1}}async next(){return this.currentPromise=this.nextState(this.currentPromise),this.currentPromise}}class Y extends j{constructor(t,e){super(),this.upstream=t,this.bufferSize=e,this.buffer=new D(e)}summary(){return`${this.upstream.summary()} -> Prefetch`}refill(){for(;!this.buffer.isFull();){const t=this.upstream.next();this.buffer.push(t)}}next(){return this.refill(),this.buffer.shift()}}class K extends Y{constructor(t,r,s){super(t,r),this.upstream=t,this.windowSize=r,this.upstreamExhausted=!1,this.random=E(s||e.now().toString()),this.lastRead=Promise.resolve({value:null,done:!1})}async next(){return this.lastRead=this.lastRead.then((()=>this.serialNext())),this.lastRead}randomInt(t){return Math.floor(this.random()*t)}chooseIndex(){return this.randomInt(this.buffer.length())}async serialNext(){for(this.upstreamExhausted||this.refill();!this.buffer.isEmpty();){const t=this.chooseIndex(),e=await this.buffer.shuffleExcise(t);if(!e.done)return this.refill(),e;this.upstreamExhausted=!0}return{value:null,done:!0}}}class tt{constructor(){this.size=null}batch(t,r=!0){const s=this;let n;return e.assert(t>0,(()=>`batchSize needs to be positive, but it is\n ${t}`)),n=this.size===1/0||null==this.size?this.size:r?Math.ceil(this.size/t):Math.floor(this.size/t),et((async()=>(await s.iterator()).columnMajorBatch(t,r,nt)),n)}concatenate(t){const e=this;let r;return r=this.size===1/0||t.size===1/0?1/0:null!=this.size&&null!=t.size?this.size+t.size:null,et((async()=>(await e.iterator()).concatenate(await t.iterator())),r)}filter(t){const e=this;let r;return r=this.size===1/0?1/0:null,et((async()=>(await e.iterator()).filter((e=>n((()=>t(e)))))),r)}async forEachAsync(t){return(await this.iterator()).forEachAsync(t)}map(t){const e=this;return et((async()=>(await e.iterator()).map((e=>n((()=>t(e)))))),this.size)}mapAsync(t){const e=this;return et((async()=>(await e.iterator()).mapAsync(t)),this.size)}prefetch(t){if(null==t)throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified.");const e=this;return et((async()=>(await e.iterator()).prefetch(t)),this.size)}repeat(t){const e=this;let r;return r=null!=this.size&&t>0?this.size*t:0===t?0:null!=this.size&&(void 0===t||t<0)?1/0:null,et((async()=>{const r=$((async()=>({value:await e.iterator(),done:!1})));return s=r.take(t),new Z(s,n);var s,n}),r)}skip(t){const e=this;let r;return r=null!=this.size&&t>=0&&this.size>=t?this.size-t:null!=this.size&&(this.size(await e.iterator()).skip(t)),r)}shuffle(t,r,s=!0){if(null==t||t<0)throw null==this.size?new RangeError("`Dataset.shuffle()` requires bufferSize to be specified."):new RangeError(`\`Dataset.shuffle()\` requires bufferSize to be specified. If your data fits in main memory (for regular JS objects), and/or GPU memory (for \`tf.Tensor\`s), consider setting bufferSize to the dataset size (${this.size} elements)`);const n=this,i=E(r||e.now().toString());return et((async()=>{let e=i.int32();return s&&(e+=i.int32()),(await n.iterator()).shuffle(t,e.toString())}),this.size)}take(t){const e=this;let r;return r=null!=this.size&&this.size>t?t:null!=this.size&&this.size<=t?this.size:null,et((async()=>(await e.iterator()).take(t)),r)}async toArray(){if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArray()}async toArrayForTest(){if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return(await this.iterator()).toArrayForTest()}}function et(t,e=null){return new class extends tt{constructor(){super(...arguments),this.size=e}async iterator(){return t()}}}function rt(t){return et((async()=>O(t)),t.length)}function st(t){if(!k(t))throw new Error("The argument to zip() must be an object or array.");let e;if(Array.isArray(t))for(let r=0;rfunction(t,e=z.FAIL){return new J(t,e)}(await F(t,(t=>{if(t instanceof tt)return{value:t.iterator(),recurse:!1};if(k(t))return{value:null,recurse:!0};throw new Error("Leaves of the structure passed to zip() must be Datasets, not primitives.")})),z.SHORTEST)),e)}function nt(r){if(null===r)return null;const s=r[0];if(null==(n=s)||null===(o=n)||"object"!=typeof o&&"function"!=typeof o||Array.isArray(n)||"object"==typeof n&&n instanceof t||e.isTypedArray(n)){return{value:function(e){if(0===e.length)throw new Error("Can't make a batch of zero elements.");return e[0]instanceof t?i(e):a(e)}(r),recurse:!1}}var n,o;return{value:null,recurse:!0}}tt.MAX_BUFFER_SIZE=1e4;class it extends tt{constructor(t){super(),this.input=t}async iterator(){return(await this.input.iterator()).decodeUTF8().split("\n").map((t=>(t.endsWith("\r")&&(t=t.slice(0,-1)),t)))}}const at=Symbol("out"),ot=Symbol("field"),ut=Symbol("quote"),ht=Symbol("quoteafterquote"),lt=Symbol("quoteinquote");class ct extends tt{constructor(t,r){super(),this.input=t,this.hasHeader=!0,this.fullColumnNames=null,this.columnNamesValidated=!1,this.columnConfigs=null,this.configuredColumnsOnly=!1,this.delimiter=",",this.delimWhitespace=!1,this.base=new it(t),r||(r={}),this.hasHeader=!1!==r.hasHeader,this.fullColumnNames=r.columnNames,this.columnConfigs=r.columnConfigs,this.configuredColumnsOnly=r.configuredColumnsOnly,r.delimWhitespace?(e.assert(null==r.delimiter,(()=>"Delimiter should not be provided when delimWhitespace is true.")),this.delimWhitespace=!0,this.delimiter=" "):this.delimiter=r.delimiter?r.delimiter:","}async columnNames(){return this.columnNamesValidated||await this.setColumnNames(),this.configuredColumnsOnly?Object.keys(this.columnConfigs):this.fullColumnNames}async setColumnNames(){const t=await this.maybeReadHeaderLine();if(!this.fullColumnNames&&!t)throw new Error("Column names must be provided if there is no header line.");this.fullColumnNames&&t&&e.assert(t.length===this.fullColumnNames.length,(()=>"The length of provided columnNames ("+this.fullColumnNames.length.toString()+") does not match the length of the header line read from file ("+t.length.toString()+").")),this.fullColumnNames||(this.fullColumnNames=t);const r=this.fullColumnNames.reduce(((t,e)=>(t[e]=t[e]+1||1,t)),{}),s=Object.keys(r).filter((t=>r[t]>1));if(e.assert(0===s.length,(()=>"Duplicate column names found: "+s.toString())),this.columnConfigs)for(const t of Object.keys(this.columnConfigs)){if(-1===this.fullColumnNames.indexOf(t))throw new Error('The key "'+t+'" provided in columnConfigs does not match any of the column names ('+this.fullColumnNames.toString()+").")}this.columnNamesValidated=!0}async maybeReadHeaderLine(){if(this.hasHeader){const t=await this.base.iterator(),e=await t.next();if(e.done)throw new Error("No data was found for CSV parsing.");const r=e.value;return this.parseRow(r,!1)}return null}async iterator(){this.columnNamesValidated||await this.setColumnNames();let t=await this.base.iterator();return this.hasHeader&&(t=t.skip(1)),t.map((t=>this.makeDataElement(t)))}makeDataElement(t){const e=this.parseRow(t),r={},s={};for(let n=0;n14||!Number.isInteger(e))throw new Error(`Invalid fftSize: it must be a power of 2 between 2 to 4 and 2 to 14, but got ${this.fftSize}`);if(this.numFrames=t.numFramesPerSpectrogram||43,this.sampleRateHz=t.sampleRateHz,this.columnTruncateLength=t.columnTruncateLength||this.fftSize,this.audioTrackConstraints=t.audioTrackConstraints,this.smoothingTimeConstant=t.smoothingTimeConstant||0,this.includeSpectrogram=!1!==t.includeSpectrogram,this.includeWaveform=!0===t.includeWaveform,!this.includeSpectrogram&&!this.includeWaveform)throw new Error("Both includeSpectrogram and includeWaveform are false. At least one type of data should be returned.")}summary(){return"microphone"}static async create(t={}){if(o().get("IS_NODE"))throw new Error("microphone API is only supported in browser environment.");const e=new ft(t);return await e.start(),e}async start(){try{this.stream=await navigator.mediaDevices.getUserMedia({audio:null==this.audioTrackConstraints||this.audioTrackConstraints,video:!1})}catch(t){throw new Error(`Error thrown while initializing video stream: ${t.message}`)}if(!this.stream)throw new Error("Could not obtain audio from microphone.");const t=window.AudioContext||window.webkitAudioContext;if(this.audioContext=new t,this.sampleRateHz){if(this.audioContext.sampleRate!==this.sampleRateHz)throw new Error(`Mismatch in sampling rate: Expected: ${this.sampleRateHz}; Actual: ${this.audioContext.sampleRate}`)}else this.sampleRateHz=this.audioContext.sampleRate;const e=this.audioContext.createMediaStreamSource(this.stream);this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=2*this.fftSize,this.analyser.smoothingTimeConstant=this.smoothingTimeConstant,e.connect(this.analyser),this.freqData=new Float32Array(this.fftSize),this.timeData=new Float32Array(this.fftSize)}async next(){if(this.isClosed)return{value:null,done:!0};let t,e;const r=await this.getAudioData();if(this.includeSpectrogram){const e=this.flattenQueue(r.freqDataQueue);t=this.getTensorFromAudioDataArray(e,[this.numFrames,this.columnTruncateLength,1])}if(this.includeWaveform){const t=this.flattenQueue(r.timeDataQueue);e=this.getTensorFromAudioDataArray(t,[this.numFrames*this.fftSize,1])}return{value:{spectrogram:t,waveform:e},done:!1}}async capture(){return(await this.next()).value}async getAudioData(){const t=[],e=[];let r=0;return new Promise((s=>{const n=setInterval((()=>{this.includeSpectrogram&&(this.analyser.getFloatFrequencyData(this.freqData),this.freqData[0]===-1/0&&s({freqDataQueue:t,timeDataQueue:e}),t.push(this.freqData.slice(0,this.columnTruncateLength))),this.includeWaveform&&(this.analyser.getFloatTimeDomainData(this.timeData),e.push(this.timeData.slice())),++r===this.numFrames&&(clearInterval(n),s({freqDataQueue:t,timeDataQueue:e}))}),this.fftSize/this.sampleRateHz*1e3)}))}stop(){this.isClosed||(this.isClosed=!0,this.analyser.disconnect(),this.audioContext.close(),null!=this.stream&&this.stream.getTracks().length>0&&this.stream.getTracks()[0].stop())}toArray(){throw new Error("Can not convert infinite audio stream to array.")}getSampleRate(){return this.sampleRateHz}flattenQueue(t){const e=t[0].length,r=new Float32Array(t.length*e);return t.forEach(((t,s)=>r.set(t,s*e))),r}getTensorFromAudioDataArray(t,r){const s=new Float32Array(e.sizeFromShape(r));return s.set(t,s.length-t.length),a(s,r)}}class mt extends j{constructor(t,e){if(super(),this.webcamVideoElement=t,this.webcamConfig=e,this.isClosed=!0,this.resize=!1,this.needToResize())if(this.resize=!0,this.cropSize=[this.webcamConfig.resizeHeight,this.webcamConfig.resizeWidth],this.cropBoxInd=u([0],"int32"),this.webcamConfig.centerCrop){const t=1*this.webcamConfig.resizeWidth/this.webcamVideoElement.width,e=1*this.webcamConfig.resizeHeight/this.webcamVideoElement.height,r=(1-t)/2,s=(1-e)/2,n=r+t,i=e+s;this.cropBox=h([s,r,i,n],[1,4])}else this.cropBox=h([0,0,1,1],[1,4])}summary(){return"webcam"}static async create(t,e={}){if(o().get("IS_NODE"))throw new Error("tf.data.webcam is only supported in browser environment.");if(!t){if(t=document.createElement("video"),!e.resizeWidth||!e.resizeHeight)throw new Error("Please provide webcam video element, or resizeWidth and resizeHeight to create a hidden video element.");t.width=e.resizeWidth,t.height=e.resizeHeight}const r=new mt(t,e);return await r.start(),r}async start(){this.webcamConfig.facingMode&&e.assert("user"===this.webcamConfig.facingMode||"environment"===this.webcamConfig.facingMode,(()=>`Invalid webcam facing mode: ${this.webcamConfig.facingMode}. Please provide 'user' or 'environment'`));try{this.stream=await navigator.mediaDevices.getUserMedia({video:{deviceId:this.webcamConfig.deviceId,facingMode:this.webcamConfig.facingMode?this.webcamConfig.facingMode:"user",width:this.webcamVideoElement.width,height:this.webcamVideoElement.height}})}catch(t){throw t.message=`Error thrown while initializing video stream: ${t.message}`,t}if(!this.stream)throw new Error("Could not obtain video from webcam.");try{this.webcamVideoElement.srcObject=this.stream}catch(t){console.log(t),this.webcamVideoElement.src=window.URL.createObjectURL(this.stream)}return this.webcamVideoElement.play(),this.isClosed=!1,new Promise((t=>{this.webcamVideoElement.onloadedmetadata=()=>{t()}}))}async next(){if(this.isClosed)return{value:null,done:!0};let t;try{t=l.fromPixels(this.webcamVideoElement)}catch(t){throw new Error(`Error thrown converting video to pixels: ${JSON.stringify(t)}`)}if(!this.resize)return{value:t,done:!1};try{return{value:this.cropAndResizeFrame(t),done:!1}}catch(t){throw new Error(`Error thrown cropping the video: ${t.message}`)}finally{t.dispose()}}needToResize(){return!(!this.webcamConfig.resizeWidth||!this.webcamConfig.resizeHeight||this.webcamVideoElement.width===this.webcamConfig.resizeWidth&&this.webcamVideoElement.height===this.webcamConfig.resizeHeight)}cropAndResizeFrame(t){return n((()=>{const e=c(f(t,"float32"),0);let r;r=m.cropAndResize(e,this.cropBox,this.cropBoxInd,this.cropSize,"bilinear");const s=r.shape;return d(r,s.slice(1))}))}async capture(){return(await this.next()).value}stop(){this.stream.getTracks().forEach((t=>t.stop()));try{this.webcamVideoElement.srcObject=null}catch(t){console.log(t),this.webcamVideoElement.src=null}this.isClosed=!0}toArray(){throw new Error("Can not convert infinite video stream to array.")}}class dt{}class pt extends j{split(t){return new wt(this,t)}}class wt extends pt{constructor(t,e){super(),this.upstream=t,this.impl=new yt(t,e)}summary(){return this.impl.summary()}async next(){return this.impl.next()}}class yt extends X{constructor(t,e){super(),this.upstream=t,this.separator=e,this.carryover=""}summary(){return`${this.upstream.summary()} -> Split('${this.separator}')`}async pump(){const t=await this.upstream.next();if(t.done)return""!==this.carryover&&(this.outputQueue.push(this.carryover),this.carryover="",!0);const e=t.value.split(this.separator);e[0]=this.carryover+e[0];for(const t of e.slice(0,-1))this.outputQueue.push(t);return this.carryover=e[e.length-1],!0}}class gt extends j{decodeUTF8(){return new xt(this)}}class xt extends pt{constructor(t){super(),this.upstream=t,this.impl=new vt(t)}summary(){return this.impl.summary()}async next(){return this.impl.next()}}class vt extends X{constructor(t){if(super(),this.upstream=t,o().get("IS_BROWSER"))this.decoder=new TextDecoder("utf-8");else{const{StringDecoder:t}=require("string_decoder");this.decoder=new t("utf8")}}summary(){return`${this.upstream.summary()} -> Utf8`}async pump(){const t=await this.upstream.next();let e,r;return!t.done&&(e=t.value,r=o().get("IS_BROWSER")?this.decoder.decode(e,{stream:!0}):this.decoder.write(Buffer.from(e.buffer)),this.outputQueue.push(r),!0)}}class bt extends gt{constructor(t,r={}){super(),this.file=t,this.options=r,e.assert(t instanceof Uint8Array||!!o().get("IS_BROWSER")&&(t instanceof File||t instanceof Blob),(()=>"FileChunkIterator only supports File, Blob and Uint8Array right now.")),this.offset=r.offset||0,this.chunkSize=r.chunkSize||1048576}summary(){return`FileChunks ${this.file}`}async next(){if(this.offset>=(this.file instanceof Uint8Array?this.file.byteLength:this.file.size))return{value:null,done:!0};const t=new Promise(((t,e)=>{const r=this.offset+this.chunkSize;if(this.file instanceof Uint8Array)t(new Uint8Array(this.file.slice(this.offset,r)));else{const s=new FileReader;s.onload=r=>{let n=s.result;if(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),!(n instanceof Uint8Array))return e(new TypeError("FileReader returned unknown type."));t(n)},s.onabort=t=>e(new Error("Aborted")),s.onerror=t=>e(new Error(t.type));const n=this.file.slice(this.offset,r);s.readAsArrayBuffer(n)}this.offset=r}));return{value:await t,done:!1}}}const Ct=t=>({method:t.method,headers:t.headers,body:t.body,mode:t.mode,credentials:t.credentials,cache:t.cache,redirect:t.redirect,referrer:t.referrer,integrity:t.integrity});function zt(t){return"string"==typeof t&&"file://"===t.substr(0,7)}class Et extends dt{constructor(t,e={}){super(),this.input=t,this.options=e}async iterator(){if(zt(this.input)&&o().get("IS_NODE")){const t=require("fs");this.input=t.readFileSync(this.input.substr(7))}return new bt(this.input,this.options)}}class At extends dt{constructor(t,e={}){super(),this.url=t,this.fileOptions=e}async iterator(){return zt(this.url)?new Et(this.url,this.fileOptions).iterator():async function(t,r={}){let s,n;"string"==typeof t?s=t:(s=t.url,n=Ct(t));const i=await e.fetch(s,n);if(i.ok){const t=new Uint8Array(await i.arrayBuffer());return new bt(t,r)}throw new Error(i.statusText)}(this.url,this.fileOptions)}}function St(t,e={}){return new ct(new At(t),e)}function Rt(t){const e=$(t);return et((async()=>e))}function Tt(t){return et((async()=>{const e=await t();return $((()=>e.next()))}))}async function Ft(t,e){return mt.create(t,e)}async function kt(t){return ft.create(t)}const Nt="3.6.0";export{ct as CSVDataset,tt as Dataset,Et as FileDataSource,it as TextLineDataset,At as URLDataSource,rt as array,St as csv,Rt as func,Tt as generator,kt as microphone,Nt as version_data,Ft as webcam,st as zip}; -//# sourceMappingURL=tf-data.fesm.min.js.map diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.fesm.min.js.html b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.fesm.min.js.html deleted file mode 100644 index 740e7d550..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.fesm.min.js.html +++ /dev/null @@ -1,3229 +0,0 @@ - - - - - - - RollUp Visualizer - - - - -
- - - - diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.fesm.min.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.fesm.min.js.map deleted file mode 100644 index e97ec19c4..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.fesm.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tf-data.fesm.min.js","sources":["../node_modules/seedrandom/lib/alea.js","../node_modules/seedrandom/lib/xor128.js","../node_modules/seedrandom/lib/xorwow.js","../node_modules/seedrandom/lib/xorshift7.js","../node_modules/seedrandom/lib/xor4096.js","../node_modules/seedrandom/lib/tychei.js","../node_modules/seedrandom/seedrandom.js","../node_modules/seedrandom/index.js","../src/iterators/lazy_iterator.ts","../src/util/deep_map.ts","../src/util/deep_clone.ts","../src/util/ring_buffer.ts","../src/util/growing_ring_buffer.ts","../src/dataset.ts","../src/datasets/text_line_dataset.ts","../src/datasets/csv_dataset.ts","../src/iterators/microphone_iterator.ts","../src/iterators/webcam_iterator.ts","../src/datasource.ts","../src/iterators/string_iterator.ts","../src/iterators/byte_chunk_iterator.ts","../src/iterators/file_chunk_iterator.ts","../src/iterators/url_chunk_iterator.ts","../src/util/source_util.ts","../src/sources/file_data_source.ts","../src/sources/url_data_source.ts","../src/readers.ts","../src/version.ts"],"sourcesContent":["// A port of an algorithm by Johannes Baagøe , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baagøe \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xorshift7\" algorithm by\n// François Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n","// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n","// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","/*\nCopyright 2014 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\nvar global = this,\n width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\nmath['seed' + rngname] = seedrandom;\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n}\n\n// End anonymous scope, and pass initial values.\n})(\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n","// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by François Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport * as seedrandom from 'seedrandom';\n\nimport {Container} from '../types';\nimport {deepClone} from '../util/deep_clone';\nimport {deepMapAndAwaitAll, DeepMapAsyncResult, DeepMapResult, deepZip, zipToList} from '../util/deep_map';\nimport {GrowingRingBuffer} from '../util/growing_ring_buffer';\nimport {RingBuffer} from '../util/ring_buffer';\n\n/**\n * A nested structure of LazyIterators, used as the input to zip().\n */\nexport type IteratorContainer = Container>;\n\n// Here we implement a simple asynchronous iterator.\n// This lets us avoid using either third-party stream libraries or\n// recent TypeScript language support requiring polyfills.\n\n/**\n * Create a `LazyIterator` from an array of items.\n */\nexport function iteratorFromItems(items: T[]): LazyIterator {\n return new ArrayIterator(items);\n}\n\n/**\n * Create a `LazyIterator` of incrementing integers.\n */\nexport function iteratorFromIncrementing(start: number): LazyIterator {\n let i = start;\n return iteratorFromFunction(() => ({value: i++, done: false}));\n}\n\n/**\n * Create a `LazyIterator` from a function.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const iter = tf.data.iteratorFromFunction(func);\n * await iter.forEachAsync(e => console.log(e));\n * ```\n *\n * @param func A function that produces data on each call.\n */\nexport function iteratorFromFunction(\n func: () =>\n IteratorResult| Promise>): LazyIterator {\n return new FunctionCallIterator(func);\n}\n\n/**\n * Create a `LazyIterator` by concatenating underlying streams, which are\n * themselves provided as a stream.\n *\n * This can also be thought of as a \"stream flatten\" operation.\n *\n * @param baseIterators A stream of streams to be concatenated.\n * @param baseErrorHandler An optional function that can intercept `Error`s\n * raised during a `next()` call on the base stream. This function can decide\n * whether the error should be propagated, whether the error should be\n * ignored, or whether the base stream should be terminated.\n */\nexport function iteratorFromConcatenated(\n baseIterators: LazyIterator>,\n baseErrorHandler?: (e: Error) => boolean): LazyIterator {\n return new ChainedIterator(baseIterators, baseErrorHandler);\n}\n\n/**\n * Create a `LazyIterator` by concatenating streams produced by calling a\n * stream-generating function a given number of times.\n *\n * Since a `LazyIterator` is read-once, it cannot be repeated, but this\n * function can be used to achieve a similar effect:\n *\n * LazyIterator.ofConcatenatedFunction(() => new MyIterator(), 6);\n *\n * @param iteratorFunc: A function that produces a new stream on each call.\n * @param count: The number of times to call the function.\n * @param baseErrorHandler An optional function that can intercept `Error`s\n * raised during a `next()` call on the base stream. This function can decide\n * whether the error should be propagated, whether the error should be\n * ignored, or whether the base stream should be terminated.\n */\nexport function iteratorFromConcatenatedFunction(\n iteratorFunc: () => IteratorResult>, count: number,\n baseErrorHandler?: (e: Error) => boolean): LazyIterator {\n return iteratorFromConcatenated(\n iteratorFromFunction(iteratorFunc).take(count), baseErrorHandler);\n}\n\n/**\n * Create a `LazyIterator` by zipping together an array, dict, or nested\n * structure of `LazyIterator`s (and perhaps additional constants).\n *\n * The underlying streams must provide elements in a consistent order such\n * that they correspond.\n *\n * Typically, the underlying streams should have the same number of\n * elements. If they do not, the behavior is determined by the\n * `mismatchMode` argument.\n *\n * The nested structure of the `iterators` argument determines the\n * structure of elements in the resulting iterator.\n *\n * @param iterators: An array or object containing LazyIterators at the\n * leaves.\n * @param mismatchMode: Determines what to do when one underlying iterator\n * is exhausted before the others. `ZipMismatchMode.FAIL` (the default)\n * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST`\n * causes the zipped iterator to terminate with the furst underlying\n * streams, so elements remaining on the longer streams are ignored.\n * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling\n * in nulls for the exhausted streams, until all streams are exhausted.\n */\nexport function iteratorFromZipped(\n iterators: IteratorContainer,\n mismatchMode: ZipMismatchMode = ZipMismatchMode.FAIL): LazyIterator {\n return new ZipIterator(iterators, mismatchMode);\n}\n\n/**\n * An asynchronous iterator, providing lazy access to a potentially\n * unbounded stream of elements.\n *\n * Iterator can be obtained from a dataset:\n * `const iter = await dataset.iterator();`\n */\nexport abstract class LazyIterator {\n // This class implements AsyncIterator, but we have not yet set the\n // TypeScript --downlevelIteration flag to enable that.\n\n abstract summary(): string;\n\n /**\n * Returns a `Promise` for the next element in the stream.\n *\n * When an item can be provided successfully, the return value is\n * `{value:T, done:false}`.\n *\n * Calling next() on a closed stream returns `{value:null, done:true}`.\n */\n abstract async next(): Promise>;\n\n /**\n * Collect all remaining elements of a bounded stream into an array.\n * Obviously this will succeed only for small streams that fit in memory.\n * Useful for testing.\n *\n * @returns A Promise for an array of stream elements, which will resolve\n * when the stream is exhausted.\n */\n async toArray(): Promise {\n const result: T[] = [];\n let x = await this.next();\n while (!x.done) {\n result.push(x.value);\n x = await this.next();\n }\n return result;\n }\n\n /**\n * Collect all elements of this dataset into an array with prefetching 100\n * elements. This is useful for testing, because the prefetch changes the\n * order in which the Promises are resolved along the processing pipeline.\n * This may help expose bugs where results are dependent on the order of\n * Promise resolution rather than on the logical order of the stream (i.e.,\n * due to hidden mutable state).\n *\n * @returns A Promise for an array of stream elements, which will resolve\n * when the stream is exhausted.\n */\n async toArrayForTest(): Promise {\n const stream = this.prefetch(100);\n const result: T[] = [];\n let x = await stream.next();\n while (!x.done) {\n result.push(x.value);\n x = await stream.next();\n }\n return result;\n }\n\n /**\n * Draw items from the stream until it is exhausted.\n *\n * This can be useful when the stream has side effects but no output. In\n * that case, calling this function guarantees that the stream will be\n * fully processed.\n */\n async resolveFully(): Promise {\n let x = await this.next();\n while (!x.done) {\n x = await this.next();\n }\n }\n\n /**\n * Draw items from the stream until it is exhausted, or a predicate fails.\n *\n * This can be useful when the stream has side effects but no output. In\n * that case, calling this function guarantees that the stream will be\n * fully processed.\n */\n async resolveWhile(predicate: (r: T) => boolean): Promise {\n let x = await this.next();\n let shouldContinue = predicate(x.value);\n while ((!x.done) && shouldContinue) {\n x = await this.next();\n shouldContinue = predicate(x.value);\n }\n }\n\n /**\n * Handles errors thrown on this stream using a provided handler function.\n *\n * @param handler A function that handles any `Error` thrown during a `next()`\n * call and returns true if the stream should continue (dropping the failed\n * call) or false if the stream should quietly terminate. If the handler\n * itself throws (or rethrows) an `Error`, that will be propagated.\n *\n * @returns A `LazyIterator` of elements passed through from upstream,\n * possibly filtering or terminating on upstream `next()` calls that\n * throw an `Error`.\n */\n handleErrors(handler: (error: Error) => boolean): LazyIterator {\n return new ErrorHandlingLazyIterator(this, handler);\n }\n\n // TODO(soergel): Implement reduce() etc.\n\n /**\n * Filters this stream according to `predicate`.\n *\n * @param predicate A function mapping a stream element to a boolean or a\n * `Promise` for one.\n *\n * @returns A `LazyIterator` of elements for which the predicate was true.\n */\n filter(predicate: (value: T) => boolean): LazyIterator {\n return new FilterIterator(this, predicate);\n }\n\n /**\n * Maps this stream through a 1-to-1 transform.\n *\n * @param transform A function mapping a stream element to a transformed\n * element.\n *\n * @returns A `LazyIterator` of transformed elements.\n */\n map(transform: (value: T) => O): LazyIterator {\n return new MapIterator(this, transform);\n }\n\n /**\n * Maps this stream through an async 1-to-1 transform.\n *\n * @param transform A function mapping a stream element to a `Promise` for a\n * transformed stream element.\n *\n * @returns A `LazyIterator` of transformed elements.\n */\n mapAsync(transform: (value: T) => Promise): LazyIterator {\n return new AsyncMapIterator(this, transform);\n }\n\n /**\n * Maps this stream through a 1-to-1 transform, forcing serial execution.\n *\n * @param transform A function mapping a stream element to a transformed\n * element.\n *\n * @returns A `LazyIterator` of transformed elements.\n */\n serialMapAsync(transform: (value: T) => Promise): LazyIterator {\n return new AsyncMapIterator(this, transform).serial();\n }\n\n /**\n * Maps this stream through a 1-to-many transform.\n *\n * @param transform A function mapping a stream element to an array of\n * transformed elements.\n *\n * @returns A `DataStream` of transformed elements.\n */\n flatmap(transform: (value: T) => O[]): LazyIterator {\n return new FlatmapIterator(this, transform);\n }\n\n /**\n * Apply a function to every element of the stream.\n *\n * @param f A function to apply to each stream element.\n */\n async forEachAsync(f: (value: T) => void): Promise {\n return this.map(f).resolveFully();\n }\n\n /**\n * Apply a function to every element of the stream, forcing serial execution.\n *\n * @param f A function to apply to each stream element. Should return 'true'\n * to indicate that the stream should continue, or 'false' to cause it to\n * terminate.\n */\n async serialForEach(f: (value: T) => Promise): Promise {\n return this.serialMapAsync(f).resolveWhile(x => (x === true));\n }\n\n /**\n * Groups elements into batches, represented as arrays of elements.\n *\n * We can think of the elements of this iterator as 'rows' (even if they are\n * nested structures). By the same token, consecutive values for a given\n * key within the elements form a 'column'. This matches the usual sense of\n * 'row' and 'column' when processing tabular data (e.g., parsing a CSV).\n *\n * Thus, \"Row-major\" means that the resulting batch is simply a collection of\n * rows: `[row1, row2, row3, ...]`. This is contrast to the column-major\n * form, which is needed for vectorized computation.\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @returns A `LazyIterator` of batches of elements, represented as arrays\n * of the original element type.\n */\n rowMajorBatch(batchSize: number, smallLastBatch = true): LazyIterator {\n return new RowMajorBatchIterator(this, batchSize, smallLastBatch);\n }\n\n /**\n * Groups elements into batches, represented in column-major form.\n *\n * We can think of the elements of this iterator as 'rows' (even if they are\n * nested structures). By the same token, consecutive values for a given\n * key within the elements form a 'column'. This matches the usual sense of\n * 'row' and 'column' when processing tabular data (e.g., parsing a CSV).\n *\n * Thus, \"column-major\" means that the resulting batch is a (potentially\n * nested) structure representing the columns. Each column entry, then,\n * contains a collection of the values found in that column for a range of\n * input elements. This representation allows for vectorized computation, in\n * contrast to the row-major form.\n *\n * The inputs should all have the same nested structure (i.e., of arrays and\n * dicts). The result is a single object with the same nested structure,\n * where the leaves are arrays collecting the values of the inputs at that\n * location (or, optionally, the result of a custom function applied to those\n * arrays).\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @param zipFn: (optional) A function that expects an array of elements at a\n * single node of the object tree, and returns a `DeepMapResult`. The\n * `DeepMapResult` either provides a result value for that node (i.e.,\n * representing the subtree), or indicates that the node should be processed\n * recursively. The default zipFn recurses as far as possible and places\n * arrays at the leaves.\n * @returns A `LazyIterator` of batches of elements, represented as an object\n * with collections at the leaves.\n */\n columnMajorBatch(\n batchSize: number, smallLastBatch = true,\n // tslint:disable-next-line:no-any\n zipFn: (xs: any[]) => DeepMapResult = zipToList):\n LazyIterator {\n // First collect the desired number of input elements as a row-major batch.\n const rowBatches = this.rowMajorBatch(batchSize, smallLastBatch);\n // Now 'rotate' or 'pivot' the data, collecting all values from each column\n // in the batch (i.e., for each key within the elements) into an array.\n return rowBatches.map(x => deepZip(x, zipFn));\n }\n\n /**\n * Concatenate this `LazyIterator` with another.\n *\n * @param iterator A `LazyIterator` to be concatenated onto this one.\n * @param baseErrorHandler An optional function that can intercept `Error`s\n * raised during a `next()` call on the base stream. This function can\n * decide whether the error should be propagated, whether the error should\n * be ignored, or whether the base stream should be terminated.\n * @returns A `LazyIterator`.\n */\n concatenate(\n iterator: LazyIterator,\n baseErrorHandler?: (e: Error) => boolean): LazyIterator {\n return new ChainedIterator(\n iteratorFromItems([this, iterator]), baseErrorHandler);\n }\n\n /**\n * Limits this stream to return at most `count` items.\n *\n * @param count The maximum number of items to provide from the stream. If\n * a negative or undefined value is given, the entire stream is returned\n * unaltered.\n */\n take(count: number): LazyIterator {\n if (count < 0 || count == null) {\n return this;\n }\n return new TakeIterator(this, count);\n }\n\n /**\n * Skips the first `count` items in this stream.\n *\n * @param count The number of items to skip. If a negative or undefined\n * value is given, the entire stream is returned unaltered.\n */\n skip(count: number): LazyIterator {\n if (count < 0 || count == null) {\n return this;\n }\n return new SkipIterator(this, count);\n }\n\n /**\n * Prefetch the first `bufferSize` items in this stream.\n *\n * Note this prefetches Promises, but makes no guarantees about when those\n * Promises resolve.\n *\n * @param bufferSize: An integer specifying the number of elements to be\n * prefetched.\n */\n prefetch(bufferSize: number): LazyIterator {\n return new PrefetchIterator(this, bufferSize);\n }\n\n // TODO(soergel): deep sharded shuffle, where supported\n\n /**\n * Randomly shuffles the elements of this stream.\n *\n * @param bufferSize: An integer specifying the number of elements from\n * this stream from which the new stream will sample.\n * @param seed: (Optional.) An integer specifying the random seed that\n * will be used to create the distribution.\n */\n shuffle(windowSize: number, seed?: string): LazyIterator {\n return new ShuffleIterator(this, windowSize, seed);\n }\n\n /**\n * Force an iterator to execute serially: each next() call will await the\n * prior one, so that they cannot execute concurrently.\n */\n serial(): LazyIterator {\n return new SerialIterator(this);\n }\n}\n\n// ============================================================================\n// The following private classes serve to implement the chainable methods\n// on LazyIterator. Unfortunately they can't be placed in separate files,\n// due to resulting trouble with circular imports.\n// ============================================================================\n\n// Iterators that just extend LazyIterator directly\n// ============================================================================\n\nclass ArrayIterator extends LazyIterator {\n private trav = 0;\n constructor(protected items: T[]) {\n super();\n }\n\n summary() {\n return `Array of ${this.items.length} items`;\n }\n\n async next(): Promise> {\n if (this.trav >= this.items.length) {\n return {value: null, done: true};\n }\n const item = this.items[this.trav];\n this.trav++;\n return {value: deepClone(item), done: false};\n }\n}\n\nclass FunctionCallIterator extends LazyIterator {\n constructor(\n protected nextFn: () => IteratorResult| Promise>) {\n super();\n }\n\n summary() {\n return `Function call`;\n }\n\n async next(): Promise> {\n try {\n return this.nextFn();\n } catch (e) {\n // Modify the error message but leave the stack trace intact\n e.message =\n `Error thrown while iterating through a dataset: ${e.message}`;\n throw e;\n }\n }\n}\n\nclass SerialIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n constructor(protected upstream: LazyIterator) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> Serial`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n return this.upstream.next();\n }\n}\n\nclass SkipIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n // Local state that should not be clobbered by out-of-order execution.\n count = 0;\n\n constructor(protected upstream: LazyIterator, protected maxCount: number) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> Skip`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n // TODO(soergel): consider tradeoffs of reading in parallel, eg.\n // collecting next() promises in an Array and then waiting for\n // Promise.all() of those. Benefit: pseudo-parallel execution. Drawback:\n // maybe delayed GC.\n while (this.count++ < this.maxCount) {\n const skipped = await this.upstream.next();\n // short-circuit if upstream is already empty\n if (skipped.done) {\n return skipped;\n }\n tf.dispose(skipped.value as {});\n }\n return this.upstream.next();\n }\n}\n\nclass TakeIterator extends LazyIterator {\n count = 0;\n constructor(protected upstream: LazyIterator, protected maxCount: number) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Take`;\n }\n\n async next(): Promise> {\n if (this.count++ >= this.maxCount) {\n return {value: null, done: true};\n }\n return this.upstream.next();\n }\n}\n\n// Note this batch just groups items into row-wise element arrays.\n// Rotating these to a column-wise representation happens only at the dataset\n// level.\nclass RowMajorBatchIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n constructor(\n protected upstream: LazyIterator, protected batchSize: number,\n protected enableSmallLastBatch = true) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> RowMajorBatch`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n const batch: T[] = [];\n while (batch.length < this.batchSize) {\n const item = await this.upstream.next();\n if (item.done) {\n if (this.enableSmallLastBatch && batch.length > 0) {\n return {value: batch, done: false};\n }\n return {value: null, done: true};\n }\n batch.push(item.value);\n }\n return {value: batch, done: false};\n }\n}\n\nclass FilterIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n constructor(\n protected upstream: LazyIterator,\n protected predicate: (value: T) => boolean) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> Filter`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n while (true) {\n const item = await this.upstream.next();\n if (item.done || this.predicate(item.value)) {\n return item;\n }\n tf.dispose(item.value as {});\n }\n }\n}\n\nclass MapIterator extends LazyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected transform: (value: I) => O) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Map`;\n }\n\n async next(): Promise> {\n const item = await this.upstream.next();\n if (item.done) {\n return {value: null, done: true};\n }\n const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {});\n // Careful: the transform may mutate the item in place.\n // That's why we have to remember the input Tensors above, and then\n // below dispose only those that were not passed through to the output.\n // Note too that the transform function is responsible for tidying\n // any intermediate Tensors. Here we are concerned only about the\n // inputs.\n const mapped = this.transform(item.value);\n const outputTensors = tf.tensor_util.getTensorsInContainer(mapped as {});\n\n // TODO(soergel) faster intersection\n // TODO(soergel) move to tf.disposeExcept(in, out)?\n for (const t of inputTensors) {\n if (!tf.tensor_util.isTensorInList(t, outputTensors)) {\n t.dispose();\n }\n }\n return {value: mapped, done: false};\n }\n}\n\nclass ErrorHandlingLazyIterator extends LazyIterator {\n count = 0;\n constructor(\n protected upstream: LazyIterator,\n protected handler: (error: Error) => boolean) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> handleErrors`;\n }\n\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n async serialNext(): Promise> {\n while (true) {\n try {\n return await this.upstream.next();\n } catch (e) {\n if (!this.handler(e)) {\n return {value: null, done: true};\n }\n // If the handler returns true, loop and fetch the next upstream item.\n\n // If the upstream iterator throws an endless stream of errors, and if\n // the handler says to ignore them, then we loop forever here. That is\n // the correct behavior-- it's up to the handler to decide when to stop.\n }\n }\n }\n}\n\nclass AsyncMapIterator extends LazyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected transform: (value: I) => Promise) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> AsyncMap`;\n }\n\n async next(): Promise> {\n const item = await this.upstream.next();\n if (item.done) {\n return {value: null, done: true};\n }\n const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {});\n // Careful: the transform may mutate the item in place.\n // That's why we have to remember the input Tensors above, and then\n // below dispose only those that were not passed through to the output.\n // Note too that the transform function is responsible for tidying\n // any intermediate Tensors. Here we are concerned only about the\n // inputs.\n const mapped = await this.transform(item.value);\n const outputTensors = tf.tensor_util.getTensorsInContainer(mapped as {});\n\n // TODO(soergel) faster intersection\n // TODO(soergel) move to tf.disposeExcept(in, out)?\n for (const t of inputTensors) {\n if (!tf.tensor_util.isTensorInList(t, outputTensors)) {\n t.dispose();\n }\n }\n return {value: mapped, done: false};\n }\n}\n\n// Iterators that maintain a queue of pending items\n// ============================================================================\n\n/**\n * A base class for transforming streams that operate by maintaining an\n * output queue of elements that are ready to return via next(). This is\n * commonly required when the transformation is 1-to-many: A call to next()\n * may trigger a call to the underlying stream, which will produce many\n * mapped elements of this stream-- of which we need to return only one, so\n * we have to queue the rest.\n */\nexport abstract class OneToManyIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n // Local state that should not be clobbered by out-of-order execution.\n protected outputQueue: RingBuffer;\n\n constructor() {\n super();\n this.outputQueue = new GrowingRingBuffer();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n /**\n * Read one or more chunks from upstream and process them, possibly\n * reading or writing a carryover, and adding processed items to the\n * output queue. Note it's possible that no items are added to the queue\n * on a given pump() call, even if the upstream stream is not closed\n * (e.g., because items are filtered).\n *\n * @return `true` if any action was taken, i.e. fetching items from the\n * upstream source OR adding items to the output queue. `false` if the\n * upstream source is exhausted AND nothing was added to the queue\n * (i.e., any remaining carryover).\n */\n protected abstract async pump(): Promise;\n\n async serialNext(): Promise> {\n // Fetch so that the queue contains at least one item if possible.\n // If the upstream source is exhausted, AND there are no items left in\n // the output queue, then this stream is also exhausted.\n while (this.outputQueue.length() === 0) {\n // TODO(soergel): consider parallel reads.\n if (!await this.pump()) {\n return {value: null, done: true};\n }\n }\n return {value: this.outputQueue.shift(), done: false};\n }\n}\nclass FlatmapIterator extends OneToManyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected transform: (value: I) => O[]) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Flatmap`;\n }\n\n async pump(): Promise {\n const item = await this.upstream.next();\n if (item.done) {\n return false;\n }\n const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {});\n // Careful: the transform may mutate the item in place.\n // that's why we have to remember the input Tensors above, and then\n // below dispose only those that were not passed through to the output.\n // Note too that the transform function is responsible for tidying any\n // intermediate Tensors. Here we are concerned only about the inputs.\n const mappedArray = this.transform(item.value);\n const outputTensors =\n tf.tensor_util.getTensorsInContainer(mappedArray as {});\n this.outputQueue.pushAll(mappedArray);\n\n // TODO(soergel) faster intersection, and deduplicate outputTensors\n // TODO(soergel) move to tf.disposeExcept(in, out)?\n for (const t of inputTensors) {\n if (!tf.tensor_util.isTensorInList(t, outputTensors)) {\n t.dispose();\n }\n }\n\n return true;\n }\n}\n\n/**\n * Provides a `LazyIterator` that concatenates a stream of underlying\n * streams.\n *\n * Doing this in a concurrency-safe way requires some trickery. In\n * particular, we want this stream to return the elements from the\n * underlying streams in the correct order according to when next() was\n * called, even if the resulting Promises resolve in a different order.\n */\nexport class ChainedIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise> = null;\n\n // Local state that should not be clobbered by out-of-order execution.\n private iterator: LazyIterator = null;\n private moreIterators: LazyIterator>;\n\n constructor(\n iterators: LazyIterator>,\n private readonly baseErrorHandler?: (e: Error) => boolean) {\n super();\n this.moreIterators = iterators;\n }\n\n summary() {\n const upstreamSummaries = 'TODO: fill in upstream of chained summaries';\n return `${upstreamSummaries} -> Chained`;\n }\n\n async next(): Promise> {\n this.lastRead = this.readFromChain(this.lastRead);\n return this.lastRead;\n }\n\n private async readFromChain(lastRead: Promise>):\n Promise> {\n // Must await on the previous read since the previous read may have advanced\n // the stream of streams, from which we need to read.\n // This is unfortunate since we can't parallelize reads. Which means\n // prefetching of chained streams is a no-op.\n // One solution is to prefetch immediately upstream of this.\n await lastRead;\n if (this.iterator == null) {\n const iteratorResult = await this.moreIterators.next();\n if (iteratorResult.done) {\n // No more streams to stream from.\n return {value: null, done: true};\n }\n this.iterator = iteratorResult.value;\n if (this.baseErrorHandler != null) {\n this.iterator = this.iterator.handleErrors(this.baseErrorHandler);\n }\n }\n const itemResult = await this.iterator.next();\n if (itemResult.done) {\n this.iterator = null;\n return this.readFromChain(lastRead);\n }\n return itemResult;\n }\n}\n\nexport enum ZipMismatchMode {\n FAIL, // require zipped streams to have the same length\n SHORTEST, // terminate zip when the first stream is exhausted\n LONGEST // use nulls for exhausted streams; use up the longest stream.\n}\n\n/**\n * Provides a `LazyIterator` that zips together an array, dict, or nested\n * structure of `LazyIterator`s (and perhaps additional constants).\n *\n * The underlying streams must provide elements in a consistent order such\n * that they correspond.\n *\n * Typically, the underlying streams should have the same number of\n * elements. If they do not, the behavior is determined by the\n * `mismatchMode` argument.\n *\n * The nested structure of the `iterators` argument determines the\n * structure of elements in the resulting iterator.\n *\n * Doing this in a concurrency-safe way requires some trickery. In\n * particular, we want this stream to return the elements from the\n * underlying streams in the correct order according to when next() was\n * called, even if the resulting Promises resolve in a different order.\n *\n * @param iterators: An array or object containing LazyIterators at the\n * leaves.\n * @param mismatchMode: Determines what to do when one underlying iterator\n * is exhausted before the others. `ZipMismatchMode.FAIL` (the default)\n * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST`\n * causes the zipped iterator to terminate with the furst underlying\n * streams, so elements remaining on the longer streams are ignored.\n * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling\n * in nulls for the exhausted streams, until all streams are exhausted.\n */\nclass ZipIterator extends LazyIterator {\n private count = 0;\n private currentPromise: Promise> = null;\n\n constructor(\n protected readonly iterators: IteratorContainer,\n protected readonly mismatchMode: ZipMismatchMode = ZipMismatchMode.FAIL) {\n super();\n }\n\n summary() {\n const upstreamSummaries = 'TODO: fill in upstream of zip summaries';\n return `{${upstreamSummaries}} -> Zip`;\n }\n\n private async nextState(afterState: Promise>):\n Promise> {\n // This chaining ensures that the underlying next() are not even called\n // before the previous ones have resolved.\n await afterState;\n\n // Collect underlying iterator \"done\" signals as a side effect in\n // getNext()\n let numIterators = 0;\n let iteratorsDone = 0;\n\n function getNext(container: IteratorContainer): DeepMapAsyncResult {\n if (container instanceof LazyIterator) {\n const result = container.next();\n return {\n value: result.then(x => {\n numIterators++;\n if (x.done) {\n iteratorsDone++;\n }\n return x.value;\n }),\n recurse: false\n };\n } else {\n return {value: null, recurse: true};\n }\n }\n\n const mapped: O = await deepMapAndAwaitAll(this.iterators, getNext);\n\n if (numIterators === iteratorsDone) {\n // The streams have all ended.\n return {value: null, done: true};\n }\n if (iteratorsDone > 0) {\n switch (this.mismatchMode) {\n case ZipMismatchMode.FAIL:\n throw new Error(\n 'Zipped streams should have the same length. ' +\n `Mismatched at element ${this.count}.`);\n case ZipMismatchMode.SHORTEST:\n return {value: null, done: true};\n case ZipMismatchMode.LONGEST:\n default:\n // Continue. The exhausted streams already produced value: null.\n }\n }\n\n this.count++;\n return {value: mapped, done: false};\n }\n\n async next(): Promise> {\n this.currentPromise = this.nextState(this.currentPromise);\n return this.currentPromise;\n }\n}\n\n// Iterators that maintain a ring buffer of pending promises\n// ============================================================================\n\n/**\n * A stream that prefetches a given number of items from an upstream source,\n * returning them in FIFO order.\n *\n * Note this prefetches Promises, but makes no guarantees about when those\n * Promises resolve.\n */\nexport class PrefetchIterator extends LazyIterator {\n protected buffer: RingBuffer>>;\n\n constructor(\n protected upstream: LazyIterator, protected bufferSize: number) {\n super();\n this.buffer = new RingBuffer>>(bufferSize);\n }\n\n summary() {\n return `${this.upstream.summary()} -> Prefetch`;\n }\n\n /**\n * Refill the prefetch buffer. Returns only after the buffer is full, or\n * the upstream source is exhausted.\n */\n protected refill() {\n while (!this.buffer.isFull()) {\n const v = this.upstream.next();\n this.buffer.push(v);\n }\n }\n\n next(): Promise> {\n this.refill();\n // This shift will never throw an error because the buffer is always\n // full after a refill. If the stream is exhausted, the buffer will be\n // full of Promises that will resolve to the end-of-stream signal.\n return this.buffer.shift();\n }\n}\n\n/**\n * A stream that performs a sliding-window random shuffle on an upstream\n * source. This is like a `PrefetchIterator` except that the items are\n * returned in randomized order. Mixing naturally improves as the buffer\n * size increases.\n */\nexport class ShuffleIterator extends PrefetchIterator {\n private readonly random: seedrandom.prng;\n\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n // Local state that should not be clobbered by out-of-order execution.\n private upstreamExhausted = false;\n\n constructor(\n protected upstream: LazyIterator, protected windowSize: number,\n seed?: string) {\n super(upstream, windowSize);\n this.random = seedrandom.alea(seed || tf.util.now().toString());\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private randomInt(max: number) {\n return Math.floor(this.random() * max);\n }\n\n protected chooseIndex(): number {\n return this.randomInt(this.buffer.length());\n }\n\n async serialNext(): Promise> {\n // TODO(soergel): consider performance\n if (!this.upstreamExhausted) {\n this.refill();\n }\n while (!this.buffer.isEmpty()) {\n const chosenIndex = this.chooseIndex();\n const result = await this.buffer.shuffleExcise(chosenIndex);\n if (result.done) {\n this.upstreamExhausted = true;\n } else {\n this.refill();\n return result;\n }\n }\n return {value: null, done: true};\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\n\n// tslint:disable:no-any\n\n/**\n * A return value for a mapping function that can be applied via deepMap.\n *\n * If recurse is true, the value should be empty, and iteration will continue\n * into the object or array.\n */\nexport type DeepMapResult = {\n value: any,\n recurse: boolean\n};\n\n/**\n * Apply a mapping function to a nested structure in a recursive manner.\n *\n * The result of the mapping is an object with the same nested structure (i.e.,\n * of arrays and dicts) as the input, except that some subtrees are replaced,\n * according to the results of the mapping function.\n *\n * Mappings are memoized. Thus, if the nested structure contains the same\n * object in multiple positions, the output will contain the same mapped object\n * in those positions. Cycles are not supported, however.\n *\n * @param input: The object to which to apply the mapping function.\n * @param mapFn: A function that expects a single node of the object tree, and\n * returns a `DeepMapResult`. The `DeepMapResult` either provides a\n * replacement value for that node (i.e., replacing the subtree), or indicates\n * that the node should be processed recursively.\n */\nexport function deepMap(input: any, mapFn: (x: any) => DeepMapResult): any|\n any[] {\n return deepMapInternal(input, mapFn);\n}\n\n/**\n * @param seen: A Map of known object mappings (i.e., memoized results of\n * `mapFn()`)\n * @param containedIn: An set containing objects on the reference path currently\n * being processed (used to detect cycles).\n */\nfunction deepMapInternal(\n input: any, mapFn: (x: any) => DeepMapResult,\n seen: Map = new Map(), containedIn: Set<{}> = new Set()): any|\n any[] {\n if (input == null) {\n return null;\n }\n if (containedIn.has(input)) {\n throw new Error('Circular references are not supported.');\n }\n if (seen.has(input)) {\n return seen.get(input);\n }\n const result = mapFn(input);\n\n if (result.recurse && result.value !== null) {\n throw new Error(\n 'A deep map function may not return both a value and recurse=true.');\n }\n\n if (!result.recurse) {\n seen.set(input, result.value);\n return result.value;\n } else if (isIterable(input)) {\n // tslint:disable-next-line:no-any\n const mappedIterable: any|any[] = Array.isArray(input) ? [] : {};\n containedIn.add(input);\n for (const k in input) {\n const child = input[k];\n const childResult = deepMapInternal(child, mapFn, seen, containedIn);\n mappedIterable[k] = childResult;\n }\n containedIn.delete(input);\n return mappedIterable;\n } else {\n throw new Error(`Can't recurse into non-iterable type: ${input}`);\n }\n}\n\n// TODO(soergel, kangyizhang) Reconsider naming of deepZip() to avoid confusion\n// with zip()\n\n/**\n * Zip nested structures together in a recursive manner.\n *\n * This has the effect of transposing or pivoting data, e.g. converting it from\n * a row-major representation to a column-major representation.\n *\n * For example, `deepZip([{a: 1, b: 2}, {a: 3, b: 4}])` returns\n * `{a: [1, 3], b: [2, 4]}`.\n *\n * The inputs should all have the same nested structure (i.e., of arrays and\n * dicts). The result is a single object with the same nested structure, where\n * the leaves are arrays collecting the values of the inputs at that location\n * (or, optionally, the result of a custom function applied to those arrays).\n *\n * @param inputs: An array of the objects to zip together.\n * @param zipFn: (optional) A function that expects an array of elements at a\n * single node of the object tree, and returns a `DeepMapResult`. The\n * `DeepMapResult` either provides a result value for that node (i.e.,\n * representing the subtree), or indicates that the node should be processed\n * recursively. The default zipFn recurses as far as possible and places\n * arrays at the leaves.\n */\nexport function deepZip(\n inputs: any[], zipFn: (xs: any[]) => DeepMapResult = zipToList): any|any[] {\n return deepZipInternal(inputs, zipFn);\n}\n\n/**\n * @param containedIn: An set containing objects on the reference path currently\n * being processed (used to detect cycles).\n */\nfunction deepZipInternal(\n inputs: any[], zipFn: (xs: any[]) => DeepMapResult,\n containedIn: Set<{}> = new Set()): any|any[] {\n // The recursion follows the structure of input 0; it's assumed that all the\n // other inputs have the same structure.\n const input = inputs[0];\n if (containedIn.has(input)) {\n throw new Error('Circular references are not supported.');\n }\n const result = zipFn(inputs);\n\n if (result.recurse && result.value !== null) {\n throw new Error(\n 'A deep zip function may not return both a value and recurse=true.');\n }\n\n if (!result.recurse) {\n return result.value;\n } else if (isIterable(input)) {\n // tslint:disable-next-line:no-any\n const mappedIterable: any|any[] = Array.isArray(input) ? [] : {};\n containedIn.add(input);\n for (const k in input) {\n const children = inputs.map(x => x[k]);\n const childResult = deepZipInternal(children, zipFn, containedIn);\n mappedIterable[k] = childResult;\n }\n containedIn.delete(input);\n return mappedIterable;\n } else {\n throw new Error(`Can't recurse into non-iterable type: ${input}`);\n }\n}\n\n// tslint:disable-next-line:no-any\nexport function zipToList(x: any[]): DeepMapResult {\n if (x === null) {\n return null;\n }\n // TODO(soergel): validate array type?\n\n if (isIterable(x[0])) {\n return {value: null, recurse: true};\n } else {\n return {value: x, recurse: false};\n }\n}\n\n/**\n * A return value for an async map function for use with deepMapAndAwaitAll.\n *\n * If recurse is true, the value should be empty, and iteration will continue\n * into the object or array.\n */\nexport type DeepMapAsyncResult = {\n value: Promise,\n recurse: boolean\n};\n\n/**\n * Apply an async mapping function to a nested structure in a recursive manner.\n *\n * This first creates a nested structure of Promises, and then awaits all of\n * those, resulting in a single Promise for a resolved nested structure.\n *\n * The result of the mapping is an object with the same nested structure (i.e.,\n * of arrays and dicts) as the input, except that some subtrees are replaced,\n * according to the results of the mapping function.\n *\n * Mappings are memoized. Thus, if the nested structure contains the same\n * object in multiple positions, the output will contain the same mapped object\n * in those positions. Cycles are not supported, however.\n *\n * @param input: The object to which to apply the mapping function.\n * @param mapFn: A function that expects a single node of the object tree, and\n * returns a `DeepMapAsyncResult`. The `DeepMapAsyncResult` either provides\n * a `Promise` for a replacement value for that node (i.e., replacing the\n * subtree), or indicates that the node should be processed recursively. Note\n * that the decision whether or not to recurse must be made immediately; only\n * the mapped value may be promised.\n */\nexport async function deepMapAndAwaitAll(\n input: any, mapFn: (x: any) => DeepMapAsyncResult): Promise {\n const seen: Map> = new Map();\n\n // First do a normal deepMap, collecting Promises in 'seen' as a side effect.\n deepMapInternal(input, mapFn, seen);\n\n // Replace the Promises in 'seen' in place.\n // Note TypeScript provides no async map iteration, and regular map iteration\n // is broken too, so sadly we have to do Array.from() to make it work.\n // (There's no advantage to Promise.all(), and that would be tricky anyway.)\n for (const key of Array.from(seen.keys())) {\n const value = seen.get(key);\n if (tf.util.isPromise(value)) {\n const mappedValue = await value;\n seen.set(key, mappedValue);\n }\n }\n\n // Normal deepMap again, this time filling in the resolved values.\n // It's unfortunate that we have to do two passes.\n // TODO(soergel): test performance and think harder about a fast solution.\n const result = deepMapInternal(input, mapFn, seen);\n return result;\n}\n\n/**\n * Determine whether the argument is iterable.\n *\n * @returns true if the argument is an array or any non-Tensor object.\n */\n// tslint:disable-next-line:no-any\nexport function isIterable(obj: any): boolean {\n return obj != null && (!ArrayBuffer.isView(obj)) &&\n (Array.isArray(obj) ||\n (typeof obj === 'object' && !(obj instanceof tf.Tensor)));\n}\n\n/**\n * Determine whether the argument can be converted to Tensor.\n *\n * Tensors, primitives, arrays, and TypedArrays all qualify; anything else does\n * not.\n *\n * @returns true if the argument can be converted to Tensor.\n */\n// tslint:disable-next-line:no-any\nexport function canTensorify(obj: any): boolean {\n return obj == null || isPrimitive(obj) || Array.isArray(obj) ||\n (typeof obj === 'object' && (obj instanceof tf.Tensor)) ||\n tf.util.isTypedArray(obj);\n}\n\n/**\n * Returns true if the given `value` is a primitive type. Otherwise returns\n * false. This is equivalant to node util.isPrimitive\n */\nfunction isPrimitive(value: any): boolean {\n return (\n value === null ||\n (typeof value !== 'object' && typeof value !== 'function'));\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport {deepMap, DeepMapResult, isIterable} from './deep_map';\n\nexport function deepClone(container: T): T {\n return deepMap(container, cloneIfTensor);\n}\n\n// tslint:disable-next-line: no-any\nfunction cloneIfTensor(item: any): DeepMapResult {\n if (item instanceof tf.Tensor) {\n return ({value: item.clone(), recurse: false});\n } else if (isIterable(item)) {\n return {value: null, recurse: true};\n } else {\n return {value: item, recurse: false};\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\n/**\n * A ring buffer, providing O(1) FIFO, LIFO, and related operations.\n */\nexport class RingBuffer {\n // Note we store the indices in the range 0 <= index < 2*capacity.\n // This allows us to distinguish the full from the empty case.\n // See https://www.snellman.net/blog/archive/2016-12-13-ring-buffers/\n protected begin = 0; // inclusive\n protected end = 0; // exclusive\n protected doubledCapacity: number;\n\n protected data: T[];\n\n /**\n * Constructs a `RingBuffer`.\n * @param capacity The number of items that the buffer can accomodate.\n */\n constructor(public capacity: number) {\n if (capacity == null) {\n throw new RangeError('Can\\'t create a ring buffer of unknown capacity.');\n }\n if (capacity < 1) {\n throw new RangeError('Can\\'t create ring buffer of capacity < 1.');\n }\n this.data = new Array(capacity);\n this.doubledCapacity = 2 * capacity;\n }\n\n /**\n * Map any index into the range 0 <= index < 2*capacity.\n */\n protected wrap(index: number) {\n // don't trust % on negative numbers\n while (index < 0) {\n index += this.doubledCapacity;\n }\n return index % this.doubledCapacity;\n }\n\n protected get(index: number) {\n if (index < 0) {\n throw new RangeError('Can\\'t get item at a negative index.');\n }\n return this.data[index % this.capacity];\n }\n\n protected set(index: number, value: T) {\n if (index < 0) {\n throw new RangeError('Can\\'t set item at a negative index.');\n }\n this.data[index % this.capacity] = value;\n }\n\n /**\n * Returns the current number of items in the buffer.\n */\n length(): number {\n let length = this.end - this.begin;\n if (length < 0) {\n length = this.doubledCapacity + length;\n }\n return length;\n }\n\n /**\n * Reports whether the buffer is full.\n * @returns true if the number of items in the buffer equals its capacity, and\n * false otherwise.\n */\n isFull() {\n return this.length() === this.capacity;\n }\n\n /**\n * Reports whether the buffer is empty.\n * @returns true if the number of items in the buffer equals zero, and\n * false otherwise.\n */\n isEmpty() {\n return this.length() === 0;\n }\n\n /**\n * Adds an item to the end of the buffer.\n */\n push(value: T) {\n if (this.isFull()) {\n throw new RangeError('Ring buffer is full.');\n }\n this.set(this.end, value);\n this.end = this.wrap(this.end + 1);\n }\n\n /**\n * Adds many items to the end of the buffer, in order.\n */\n pushAll(values: T[]) {\n for (const value of values) {\n this.push(value);\n }\n }\n\n /**\n * Removes and returns the last item in the buffer.\n */\n pop(): T {\n if (this.isEmpty()) {\n throw new RangeError('Ring buffer is empty.');\n }\n this.end = this.wrap(this.end - 1);\n const result = this.get(this.end);\n this.set(this.end, undefined);\n return result;\n }\n\n /**\n * Adds an item to the beginning of the buffer.\n */\n unshift(value: T) {\n if (this.isFull()) {\n throw new RangeError('Ring buffer is full.');\n }\n this.begin = this.wrap(this.begin - 1);\n this.set(this.begin, value);\n }\n\n /**\n * Removes and returns the first item in the buffer.\n */\n shift(): T {\n if (this.isEmpty()) {\n throw new RangeError('Ring buffer is empty.');\n }\n const result = this.get(this.begin);\n this.set(this.begin, undefined);\n this.begin = this.wrap(this.begin + 1);\n return result;\n }\n\n /**\n * Removes and returns a specific item in the buffer, and moves the last item\n * to the vacated slot. This is useful for implementing a shuffling stream.\n * Note that this operation necessarily scrambles the original order.\n *\n * @param relativeIndex: the index of the item to remove, relative to the\n * first item in the buffer (e.g., hiding the ring nature of the underlying\n * storage).\n */\n shuffleExcise(relativeIndex: number): T {\n if (this.isEmpty()) {\n throw new RangeError('Ring buffer is empty.');\n }\n const index = this.wrap(this.begin + relativeIndex);\n const result = this.get(index);\n this.set(index, this.pop());\n return result;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {RingBuffer} from './ring_buffer';\n\nexport class GrowingRingBuffer extends RingBuffer {\n private static INITIAL_CAPACITY = 32;\n\n /**\n * Constructs a `GrowingRingBuffer`.\n */\n constructor() {\n super(GrowingRingBuffer.INITIAL_CAPACITY);\n }\n\n isFull() {\n return false;\n }\n\n push(value: T) {\n if (super.isFull()) {\n this.expand();\n }\n super.push(value);\n }\n\n unshift(value: T) {\n if (super.isFull()) {\n this.expand();\n }\n super.unshift(value);\n }\n\n /**\n * Doubles the capacity of the buffer.\n */\n private expand() {\n const newCapacity = this.capacity * 2;\n const newData = new Array(newCapacity);\n const len = this.length();\n\n // Rotate the buffer to start at index 0 again, since we can't just\n // allocate more space at the end.\n for (let i = 0; i < len; i++) {\n newData[i] = this.get(this.wrap(this.begin + i));\n }\n\n this.data = newData;\n this.capacity = newCapacity;\n this.doubledCapacity = 2 * this.capacity;\n this.begin = 0;\n this.end = len;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport {TensorContainer, TensorLike} from '@tensorflow/tfjs-core';\nimport * as seedrandom from 'seedrandom';\n\nimport {iteratorFromConcatenated, iteratorFromFunction, iteratorFromItems, iteratorFromZipped, LazyIterator, ZipMismatchMode} from './iterators/lazy_iterator';\nimport {Container} from './types';\nimport {canTensorify, deepMapAndAwaitAll, DeepMapResult, isIterable} from './util/deep_map';\n\n/**\n * A nested structure of Datasets, used as the input to zip().\n */\nexport type DatasetContainer = Container>;\n\n// TODO(soergel): consider vectorized operations within the pipeline.\n\n/**\n * Represents a potentially large list of independent data elements (typically\n * 'samples' or 'examples').\n *\n * A 'data example' may be a primitive, an array, a map from string keys to\n * values, or any nested structure of these.\n *\n * A `Dataset` represents an ordered collection of elements, together with a\n * chain of transformations to be performed on those elements. Each\n * transformation is a method of `Dataset` that returns another `Dataset`, so\n * these may be chained, e.g.\n * `const processedDataset = rawDataset.filter(...).map(...).batch(...)`.\n *\n * Data loading and transformation is done in a lazy, streaming fashion. The\n * dataset may be iterated over multiple times; each iteration starts the data\n * loading anew and recapitulates the transformations.\n *\n * A `Dataset` is typically processed as a stream of unbatched examples --i.e.,\n * its transformations are applied one example at a time. Batching produces a\n * new `Dataset` where each element is a batch. Batching should usually come\n * last in a pipeline, because data transformations are easier to express on a\n * per-example basis than on a per-batch basis.\n *\n * The following code examples are calling `await dataset.forEachAsync(...)` to\n * iterate once over the entire dataset in order to print out the data.\n *\n * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'}\n */\nexport abstract class Dataset {\n /*\n * Provide a new stream of elements. Note this will also start new streams\n * from any underlying `Dataset`s.\n *\n * CAUTION: Any Tensors contained within the elements returned from\n * this stream *must* be manually disposed to avoid a GPU memory leak.\n * The tf.tidy() approach cannot be used in an asynchronous context.\n */\n abstract async iterator(): Promise>;\n\n readonly size: number = null;\n\n // TODO(soergel): Make Datasets report whether repeated iterator() calls\n // produce the same result (e.g., reading from a file) or different results\n // (e.g., from the webcam). Currently we don't make this distinction but it\n // could be important for the user to know.\n // abstract isDeterministic(): boolean;\n\n /**\n * Groups elements into batches.\n *\n * It is assumed that each of the incoming dataset elements has the same\n * structure-- i.e. the same set of keys at each location in an object\n * hierarchy. For each key, the resulting `Dataset` provides a batched\n * element collecting all of the incoming values for that key.\n *\n * * Incoming primitives are grouped into a 1-D Tensor.\n * * Incoming Tensors are grouped into a new Tensor where the 0'th axis is\n * the batch dimension.\n * * Incoming arrays are converted to Tensor and then batched.\n * * A nested array is interpreted as an n-D Tensor, so the batched result\n * has n+1 dimensions.\n * * An array that cannot be converted to Tensor produces an error.\n *\n * If an array should not be batched as a unit, it should first be converted\n * to an object with integer keys.\n *\n * Here are a few examples:\n *\n * Batch a dataset of numbers:\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8]).batch(4);\n * await a.forEachAsync(e => e.print());\n * ```\n *\n * Batch a dataset of arrays:\n * ```js\n * const b = tf.data.array([[1], [2], [3], [4], [5], [6], [7], [8]]).batch(4);\n * await b.forEachAsync(e => e.print());\n * ```\n *\n * Batch a dataset of objects:\n * ```js\n * const c = tf.data.array([{a: 1, b: 11}, {a: 2, b: 12}, {a: 3, b: 13},\n * {a: 4, b: 14}, {a: 5, b: 15}, {a: 6, b: 16}, {a: 7, b: 17},\n * {a: 8, b: 18}]).batch(4);\n * await c.forEachAsync(e => {\n * console.log('{');\n * for(var key in e) {\n * console.log(key+':');\n * e[key].print();\n * }\n * console.log('}');\n * })\n * ```\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @returns A `Dataset`, from which a stream of batches can be obtained.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n batch(batchSize: number, smallLastBatch = true): Dataset {\n const base = this;\n tf.util.assert(\n batchSize > 0, () => `batchSize needs to be positive, but it is\n ${batchSize}`);\n let size;\n if (this.size === Infinity || this.size == null) {\n // If the size of this dataset is infinity or null, the new size keeps the\n // same.\n size = this.size;\n } else if (smallLastBatch) {\n // If the size of this dataset is known and include small last batch, the\n // new size is full batch count plus last batch.\n size = Math.ceil(this.size / batchSize);\n } else {\n // If the size of this dataset is known and not include small last batch,\n // the new size is full batch count.\n size = Math.floor(this.size / batchSize);\n }\n return datasetFromIteratorFn(async () => {\n return (await base.iterator())\n .columnMajorBatch(batchSize, smallLastBatch, deepBatchConcat);\n }, size);\n }\n\n /**\n * Concatenates this `Dataset` with another.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]);\n * const b = tf.data.array([4, 5, 6]);\n * const c = a.concatenate(b);\n * await c.forEachAsync(e => console.log(e));\n * ```\n *\n * @param dataset A `Dataset` to be concatenated onto this one.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n concatenate(dataset: Dataset): Dataset {\n const base = this;\n let size;\n if (this.size === Infinity || dataset.size === Infinity) {\n // If the size of any of these two dataset is infinity, new size is\n // infinity.\n size = Infinity;\n } else if (this.size != null && dataset.size != null) {\n // If the size of both datasets are known and not infinity, new size is\n // sum the size of these two datasets.\n size = this.size + dataset.size;\n } else {\n // If neither of these two datasets has infinite size and any of these two\n // datasets' size is null, the new size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () =>\n (await base.iterator()).concatenate(await dataset.iterator()),\n size);\n }\n\n /**\n * Filters this dataset according to `predicate`.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])\n * .filter(x => x%2 === 0);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param predicate A function mapping a dataset element to a boolean or a\n * `Promise` for one.\n *\n * @returns A `Dataset` of elements for which the predicate was true.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n filter(predicate: (value: T) => boolean): Dataset {\n const base = this;\n let size;\n if (this.size === Infinity) {\n // If the size of this dataset is infinity, new size is infinity\n size = Infinity;\n } else {\n // If this dataset has limited elements, new size is null because it might\n // exhausted randomly.\n size = null;\n }\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).filter(x => tf.tidy(() => predicate(x)));\n }, size);\n }\n\n /**\n * Apply a function to every element of the dataset.\n *\n * After the function is applied to a dataset element, any Tensors contained\n * within that element are disposed.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param f A function to apply to each dataset element.\n * @returns A `Promise` that resolves after all elements have been processed.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async forEachAsync(f: (input: T) => void): Promise {\n return (await this.iterator()).forEachAsync(f);\n }\n\n /**\n * Maps this dataset through a 1-to-1 transform.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]).map(x => x*x);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param transform A function mapping a dataset element to a transformed\n * dataset element.\n *\n * @returns A `Dataset` of transformed elements.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n map(transform: (value: T) => O): Dataset {\n const base = this;\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).map(x => tf.tidy(() => transform(x)));\n }, this.size);\n }\n\n /**\n * Maps this dataset through an async 1-to-1 transform.\n *\n * ```js\n * const a =\n * tf.data.array([1, 2, 3]).mapAsync(x => new Promise(function(resolve){\n * setTimeout(() => {\n * resolve(x * x);\n * }, Math.random()*1000 + 500);\n * }));\n * console.log(await a.toArray());\n * ```\n *\n * @param transform A function mapping a dataset element to a `Promise` for a\n * transformed dataset element. This transform is responsible for disposing\n * any intermediate `Tensor`s, i.e. by wrapping its computation in\n * `tf.tidy()`; that cannot be automated here (as it is in the synchronous\n * `map()` case).\n *\n * @returns A `Dataset` of transformed elements.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n mapAsync(transform: (value: T) => Promise):\n Dataset {\n const base = this;\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).mapAsync(transform);\n }, this.size);\n }\n\n /**\n * Creates a `Dataset` that prefetches elements from this dataset.\n *\n * @param bufferSize: An integer specifying the number of elements to be\n * prefetched.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n prefetch(bufferSize: number): Dataset {\n if (bufferSize == null) {\n throw new RangeError(\n '`Dataset.prefetch()` requires bufferSize to be specified.');\n }\n\n const base = this;\n return datasetFromIteratorFn(\n async () => (await base.iterator()).prefetch(bufferSize), this.size);\n }\n\n /**\n * Repeats this dataset `count` times.\n *\n * NOTE: If this dataset is a function of global state (e.g. a random number\n * generator), then different repetitions may produce different elements.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]).repeat(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: (Optional) An integer, representing the number of times\n * the dataset should be repeated. The default behavior (if `count` is\n * `undefined` or negative) is for the dataset be repeated indefinitely.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n repeat(count?: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && count > 0) {\n // If this dataset has size and count is positive, new size is current\n // size multiply count. This also covers the case that current size is\n // infinity.\n size = this.size * count;\n } else if (count === 0) {\n // If count is 0, new size is 0.\n size = 0;\n } else if (this.size != null && (count === undefined || count < 0)) {\n // If this dataset has size and count is undefined or negative, the\n // dataset will be repeated indefinitely and new size is infinity.\n size = Infinity;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(async () => {\n const iteratorIterator = iteratorFromFunction(\n async () => ({value: await base.iterator(), done: false}));\n return iteratorFromConcatenated(iteratorIterator.take(count));\n }, size);\n }\n\n /**\n * Creates a `Dataset` that skips `count` initial elements from this dataset.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).skip(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: The number of elements of this dataset that should be skipped\n * to form the new dataset. If `count` is greater than the size of this\n * dataset, the new dataset will contain no elements. If `count`\n * is `undefined` or negative, skips the entire dataset.\n *\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n skip(count: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && count >= 0 && this.size >= count) {\n // If the size of this dataset is greater than count, the new dataset's\n // size is current size minus skipped size.This also covers the case that\n // current size is infinity.\n size = this.size - count;\n } else if (\n this.size != null &&\n (this.size < count || count === undefined || count < 0)) {\n // If the size of this dataset is smaller than count, or count is\n // undefined or negative, skips the entire dataset and the new size is 0.\n size = 0;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () => (await base.iterator()).skip(count), size);\n }\n\n // TODO(soergel): deep sharded shuffle, where supported\n\n static readonly MAX_BUFFER_SIZE = 10000;\n\n /**\n * Pseudorandomly shuffles the elements of this dataset. This is done in a\n * streaming manner, by sampling from a given number of prefetched elements.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).shuffle(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param bufferSize: An integer specifying the number of elements from this\n * dataset from which the new dataset will sample.\n * @param seed: (Optional) An integer specifying the random seed that will\n * be used to create the distribution.\n * @param reshuffleEachIteration: (Optional) A boolean, which if true\n * indicates that the dataset should be pseudorandomly reshuffled each time\n * it is iterated over. If false, elements will be returned in the same\n * shuffled order on each iteration. (Defaults to `true`.)\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n shuffle(bufferSize: number, seed?: string, reshuffleEachIteration = true):\n Dataset {\n if (bufferSize == null || bufferSize < 0) {\n if (this.size == null) {\n throw new RangeError(\n '`Dataset.shuffle()` requires bufferSize to be specified.');\n } else {\n throw new RangeError(\n '`Dataset.shuffle()` requires bufferSize to be specified. ' +\n 'If your data fits in main memory (for regular JS objects), ' +\n 'and/or GPU memory (for `tf.Tensor`s), consider setting ' +\n `bufferSize to the dataset size (${this.size} elements)`);\n }\n }\n const base = this;\n const random = seedrandom.alea(seed || tf.util.now().toString());\n return datasetFromIteratorFn(async () => {\n let seed2 = random.int32();\n if (reshuffleEachIteration) {\n seed2 += random.int32();\n }\n return (await base.iterator()).shuffle(bufferSize, seed2.toString());\n }, this.size);\n }\n\n /**\n * Creates a `Dataset` with at most `count` initial elements from this\n * dataset.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).take(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: The number of elements of this dataset that should be taken\n * to form the new dataset. If `count` is `undefined` or negative, or if\n * `count` is greater than the size of this dataset, the new dataset will\n * contain all elements of this dataset.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n take(count: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && this.size > count) {\n // If the size of this dataset is greater than count, the new dataset's\n // size is count.\n size = count;\n } else if (this.size != null && this.size <= count) {\n // If the size of this dataset is equal or smaller than count, the new\n // dataset's size is the size of this dataset.\n size = this.size;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () => (await base.iterator()).take(count), size);\n }\n\n /**\n * Collect all elements of this dataset into an array.\n *\n * Obviously this will succeed only for small datasets that fit in memory.\n * Useful for testing and generally should be avoided if possible.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]);\n * console.log(await a.toArray());\n * ```\n *\n * @returns A Promise for an array of elements, which will resolve\n * when a new stream has been obtained and fully consumed.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async toArray() {\n if (this.size === Infinity) {\n throw new Error('Can not convert infinite data stream to array.');\n }\n return (await this.iterator()).toArray();\n }\n\n /**\n * Collect all elements of this dataset into an array with prefetching 100\n * elements. This is useful for testing, because the prefetch changes the\n * order in which the Promises are resolved along the processing pipeline.\n * This may help expose bugs where results are dependent on the order of\n * Promise resolution rather than on the logical order of the stream (i.e.,\n * due to hidden mutable state).\n *\n * @returns A Promise for an array of elements, which will resolve\n * when a new stream has been obtained and fully consumed.\n */\n async toArrayForTest() {\n if (this.size === Infinity) {\n throw new Error('Can not convert infinite data stream to array.');\n }\n return (await this.iterator()).toArrayForTest();\n }\n}\n\n/**\n * Create a `Dataset` defined by a provided iterator() function.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const iter = tf.data.iteratorFromFunction(func);\n * const ds = tf.data.datasetFromIteratorFn(iter);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n */\nexport function datasetFromIteratorFn(\n iteratorFn: () => Promise>,\n size: number = null): Dataset {\n return new class extends Dataset {\n size = size;\n\n /*\n * Provide a new stream of elements. Note this will also start new streams\n * from any underlying `Dataset`s.\n */\n async iterator(): Promise> {\n return iteratorFn();\n }\n }\n ();\n}\n\n/**\n * Create a `Dataset` from an array of elements.\n *\n * Create a Dataset from an array of objects:\n * ```js\n * const a = tf.data.array([{'item': 1}, {'item': 2}, {'item': 3}]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * Create a Dataset from an array of numbers:\n * ```js\n * const a = tf.data.array([4, 5, 6]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n * @param items An array of elements that will be parsed as items in a dataset.\n *\n * @doc {heading: 'Data', subheading: 'Creation', namespace: 'data'}\n */\nexport function array(items: T[]): Dataset {\n return datasetFromIteratorFn(\n async () => iteratorFromItems(items), items.length);\n}\n\n/**\n * Create a `Dataset` by zipping together an array, dict, or nested\n * structure of `Dataset`s (and perhaps additional constants).\n * The underlying datasets must provide elements in a consistent order such that\n * they correspond.\n *\n * The number of elements in the resulting dataset is the same as the size of\n * the smallest dataset in datasets.\n *\n * The nested structure of the `datasets` argument determines the\n * structure of elements in the resulting iterator.\n *\n * Note this means that, given an array of two datasets that produce dict\n * elements, the result is a dataset that produces elements that are arrays\n * of two dicts:\n *\n * Zip an array of datasets:\n * ```js\n * console.log('Zip two datasets of objects:');\n * const ds1 = tf.data.array([{a: 1}, {a: 2}, {a: 3}]);\n * const ds2 = tf.data.array([{b: 4}, {b: 5}, {b: 6}]);\n * const ds3 = tf.data.zip([ds1, ds2]);\n * await ds3.forEachAsync(e => console.log(JSON.stringify(e)));\n *\n * // If the goal is to merge the dicts in order to produce elements like\n * // {a: ..., b: ...}, this requires a second step such as:\n * console.log('Merge the objects:');\n * const ds4 = ds3.map(x => {return {a: x[0].a, b: x[1].b}});\n * await ds4.forEachAsync(e => console.log(e));\n * ```\n *\n * Zip a dict of datasets:\n * ```js\n * const a = tf.data.array([{a: 1}, {a: 2}, {a: 3}]);\n * const b = tf.data.array([{b: 4}, {b: 5}, {b: 6}]);\n * const c = tf.data.zip({c: a, d: b});\n * await c.forEachAsync(e => console.log(JSON.stringify(e)));\n * ```\n *\n * @doc {heading: 'Data', subheading: 'Operations', namespace: 'data'}\n */\nexport function zip(datasets: DatasetContainer):\n Dataset {\n // manually type-check the argument for JS users\n if (!isIterable(datasets)) {\n throw new Error('The argument to zip() must be an object or array.');\n }\n let size;\n if (Array.isArray(datasets)) {\n for (let i = 0; i < datasets.length; i++) {\n size = size == null ? (datasets[i] as Dataset).size :\n Math.min(size, (datasets[i] as Dataset).size);\n }\n } else if (datasets instanceof Object) {\n for (const ds in datasets) {\n size = size == null ? (datasets[ds] as Dataset).size :\n Math.min(size, (datasets[ds] as Dataset).size);\n }\n }\n return datasetFromIteratorFn(async () => {\n const streams = await deepMapAndAwaitAll(datasets, d => {\n if (d instanceof Dataset) {\n return {value: d.iterator(), recurse: false};\n } else if (isIterable(d)) {\n return {value: null, recurse: true};\n } else {\n throw new Error(\n 'Leaves of the structure passed to zip() must be Datasets, ' +\n 'not primitives.');\n }\n });\n return iteratorFromZipped(streams, ZipMismatchMode.SHORTEST);\n }, size);\n}\n\n/**\n * A zip function for use with deepZip, passed via the columnMajorBatch call.\n *\n * Accepts an array of identically-structured nested elements and either batches\n * them (if they are primitives, numeric arrays, or Tensors) or requests\n * recursion (if not).\n */\n// tslint:disable-next-line:no-any\nfunction deepBatchConcat(rows: any[]): DeepMapResult {\n if (rows === null) {\n return null;\n }\n\n // use the first item to decide whether to recurse or batch here.\n const exampleRow = rows[0];\n\n if (canTensorify(exampleRow)) {\n // rows is an array of primitives, Tensors, or arrays. Batch them.\n const value = batchConcat(rows);\n return {value, recurse: false};\n }\n\n // the example row is an object, so recurse into it.\n return {value: null, recurse: true};\n}\n\n/**\n * Assembles a list of same-shaped numbers, number arrays, or Tensors\n * into a single new Tensor where axis 0 is the batch dimension.\n */\nfunction batchConcat(arrays: T[]):\n tf.Tensor {\n if (arrays.length === 0) {\n // We can't return an empty Tensor because we don't know the element shape.\n throw new Error('Can\\'t make a batch of zero elements.');\n }\n\n if (arrays[0] instanceof tf.Tensor) {\n // Input is an array of Tensors\n return tf.stack(arrays as tf.Tensor[]);\n } else {\n // Input is a possibly-nested array of numbers.\n return tf.tensor(arrays as TensorLike);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {Dataset} from '../dataset';\nimport {DataSource} from '../datasource';\nimport {LazyIterator} from '../iterators/lazy_iterator';\n\n/**\n * Represents a potentially large collection of text lines.\n *\n * The results are not batched.\n */\nexport class TextLineDataset extends Dataset {\n /**\n * Create a `TextLineDataset`.\n *\n * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream.\n */\n constructor(protected readonly input: DataSource) {\n super();\n }\n\n async iterator(): Promise> {\n const inputIterator = await this.input.iterator();\n const utf8Iterator = inputIterator.decodeUTF8();\n const lineIterator = utf8Iterator.split('\\n').map(line => {\n // Windows/DOS format text file has extra line breaker at the end of line.\n if (line.endsWith('\\r')) {\n line = line.slice(0, -1);\n }\n return line;\n });\n return lineIterator;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {TensorContainer, util} from '@tensorflow/tfjs-core';\nimport {Dataset} from '../dataset';\nimport {DataSource} from '../datasource';\nimport {LazyIterator} from '../iterators/lazy_iterator';\nimport {ColumnConfig, CSVConfig} from '../types';\nimport {TextLineDataset} from './text_line_dataset';\n\nconst CODE_QUOTE = '\"';\nconst STATE_OUT = Symbol('out');\nconst STATE_FIELD = Symbol('field');\nconst STATE_QUOTE = Symbol('quote');\nconst STATE_QUOTE_AFTER_QUOTE = Symbol('quoteafterquote');\nconst STATE_WITHIN_QUOTE_IN_QUOTE = Symbol('quoteinquote');\n\n/**\n * Represents a potentially large collection of delimited text records.\n *\n * The produced `TensorContainer`s each contain one key-value pair for\n * every column of the table. When a field is empty in the incoming data, the\n * resulting value is `undefined`, or throw error if it is required. Values\n * that can be parsed as numbers are emitted as type `number`, other values\n * are parsed as `string`.\n *\n * The results are not batched.\n *\n * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'}\n */\nexport class CSVDataset extends Dataset {\n base: TextLineDataset;\n private hasHeader = true;\n private fullColumnNames: string[] = null;\n private columnNamesValidated = false;\n private columnConfigs: {[key: string]: ColumnConfig} = null;\n private configuredColumnsOnly = false;\n private delimiter = ',';\n private delimWhitespace = false;\n\n /**\n * Returns column names of the csv dataset. If `configuredColumnsOnly` is\n * true, return column names in `columnConfigs`. If `configuredColumnsOnly` is\n * false and `columnNames` is provided, `columnNames`. If\n * `configuredColumnsOnly` is false and `columnNames` is not provided, return\n * all column names parsed from the csv file. For example usage please go to\n * `tf.data.csv`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async columnNames() {\n if (!this.columnNamesValidated) {\n await this.setColumnNames();\n }\n return this.configuredColumnsOnly ? Object.keys(this.columnConfigs) :\n this.fullColumnNames;\n }\n\n /* 1) If `columnNames` is provided as string[], use this string[] as output\n * keys in corresponding order. The length must match the number of inferred\n * columns if `hasHeader` is true .\n * 2) If `columnNames` is not provided, parse header line as `columnNames` if\n * hasHeader is true. If `hasHeader` is false, throw an error.\n * 3) If `columnConfigs` is provided, all the keys in `columnConfigs` must\n * exist in parsed `columnNames`.\n */\n private async setColumnNames() {\n const columnNamesFromFile = await this.maybeReadHeaderLine();\n if (!this.fullColumnNames && !columnNamesFromFile) {\n // Throw an error if columnNames is not provided and no header line.\n throw new Error(\n 'Column names must be provided if there is no header line.');\n } else if (this.fullColumnNames && columnNamesFromFile) {\n // Check provided columnNames match header line.\n util.assert(\n columnNamesFromFile.length === this.fullColumnNames.length,\n () => 'The length of provided columnNames (' +\n this.fullColumnNames.length.toString() +\n ') does not match the length of the header line read from ' +\n 'file (' + columnNamesFromFile.length.toString() + ').');\n }\n if (!this.fullColumnNames) {\n this.fullColumnNames = columnNamesFromFile;\n }\n // Check if there are duplicate column names.\n const counts: {[key: string]: number} = this.fullColumnNames.reduce(\n (countAcc: {[key: string]: number}, name) => {\n countAcc[name] = (countAcc[name] + 1) || 1;\n return countAcc;\n },\n {});\n const duplicateNames =\n Object.keys(counts).filter((name) => (counts[name] > 1));\n util.assert(\n duplicateNames.length === 0,\n () => 'Duplicate column names found: ' + duplicateNames.toString());\n // Check if keys in columnConfigs match columnNames.\n if (this.columnConfigs) {\n for (const key of Object.keys(this.columnConfigs)) {\n const index = this.fullColumnNames.indexOf(key);\n if (index === -1) {\n throw new Error(\n 'The key \"' + key +\n '\" provided in columnConfigs does not match any of the column ' +\n 'names (' + this.fullColumnNames.toString() + ').');\n }\n }\n }\n this.columnNamesValidated = true;\n }\n\n private async maybeReadHeaderLine() {\n if (this.hasHeader) {\n const iter = await this.base.iterator();\n const firstElement = await iter.next();\n if (firstElement.done) {\n throw new Error('No data was found for CSV parsing.');\n }\n const firstLine: string = firstElement.value;\n const headers = this.parseRow(firstLine, false);\n return headers;\n } else {\n return null;\n }\n }\n\n /**\n * Create a `CSVDataset`.\n *\n * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream.\n * @param csvConfig (Optional) A CSVConfig object that contains configurations\n * of reading and decoding from CSV file(s).\n *\n * hasHeader: (Optional) A boolean value that indicates whether the first\n * row of provided CSV file is a header line with column names, and should\n * not be included in the data. Defaults to `true`.\n *\n * columnNames: (Optional) A list of strings that corresponds to\n * the CSV column names, in order. If provided, it ignores the column\n * names inferred from the header row. If not provided, infers the column\n * names from the first row of the records. If hasHeader is false and\n * columnNames is not provided, this method throws an error.\n *\n * columnConfigs: (Optional) A dictionary whose key is column names, value\n * is an object stating if this column is required, column's data type,\n * default value, and if this column is label. If provided, keys must\n * correspond to names provided in columnNames or inferred from the file\n * header lines. If isLabel is true any column, returns an array of two\n * items: the first item is a dict of features key/value pairs, the second\n * item is a dict of labels key/value pairs. If no feature is marked as\n * label, returns a dict of features only.\n *\n * configuredColumnsOnly (Optional) If true, only columns provided in\n * columnConfigs will be parsed and provided during iteration.\n *\n * delimiter (Optional) The string used to parse each line of the input\n * file. Defaults to `,`.\n */\n constructor(protected readonly input: DataSource, csvConfig?: CSVConfig) {\n super();\n this.base = new TextLineDataset(input);\n if (!csvConfig) {\n csvConfig = {};\n }\n this.hasHeader = csvConfig.hasHeader === false ? false : true;\n this.fullColumnNames = csvConfig.columnNames;\n this.columnConfigs = csvConfig.columnConfigs;\n this.configuredColumnsOnly = csvConfig.configuredColumnsOnly;\n if (csvConfig.delimWhitespace) {\n util.assert(\n csvConfig.delimiter == null,\n () =>\n 'Delimiter should not be provided when delimWhitespace is true.');\n this.delimWhitespace = true;\n this.delimiter = ' ';\n } else {\n this.delimiter = csvConfig.delimiter ? csvConfig.delimiter : ',';\n }\n }\n\n async iterator(): Promise> {\n if (!this.columnNamesValidated) {\n await this.setColumnNames();\n }\n let lines = await this.base.iterator();\n if (this.hasHeader) {\n // We previously read the first line to get the columnNames.\n // Now that we're providing data, skip it.\n lines = lines.skip(1);\n }\n return lines.map(x => this.makeDataElement(x));\n }\n\n makeDataElement(line: string): TensorContainer {\n const values = this.parseRow(line);\n const features: {[key: string]: TensorContainer} = {};\n const labels: {[key: string]: TensorContainer} = {};\n\n for (let i = 0; i < this.fullColumnNames.length; i++) {\n const key = this.fullColumnNames[i];\n const config = this.columnConfigs ? this.columnConfigs[key] : null;\n if (this.configuredColumnsOnly && !config) {\n // This column is not selected.\n continue;\n } else {\n const value = values[i];\n let parsedValue = null;\n if (value === '') {\n // If default value is provided, use it. If default value is not\n // provided, set as undefined.\n if (config && config.default !== undefined) {\n parsedValue = config.default;\n } else if (config && (config.required || config.isLabel)) {\n throw new Error(\n `Required column ${key} is empty in this line: ${line}`);\n } else {\n parsedValue = undefined;\n }\n } else {\n // A value is present, so parse it based on type\n const valueAsNum = Number(value);\n if (isNaN(valueAsNum)) {\n // The value is a string and this column is declared as boolean\n // in config, parse it as boolean.\n if (config && config.dtype === 'bool') {\n parsedValue = this.getBoolean(value);\n } else {\n // Set value as string\n parsedValue = value;\n }\n } else if (!config || !config.dtype) {\n // If this value is a number and no type config is provided, return\n // it as number.\n parsedValue = valueAsNum;\n } else {\n // If this value is a number and data type is provided, parse it\n // according to provided data type.\n switch (config.dtype) {\n case 'float32':\n parsedValue = valueAsNum;\n break;\n case 'int32':\n parsedValue = Math.floor(valueAsNum);\n break;\n case 'bool':\n parsedValue = this.getBoolean(value);\n break;\n default:\n parsedValue = valueAsNum;\n }\n }\n }\n // Check if this column is label.\n (config && config.isLabel) ? labels[key] = parsedValue :\n features[key] = parsedValue;\n }\n }\n // If label exists, return an object of features and labels as {xs:features,\n // ys:labels}, otherwise return features only.\n if (Object.keys(labels).length === 0) {\n return features;\n\n } else {\n return {xs: features, ys: labels};\n }\n }\n\n private getBoolean(value: string): number {\n if (value === '1' || value.toLowerCase() === 'true') {\n return 1;\n } else {\n return 0;\n }\n }\n\n // adapted from https://beta.observablehq.com/@mbostock/streaming-csv\n private parseRow(line: string, validateElementCount = true): string[] {\n const result: string[] = [];\n let readOffset = 0;\n const readLength = line.length;\n let currentState = STATE_OUT;\n // Goes through the line to parse quote.\n for (let i = 0; i < readLength; i++) {\n switch (currentState) {\n // Before enter a new field\n case STATE_OUT:\n switch (line.charAt(i)) {\n // Enter a quoted field\n case CODE_QUOTE:\n readOffset = i + 1;\n currentState = STATE_QUOTE;\n break;\n // Read an empty field\n case this.delimiter:\n readOffset = i + 1;\n // If delimiter is white space and configured to collapse\n // multiple white spaces, ignore this white space.\n if (this.delimiter === ' ' && this.delimWhitespace) {\n break;\n }\n result.push('');\n currentState = STATE_OUT;\n break;\n // Enter an unquoted field\n default:\n currentState = STATE_FIELD;\n readOffset = i;\n break;\n }\n break;\n // In an unquoted field\n case STATE_FIELD:\n switch (line.charAt(i)) {\n // Exit an unquoted field, add it to result\n case this.delimiter:\n result.push(line.substring(readOffset, i));\n currentState = STATE_OUT;\n readOffset = i + 1;\n break;\n default:\n }\n break;\n // In a quoted field\n case STATE_QUOTE:\n switch (line.charAt(i)) {\n // Read a quote after a quote\n case CODE_QUOTE:\n currentState = STATE_QUOTE_AFTER_QUOTE;\n break;\n default:\n }\n break;\n // This state means it's right after a second quote in a field\n case STATE_QUOTE_AFTER_QUOTE:\n switch (line.charAt(i)) {\n // Finished a quoted field\n case this.delimiter:\n result.push(line.substring(readOffset, i - 1));\n currentState = STATE_OUT;\n readOffset = i + 1;\n break;\n // Finished a quoted part in a quoted field\n case CODE_QUOTE:\n currentState = STATE_QUOTE;\n break;\n // In a quoted part in a quoted field\n default:\n currentState = STATE_WITHIN_QUOTE_IN_QUOTE;\n break;\n }\n break;\n case STATE_WITHIN_QUOTE_IN_QUOTE:\n switch (line.charAt(i)) {\n // Exit a quoted part in a quoted field\n case CODE_QUOTE:\n currentState = STATE_QUOTE;\n break;\n default:\n }\n break;\n default:\n }\n }\n // Adds last item based on if it is quoted.\n if (currentState === STATE_QUOTE_AFTER_QUOTE) {\n result.push(line.substring(readOffset, readLength - 1));\n } else {\n result.push(line.substring(readOffset));\n }\n // Check if each row has the same number of elements as column names.\n if (validateElementCount && result.length !== this.fullColumnNames.length) {\n throw new Error(`Invalid row in csv file. Should have ${\n this.fullColumnNames.length} elements in a row, but got ${result}`);\n }\n return result;\n }\n}\n\n// TODO(soergel): add more basic datasets for parity with tf.data\n// tf.data.FixedLengthRecordDataset()\n// tf.data.TFRecordDataset()\n","/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {env, Tensor, tensor, Tensor2D, Tensor3D, TensorContainer, util} from '@tensorflow/tfjs-core';\nimport {MicrophoneConfig} from '../types';\nimport {LazyIterator} from './lazy_iterator';\n\n/**\n * Provide a stream of tensors from microphone audio stream. The tensors are\n * representing audio data as frequency-domain spectrogram generated with\n * browser's native FFT. Tensors representing time-domain waveform is available\n * based on configuration. Only works in browser environment.\n */\nexport class MicrophoneIterator extends LazyIterator {\n private isClosed = false;\n private stream: MediaStream;\n private readonly fftSize: number;\n private readonly columnTruncateLength: number;\n private freqData: Float32Array;\n private timeData: Float32Array;\n private readonly numFrames: number;\n private analyser: AnalyserNode;\n private audioContext: AudioContext;\n private sampleRateHz: number;\n private readonly audioTrackConstraints: MediaTrackConstraints;\n private readonly smoothingTimeConstant: number;\n private readonly includeSpectrogram: boolean;\n private readonly includeWaveform: boolean;\n\n private constructor(protected readonly microphoneConfig: MicrophoneConfig) {\n super();\n this.fftSize = microphoneConfig.fftSize || 1024;\n const fftSizeLog2 = Math.log2(this.fftSize);\n if (this.fftSize < 0 || fftSizeLog2 < 4 || fftSizeLog2 > 14 ||\n !Number.isInteger(fftSizeLog2)) {\n throw new Error(\n `Invalid fftSize: it must be a power of 2 between ` +\n `2 to 4 and 2 to 14, but got ${this.fftSize}`);\n }\n\n this.numFrames = microphoneConfig.numFramesPerSpectrogram || 43;\n this.sampleRateHz = microphoneConfig.sampleRateHz;\n this.columnTruncateLength =\n microphoneConfig.columnTruncateLength || this.fftSize;\n this.audioTrackConstraints = microphoneConfig.audioTrackConstraints;\n this.smoothingTimeConstant = microphoneConfig.smoothingTimeConstant || 0;\n\n this.includeSpectrogram =\n microphoneConfig.includeSpectrogram === false ? false : true;\n this.includeWaveform =\n microphoneConfig.includeWaveform === true ? true : false;\n if (!this.includeSpectrogram && !this.includeWaveform) {\n throw new Error(\n 'Both includeSpectrogram and includeWaveform are false. ' +\n 'At least one type of data should be returned.');\n }\n }\n\n summary() {\n return `microphone`;\n }\n\n // Construct a MicrophoneIterator and start the audio stream.\n static async create(microphoneConfig: MicrophoneConfig = {}) {\n if (env().get('IS_NODE')) {\n throw new Error(\n 'microphone API is only supported in browser environment.');\n }\n\n const microphoneIterator = new MicrophoneIterator(microphoneConfig);\n\n // Call async function start() to initialize the audio stream.\n await microphoneIterator.start();\n\n return microphoneIterator;\n }\n\n // Start the audio stream and FFT.\n async start(): Promise {\n try {\n this.stream = await navigator.mediaDevices.getUserMedia({\n audio: this.audioTrackConstraints == null ? true :\n this.audioTrackConstraints,\n video: false\n });\n } catch (e) {\n throw new Error(\n `Error thrown while initializing video stream: ${e.message}`);\n }\n\n if (!this.stream) {\n throw new Error('Could not obtain audio from microphone.');\n }\n\n const ctxConstructor =\n // tslint:disable-next-line:no-any\n (window as any).AudioContext || (window as any).webkitAudioContext;\n this.audioContext = new ctxConstructor();\n\n if (!this.sampleRateHz) {\n // If sample rate is not provided, use the available sample rate on\n // device.\n this.sampleRateHz = this.audioContext.sampleRate;\n } else if (this.audioContext.sampleRate !== this.sampleRateHz) {\n throw new Error(\n `Mismatch in sampling rate: ` +\n `Expected: ${this.sampleRateHz}; ` +\n `Actual: ${this.audioContext.sampleRate}`);\n }\n\n const streamSource = this.audioContext.createMediaStreamSource(this.stream);\n this.analyser = this.audioContext.createAnalyser();\n this.analyser.fftSize = this.fftSize * 2;\n this.analyser.smoothingTimeConstant = this.smoothingTimeConstant;\n streamSource.connect(this.analyser);\n this.freqData = new Float32Array(this.fftSize);\n this.timeData = new Float32Array(this.fftSize);\n return;\n }\n\n async next(): Promise> {\n if (this.isClosed) {\n return {value: null, done: true};\n }\n\n let spectrogramTensor: Tensor;\n let waveformTensor: Tensor;\n\n const audioDataQueue = await this.getAudioData();\n if (this.includeSpectrogram) {\n const freqData = this.flattenQueue(audioDataQueue.freqDataQueue);\n spectrogramTensor = this.getTensorFromAudioDataArray(\n freqData, [this.numFrames, this.columnTruncateLength, 1]);\n }\n if (this.includeWaveform) {\n const timeData = this.flattenQueue(audioDataQueue.timeDataQueue);\n waveformTensor = this.getTensorFromAudioDataArray(\n timeData, [this.numFrames * this.fftSize, 1]);\n }\n\n return {\n value: {'spectrogram': spectrogramTensor, 'waveform': waveformTensor},\n done: false\n };\n }\n\n // Capture one result from the audio stream, and extract the value from\n // iterator.next() result.\n async capture(): Promise<{spectrogram: Tensor3D, waveform: Tensor2D}> {\n return (await this.next()).value as\n {spectrogram: Tensor3D, waveform: Tensor2D};\n }\n\n private async getAudioData():\n Promise<{freqDataQueue: Float32Array[], timeDataQueue: Float32Array[]}> {\n const freqDataQueue: Float32Array[] = [];\n const timeDataQueue: Float32Array[] = [];\n let currentFrames = 0;\n return new Promise(resolve => {\n const intervalID = setInterval(() => {\n if (this.includeSpectrogram) {\n this.analyser.getFloatFrequencyData(this.freqData);\n // If the audio stream is initializing, return empty queue.\n if (this.freqData[0] === -Infinity) {\n resolve({freqDataQueue, timeDataQueue});\n }\n freqDataQueue.push(this.freqData.slice(0, this.columnTruncateLength));\n }\n if (this.includeWaveform) {\n this.analyser.getFloatTimeDomainData(this.timeData);\n timeDataQueue.push(this.timeData.slice());\n }\n\n // Clean interval and return when all frames have been collected\n if (++currentFrames === this.numFrames) {\n clearInterval(intervalID);\n resolve({freqDataQueue, timeDataQueue});\n }\n }, this.fftSize / this.sampleRateHz * 1e3);\n });\n }\n\n // Stop the audio stream and pause the iterator.\n stop(): void {\n if (!this.isClosed) {\n this.isClosed = true;\n this.analyser.disconnect();\n this.audioContext.close();\n if (this.stream != null && this.stream.getTracks().length > 0) {\n this.stream.getTracks()[0].stop();\n }\n }\n }\n\n // Override toArray() function to prevent collecting.\n toArray(): Promise {\n throw new Error('Can not convert infinite audio stream to array.');\n }\n\n // Return audio sampling rate in Hz\n getSampleRate(): number {\n return this.sampleRateHz;\n }\n\n private flattenQueue(queue: Float32Array[]): Float32Array {\n const frameSize = queue[0].length;\n const freqData = new Float32Array(queue.length * frameSize);\n queue.forEach((data, i) => freqData.set(data, i * frameSize));\n return freqData;\n }\n\n private getTensorFromAudioDataArray(freqData: Float32Array, shape: number[]):\n Tensor {\n const vals = new Float32Array(util.sizeFromShape(shape));\n // If the data is less than the output shape, the rest is padded with zeros.\n vals.set(freqData, vals.length - freqData.length);\n return tensor(vals, shape);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {browser, cast, env, expandDims, image, reshape, tensor1d, Tensor1D, tensor2d, Tensor2D, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs-core';\nimport {WebcamConfig} from '../types';\nimport {LazyIterator} from './lazy_iterator';\n\n/**\n * Provide a stream of image tensors from webcam video stream. Only works in\n * browser environment.\n */\nexport class WebcamIterator extends LazyIterator {\n private isClosed = true;\n private stream: MediaStream;\n private resize = false;\n private cropSize: [number, number];\n private cropBox: Tensor2D;\n private cropBoxInd: Tensor1D;\n\n private constructor(\n protected readonly webcamVideoElement: HTMLVideoElement,\n protected readonly webcamConfig: WebcamConfig) {\n super();\n if (this.needToResize()) {\n this.resize = true;\n this.cropSize =\n [this.webcamConfig.resizeHeight, this.webcamConfig.resizeWidth];\n this.cropBoxInd = tensor1d([0], 'int32');\n if (this.webcamConfig.centerCrop) {\n // Calculate the box based on resizing shape.\n const widthCroppingRatio =\n this.webcamConfig.resizeWidth * 1.0 / this.webcamVideoElement.width;\n const heightCroppingRatio = this.webcamConfig.resizeHeight * 1.0 /\n this.webcamVideoElement.height;\n const widthCropStart = (1 - widthCroppingRatio) / 2;\n const heightCropStart = (1 - heightCroppingRatio) / 2;\n const widthCropEnd = widthCropStart + widthCroppingRatio;\n const heightCropEnd = heightCroppingRatio + heightCropStart;\n this.cropBox = tensor2d(\n [heightCropStart, widthCropStart, heightCropEnd, widthCropEnd],\n [1, 4]);\n } else {\n this.cropBox = tensor2d([0, 0, 1, 1], [1, 4]);\n }\n }\n }\n\n summary() {\n return `webcam`;\n }\n\n // Construct a WebcamIterator and start it's video stream.\n static async create(\n webcamVideoElement?: HTMLVideoElement, webcamConfig: WebcamConfig = {}) {\n if (env().get('IS_NODE')) {\n throw new Error(\n 'tf.data.webcam is only supported in browser environment.');\n }\n\n if (!webcamVideoElement) {\n // If webcam video element is not provided, create a hidden video element\n // with provided width and height.\n webcamVideoElement = document.createElement('video');\n if (!webcamConfig.resizeWidth || !webcamConfig.resizeHeight) {\n throw new Error(\n 'Please provide webcam video element, or resizeWidth and ' +\n 'resizeHeight to create a hidden video element.');\n }\n webcamVideoElement.width = webcamConfig.resizeWidth;\n webcamVideoElement.height = webcamConfig.resizeHeight;\n }\n const webcamIterator = new WebcamIterator(webcamVideoElement, webcamConfig);\n\n // Call async function to initialize the video stream.\n await webcamIterator.start();\n\n return webcamIterator;\n }\n\n // Async function to start video stream.\n async start(): Promise {\n if (this.webcamConfig.facingMode) {\n util.assert(\n (this.webcamConfig.facingMode === 'user') ||\n (this.webcamConfig.facingMode === 'environment'),\n () =>\n `Invalid webcam facing mode: ${this.webcamConfig.facingMode}. ` +\n `Please provide 'user' or 'environment'`);\n }\n\n try {\n this.stream = await navigator.mediaDevices.getUserMedia({\n video: {\n deviceId: this.webcamConfig.deviceId,\n facingMode: this.webcamConfig.facingMode ?\n this.webcamConfig.facingMode :\n 'user',\n width: this.webcamVideoElement.width,\n height: this.webcamVideoElement.height\n }\n });\n } catch (e) {\n // Modify the error message but leave the stack trace intact\n e.message = `Error thrown while initializing video stream: ${e.message}`;\n throw e;\n }\n\n if (!this.stream) {\n throw new Error('Could not obtain video from webcam.');\n }\n\n // Older browsers may not have srcObject\n try {\n this.webcamVideoElement.srcObject = this.stream;\n } catch (error) {\n console.log(error);\n this.webcamVideoElement.src = window.URL.createObjectURL(this.stream);\n }\n // Start the webcam video stream\n this.webcamVideoElement.play();\n\n this.isClosed = false;\n\n return new Promise(resolve => {\n // Add event listener to make sure the webcam has been fully initialized.\n this.webcamVideoElement.onloadedmetadata = () => {\n resolve();\n };\n });\n }\n\n async next(): Promise> {\n if (this.isClosed) {\n return {value: null, done: true};\n }\n\n let img;\n try {\n img = browser.fromPixels(this.webcamVideoElement);\n } catch (e) {\n throw new Error(\n `Error thrown converting video to pixels: ${JSON.stringify(e)}`);\n }\n if (this.resize) {\n try {\n return {value: this.cropAndResizeFrame(img), done: false};\n } catch (e) {\n throw new Error(`Error thrown cropping the video: ${e.message}`);\n } finally {\n img.dispose();\n }\n } else {\n return {value: img, done: false};\n }\n }\n\n private needToResize() {\n // If resizeWidth and resizeHeight are provided, and different from the\n // width and height of original HTMLVideoElement, then resizing and cropping\n // is required.\n if (this.webcamConfig.resizeWidth && this.webcamConfig.resizeHeight &&\n (this.webcamVideoElement.width !== this.webcamConfig.resizeWidth ||\n this.webcamVideoElement.height !== this.webcamConfig.resizeHeight)) {\n return true;\n }\n return false;\n }\n\n // Cropping and resizing each frame based on config\n cropAndResizeFrame(img: Tensor3D): Tensor3D {\n return tidy(() => {\n const expandedImage: Tensor4D = expandDims(cast(img, 'float32'), (0));\n let resizedImage;\n resizedImage = image.cropAndResize(\n expandedImage, this.cropBox, this.cropBoxInd, this.cropSize,\n 'bilinear');\n // Extract image from batch cropping.\n const shape = resizedImage.shape;\n return reshape(resizedImage, shape.slice(1) as [number, number, number]);\n });\n }\n\n // Capture one frame from the video stream, and extract the value from\n // iterator.next() result.\n async capture(): Promise {\n return (await this.next()).value;\n }\n\n // Stop the video stream and pause webcam iterator.\n stop(): void {\n const tracks = this.stream.getTracks();\n\n tracks.forEach(track => track.stop());\n\n try {\n this.webcamVideoElement.srcObject = null;\n } catch (error) {\n console.log(error);\n this.webcamVideoElement.src = null;\n }\n this.isClosed = true;\n }\n\n // Override toArray() function to prevent collecting.\n toArray(): Promise {\n throw new Error('Can not convert infinite video stream to array.');\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {ByteChunkIterator} from './iterators/byte_chunk_iterator';\n\n/**\n * Represents a data source readable as a stream of binary data chunks.\n *\n * Because `Dataset`s can be read repeatedly (via `Dataset.iterator()`), this\n * provides a means to repeatedly create streams from the underlying data\n * sources.\n */\nexport abstract class DataSource {\n /**\n * Obtain a new stream of binary data chunks.\n *\n * Starts the new stream from the beginning of the data source, even if other\n * streams have been obtained previously.\n */\n abstract async iterator(): Promise;\n\n // TODO(soergel): consider chainable Dataset construction here\n}\n\n// TODO(soergel): consider convenience factory functions here\n// in combination with chainable source->dataset above, e.g.:\n// tf.data.url(...).asCsvDataset().shuffle().batch()\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {LazyIterator, OneToManyIterator} from './lazy_iterator';\n\nexport abstract class StringIterator extends LazyIterator {\n /**\n * Splits a string stream on a given separator.\n *\n * It is assumed that the incoming chunk boundaries have no semantic meaning,\n * so conceptually the incoming stream is treated simply as the concatenation\n * of its elements.\n *\n * The outgoing stream provides chunks corresponding to the results of the\n * standard string split() operation (even if such a chunk spanned incoming\n * chunks). The separators are not included.\n *\n * A typical usage is to split a text file (represented as a stream with\n * arbitrary chunk boundaries) into lines.\n *\n * @param upstream A readable stream of strings that can be treated as\n * concatenated.\n * @param separator A character to split on.\n */\n split(separator: string): StringIterator {\n return new SplitIterator(this, separator);\n }\n}\n\n// ============================================================================\n// The following private classes serve to implement the chainable methods\n// on StringIterator. Unfortunately they can't be placed in separate files, due\n// to resulting trouble with circular imports.\n// ============================================================================\n\n// We wanted multiple inheritance, e.g.\n// class SplitIterator extends QueueIterator, StringIterator\n// but the TypeScript mixin approach is a bit hacky, so we take this adapter\n// approach instead.\n\nclass SplitIterator extends StringIterator {\n private impl: SplitIteratorImpl;\n\n constructor(protected upstream: LazyIterator, separator: string) {\n super();\n this.impl = new SplitIteratorImpl(upstream, separator);\n }\n\n summary() {\n return this.impl.summary();\n }\n\n async next() {\n return this.impl.next();\n }\n}\n\nclass SplitIteratorImpl extends OneToManyIterator {\n // A partial string at the end of an upstream chunk\n carryover = '';\n\n constructor(\n protected upstream: LazyIterator, protected separator: string) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Split('${this.separator}')`;\n }\n\n async pump(): Promise {\n const chunkResult = await this.upstream.next();\n if (chunkResult.done) {\n if (this.carryover === '') {\n return false;\n }\n\n // Pretend that the pump succeeded in order to emit the small last batch.\n // The next pump() call will actually fail.\n this.outputQueue.push(this.carryover);\n this.carryover = '';\n return true;\n }\n const lines = chunkResult.value.split(this.separator);\n // Note the behavior: \" ab \".split(' ') === ['', 'ab', '']\n // Thus the carryover may be '' if the separator falls on a chunk\n // boundary; this produces the correct result.\n\n lines[0] = this.carryover + lines[0];\n for (const line of lines.slice(0, -1)) {\n this.outputQueue.push(line);\n }\n this.carryover = lines[lines.length - 1];\n\n return true;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {env} from '@tensorflow/tfjs-core';\nimport {LazyIterator, OneToManyIterator} from './lazy_iterator';\nimport {StringIterator} from './string_iterator';\n\nexport abstract class ByteChunkIterator extends LazyIterator {\n /**\n * Decode a stream of UTF8-encoded byte arrays to a stream of strings.\n *\n * The byte arrays producetd from the ByteChunkIterator on which this is\n * called will be interpreted as concatenated. No assumptions are made about\n * the boundaries of the incoming chunks, so a multi-byte UTF8 encoding of a\n * character may span the boundary between chunks. This naturally happens,\n * for instance, when reading fixed-size byte arrays from a file.\n */\n decodeUTF8(): StringIterator {\n return new Utf8Iterator(this);\n }\n}\n\n// ============================================================================\n// The following private classes serve to implement the chainable methods\n// on ByteChunkIterator. Unfortunately they can't be placed in separate files,\n// due to resulting trouble with circular imports.\n// ============================================================================\n\n// We wanted multiple inheritance, e.g.\n// class Utf8Iterator extends QueueIterator, StringIterator\n// but the TypeScript mixin approach is a bit hacky, so we take this adapter\n// approach instead.\n\nclass Utf8Iterator extends StringIterator {\n private impl: Utf8IteratorImpl;\n\n constructor(protected upstream: LazyIterator) {\n super();\n this.impl = new Utf8IteratorImpl(upstream);\n }\n\n summary() {\n return this.impl.summary();\n }\n\n async next() {\n return this.impl.next();\n }\n}\n\n/**\n * Decode a stream of UTF8-encoded byte arrays to a stream of strings.\n *\n * This is tricky because the incoming byte array boundaries may disrupt a\n * multi-byte UTF8 character. Thus any incomplete character data at the end of\n * a chunk must be carried over and prepended to the next chunk before\n * decoding. Luckily with native decoder, TextDecoder in browser and\n * string_decoder in node, byte array boundaries are handled automatically.\n *\n * In the context of an input pipeline for machine learning, UTF8 decoding is\n * needed to parse text files containing training examples or prediction\n * requests (e.g., formatted as CSV or JSON). We cannot use the built-in\n * decoding provided by FileReader.readAsText() because here we are in a\n * streaming context, which FileReader does not support.\n *\n * @param upstream A `LazyIterator` of `Uint8Arrays` containing UTF8-encoded\n * text, which should be interpreted as concatenated. No assumptions are\n * made about the boundaries of the incoming chunks, so a multi-byte UTF8\n * encoding of a character may span the boundary between chunks. This\n * naturally happens, for instance, when reading fixed-size byte arrays from a\n * file.\n */\nclass Utf8IteratorImpl extends OneToManyIterator {\n // `decoder` as `any` here to dynamically assign value based on the\n // environment.\n // tslint:disable-next-line:no-any\n decoder: any;\n\n constructor(protected readonly upstream: LazyIterator) {\n super();\n if (env().get('IS_BROWSER')) {\n this.decoder = new TextDecoder('utf-8');\n } else {\n // tslint:disable-next-line:no-require-imports\n const {StringDecoder} = require('string_decoder');\n this.decoder = new StringDecoder('utf8');\n }\n }\n summary() {\n return `${this.upstream.summary()} -> Utf8`;\n }\n\n async pump(): Promise {\n const chunkResult = await this.upstream.next();\n let chunk;\n if (chunkResult.done) {\n return false;\n } else {\n chunk = chunkResult.value;\n }\n\n let text: string;\n if (env().get('IS_BROWSER')) {\n text = this.decoder.decode(chunk, {stream: true});\n } else {\n text = this.decoder.write(Buffer.from(chunk.buffer));\n }\n this.outputQueue.push(text);\n return true;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\n// inspired by https://github.com/maxogden/filereader-stream\nimport {env, util} from '@tensorflow/tfjs-core';\nimport {FileElement} from '../types';\nimport {ByteChunkIterator} from './byte_chunk_iterator';\n\nexport interface FileChunkIteratorOptions {\n /** The byte offset at which to begin reading the File or Blob. Default 0. */\n offset?: number;\n /** The number of bytes to read at a time. Default 1MB. */\n chunkSize?: number;\n}\n\n/**\n * Provide a stream of chunks from a File, Blob, or Uint8Array.\n * @param file The source File, Blob or Uint8Array.\n * @param options Optional settings controlling file reading.\n * @returns a lazy Iterator of Uint8Arrays containing sequential chunks of the\n * input File, Blob or Uint8Array.\n */\nexport class FileChunkIterator extends ByteChunkIterator {\n offset: number;\n chunkSize: number;\n\n constructor(\n protected file: FileElement,\n protected options: FileChunkIteratorOptions = {}) {\n super();\n util.assert(\n (file instanceof Uint8Array) ||\n (env().get('IS_BROWSER') ?\n (file instanceof File || file instanceof Blob) :\n false),\n () => 'FileChunkIterator only supports File, Blob and Uint8Array ' +\n 'right now.');\n this.offset = options.offset || 0;\n // default 1MB chunk has tolerable perf on large files\n this.chunkSize = options.chunkSize || 1024 * 1024;\n }\n\n summary() {\n return `FileChunks ${this.file}`;\n }\n\n async next(): Promise> {\n if (this.offset >= ((this.file instanceof Uint8Array) ?\n this.file.byteLength :\n this.file.size)) {\n return {value: null, done: true};\n }\n const chunk = new Promise((resolve, reject) => {\n const end = this.offset + this.chunkSize;\n if (this.file instanceof Uint8Array) {\n // Note if end > this.uint8Array.byteLength, we just get a small last\n // chunk.\n resolve(new Uint8Array(this.file.slice(this.offset, end)));\n } else {\n // This branch assumes that this.file type is File or Blob, which\n // means it is in the browser environment.\n\n // TODO(soergel): is this a performance issue?\n const fileReader = new FileReader();\n fileReader.onload = (event) => {\n let data: string|ArrayBuffer|Uint8Array = fileReader.result;\n // Not sure we can trust the return type of\n // FileReader.readAsArrayBuffer See e.g.\n // https://github.com/node-file-api/FileReader/issues/2\n if (data instanceof ArrayBuffer) {\n data = new Uint8Array(data);\n }\n if (!(data instanceof Uint8Array)) {\n return reject(new TypeError('FileReader returned unknown type.'));\n }\n resolve(data);\n };\n fileReader.onabort = (event) => {\n return reject(new Error('Aborted'));\n };\n fileReader.onerror = (event) => {\n return reject(new Error(event.type));\n };\n // TODO(soergel): better handle onabort, onerror\n // Note if end > this.file.size, we just get a small last chunk.\n const slice = this.file.slice(this.offset, end);\n // We can't use readAsText here (even if we know the file is text)\n // because the slice boundary may fall within a multi-byte character.\n fileReader.readAsArrayBuffer(slice);\n }\n this.offset = end;\n });\n return {value: (await chunk), done: false};\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {util} from '@tensorflow/tfjs-core';\nimport {FileChunkIterator, FileChunkIteratorOptions} from './file_chunk_iterator';\n\n/**\n * Provide a stream of chunks from a URL.\n *\n * Note this class first downloads the entire file into memory before providing\n * the first element from the stream. This is because the Fetch API does not\n * yet reliably provide a reader stream for the response body.\n */\nexport async function urlChunkIterator(\n url: RequestInfo, options: FileChunkIteratorOptions = {}) {\n let urlString;\n let requestInit;\n if ((typeof url) === 'string') {\n urlString = url as string;\n } else {\n urlString = (url as Request).url;\n requestInit = getRequestInitFromRequest(url as Request);\n }\n const response = await util.fetch(urlString, requestInit);\n if (response.ok) {\n const uint8Array = new Uint8Array(await response.arrayBuffer());\n return new FileChunkIterator(uint8Array, options);\n } else {\n throw new Error(response.statusText);\n }\n}\n\n// Generate RequestInit from Request to match tf.util.fetch signature.\nconst getRequestInitFromRequest = (request: Request) => {\n const init = {\n method: request.method,\n headers: request.headers,\n body: request.body,\n mode: request.mode,\n credentials: request.credentials,\n cache: request.cache,\n redirect: request.redirect,\n referrer: request.referrer,\n integrity: request.integrity,\n };\n return init;\n};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\n// Skip tslint any type check cause this method is aiming to check type of\n// input.\n// tslint:disable-next-line:no-any\nexport function isLocalPath(source: any): boolean {\n return (typeof source === 'string') && source.substr(0, 7) === 'file://';\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {env} from '@tensorflow/tfjs-core';\nimport {DataSource} from '../datasource';\nimport {ByteChunkIterator} from '../iterators/byte_chunk_iterator';\nimport {FileChunkIterator, FileChunkIteratorOptions} from '../iterators/file_chunk_iterator';\nimport {FileElement} from '../types';\nimport {isLocalPath} from '../util/source_util';\n\n/**\n * Represents a file, blob, or Uint8Array readable as a stream of binary data\n * chunks.\n */\nexport class FileDataSource extends DataSource {\n /**\n * Create a `FileDataSource`.\n *\n * @param input Local file path, or `File`/`Blob`/`Uint8Array` object to\n * read. Local file only works in node environment.\n * @param options Options passed to the underlying `FileChunkIterator`s,\n * such as {chunksize: 1024}.\n */\n constructor(\n protected input: FileElement|string,\n protected readonly options: FileChunkIteratorOptions = {}) {\n super();\n }\n\n async iterator(): Promise {\n if (isLocalPath(this.input) && env().get('IS_NODE')) {\n // tslint:disable-next-line:no-require-imports\n const fs = require('fs');\n this.input = fs.readFileSync((this.input as string).substr(7));\n }\n // TODO(kangyizhang): Add LocalFileChunkIterator to split local streaming\n // with file in browser.\n return new FileChunkIterator(this.input as FileElement, this.options);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {DataSource} from '../datasource';\nimport {ByteChunkIterator} from '../iterators/byte_chunk_iterator';\nimport {FileChunkIteratorOptions} from '../iterators/file_chunk_iterator';\nimport {urlChunkIterator} from '../iterators/url_chunk_iterator';\nimport {isLocalPath} from '../util/source_util';\nimport {FileDataSource} from './file_data_source';\n\n/*\n * Represents a URL readable as a stream of binary data chunks.\n */\nexport class URLDataSource extends DataSource {\n /**\n * Create a `URLDataSource`.\n *\n * @param url A source URL string, or a `Request` object.\n * @param options Options passed to the underlying `FileChunkIterator`s,\n * such as {chunksize: 1024}.\n */\n constructor(\n protected readonly url: RequestInfo,\n protected readonly fileOptions: FileChunkIteratorOptions = {}) {\n super();\n }\n\n // TODO(soergel): provide appropriate caching options. Currently this\n // will download the URL anew for each call to iterator(). Since we have\n // to treat the downloaded file as a blob/buffer anyway, we may as well retain\n // it-- but that raises GC issues. Also we may want a persistent disk cache.\n async iterator(): Promise {\n if (isLocalPath(this.url)) {\n return (new FileDataSource(this.url as string, this.fileOptions))\n .iterator();\n } else {\n return urlChunkIterator(this.url, this.fileOptions);\n }\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {TensorContainer} from '@tensorflow/tfjs-core';\nimport {Dataset, datasetFromIteratorFn} from './dataset';\nimport {CSVDataset} from './datasets/csv_dataset';\nimport {iteratorFromFunction} from './iterators/lazy_iterator';\nimport {MicrophoneIterator} from './iterators/microphone_iterator';\nimport {WebcamIterator} from './iterators/webcam_iterator';\nimport {URLDataSource} from './sources/url_data_source';\nimport {CSVConfig, MicrophoneConfig, WebcamConfig} from './types';\n\n/**\n * Create a `CSVDataset` by reading and decoding CSV file(s) from provided URL\n * or local path if it's in Node environment.\n *\n * Note: If isLabel in columnConfigs is `true` for at least one column, the\n * element in returned `CSVDataset` will be an object of\n * `{xs:features, ys:labels}`: xs is a dict of features key/value pairs, ys\n * is a dict of labels key/value pairs. If no column is marked as label,\n * returns a dict of features only.\n *\n * ```js\n * const csvUrl =\n * 'https://storage.googleapis.com/tfjs-examples/multivariate-linear-regression/data/boston-housing-train.csv';\n *\n * async function run() {\n * // We want to predict the column \"medv\", which represents a median value of\n * // a home (in $1000s), so we mark it as a label.\n * const csvDataset = tf.data.csv(\n * csvUrl, {\n * columnConfigs: {\n * medv: {\n * isLabel: true\n * }\n * }\n * });\n *\n * // Number of features is the number of column names minus one for the label\n * // column.\n * const numOfFeatures = (await csvDataset.columnNames()).length - 1;\n *\n * // Prepare the Dataset for training.\n * const flattenedDataset =\n * csvDataset\n * .map(({xs, ys}) =>\n * {\n * // Convert xs(features) and ys(labels) from object form (keyed by\n * // column name) to array form.\n * return {xs:Object.values(xs), ys:Object.values(ys)};\n * })\n * .batch(10);\n *\n * // Define the model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense({\n * inputShape: [numOfFeatures],\n * units: 1\n * }));\n * model.compile({\n * optimizer: tf.train.sgd(0.000001),\n * loss: 'meanSquaredError'\n * });\n *\n * // Fit the model using the prepared Dataset\n * return model.fitDataset(flattenedDataset, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * console.log(epoch + ':' + logs.loss);\n * }\n * }\n * });\n * }\n *\n * await run();\n * ```\n *\n * @param source URL or local path to get CSV file. If it's a local path, it\n * must have prefix `file://` and it only works in node environment.\n * @param csvConfig (Optional) A CSVConfig object that contains configurations\n * of reading and decoding from CSV file(s).\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * configParamIndices: [1]\n * }\n */\nexport function csv(\n source: RequestInfo, csvConfig: CSVConfig = {}): CSVDataset {\n return new CSVDataset(new URLDataSource(source), csvConfig);\n}\n\n/**\n * Create a `Dataset` that produces each element by calling a provided function.\n *\n * Note that repeated iterations over this `Dataset` may produce different\n * results, because the function will be called anew for each element of each\n * iteration.\n *\n * Also, beware that the sequence of calls to this function may be out of order\n * in time with respect to the logical order of the Dataset. This is due to the\n * asynchronous lazy nature of stream processing, and depends on downstream\n * transformations (e.g. .shuffle()). If the provided function is pure, this is\n * no problem, but if it is a closure over a mutable state (e.g., a traversal\n * pointer), then the order of the produced elements may be scrambled.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const ds = tf.data.func(func);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * @param f A function that produces one data element on each call.\n */\nexport function func(\n f: () => IteratorResult| Promise>): Dataset {\n const iter = iteratorFromFunction(f);\n return datasetFromIteratorFn(async () => iter);\n}\n\n/**\n * Create a `Dataset` that produces each element from provided JavaScript\n * generator, which is a function*\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions),\n * or a function that returns an\n * iterator\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions).\n *\n * The returned iterator should have `.next()` function that returns element in\n * format of `{value: TensorContainer, done:boolean}`.\n *\n * Example of creating a dataset from an iterator factory:\n * ```js\n * function makeIterator() {\n * const numElements = 10;\n * let index = 0;\n *\n * const iterator = {\n * next: () => {\n * let result;\n * if (index < numElements) {\n * result = {value: index, done: false};\n * index++;\n * return result;\n * }\n * return {value: index, done: true};\n * }\n * };\n * return iterator;\n * }\n * const ds = tf.data.generator(makeIterator);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * Example of creating a dataset from a generator:\n * ```js\n * function* dataGenerator() {\n * const numElements = 10;\n * let index = 0;\n * while (index < numElements) {\n * const x = index;\n * index++;\n * yield x;\n * }\n * }\n *\n * const ds = tf.data.generator(dataGenerator);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * @param generator A Javascript generator function that returns a JavaScript\n * iterator.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * configParamIndices: [1]\n * }\n */\nexport function generator(\n generator: () => Iterator| Promise>): Dataset {\n return datasetFromIteratorFn(async () => {\n const gen = await generator();\n return iteratorFromFunction(() => gen.next());\n });\n}\n\n/**\n * Create an iterator that generate `Tensor`s from webcam video stream. This API\n * only works in Browser environment when the device has webcam.\n *\n * Note: this code snippet only works when the device has a webcam. It will\n * request permission to open the webcam when running.\n * ```js\n * const videoElement = document.createElement('video');\n * videoElement.width = 100;\n * videoElement.height = 100;\n * const cam = await tf.data.webcam(videoElement);\n * const img = await cam.capture();\n * img.print();\n * cam.stop();\n * ```\n *\n * @param webcamVideoElement A `HTMLVideoElement` used to play video from\n * webcam. If this element is not provided, a hidden `HTMLVideoElement` will\n * be created. In that case, `resizeWidth` and `resizeHeight` must be\n * provided to set the generated tensor shape.\n * @param webcamConfig A `WebcamConfig` object that contains configurations of\n * reading and manipulating data from webcam video stream.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * ignoreCI: true\n * }\n */\nexport async function webcam(\n webcamVideoElement?: HTMLVideoElement,\n webcamConfig?: WebcamConfig): Promise {\n return WebcamIterator.create(webcamVideoElement, webcamConfig);\n}\n\n/**\n * Create an iterator that generate frequency-domain spectrogram `Tensor`s from\n * microphone audio stream with browser's native FFT. This API only works in\n * browser environment when the device has microphone.\n *\n * Note: this code snippet only works when the device has a microphone. It will\n * request permission to open the microphone when running.\n * ```js\n * const mic = await tf.data.microphone({\n * fftSize: 1024,\n * columnTruncateLength: 232,\n * numFramesPerSpectrogram: 43,\n * sampleRateHz:44100,\n * includeSpectrogram: true,\n * includeWaveform: true\n * });\n * const audioData = await mic.capture();\n * const spectrogramTensor = audioData.spectrogram;\n * spectrogramTensor.print();\n * const waveformTensor = audioData.waveform;\n * waveformTensor.print();\n * mic.stop();\n * ```\n *\n * @param microphoneConfig A `MicrophoneConfig` object that contains\n * configurations of reading audio data from microphone.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * ignoreCI: true\n * }\n */\nexport async function microphone(microphoneConfig?: MicrophoneConfig):\n Promise {\n return MicrophoneIterator.create(microphoneConfig);\n}\n","/** @license See the LICENSE file. */\n\n// This code is auto-generated, do not modify this file!\nconst version = '3.6.0';\nexport {version};\n"],"names":["global","module","define","Alea","seed","n","me","this","mash","data","toString","i","length","h","charCodeAt","next","t","s0","c","s1","s2","copy","f","impl","opts","xg","state","prng","int32","double","quick","exports","amd","alea","XorGen","strseed","x","y","z","w","k","result","xor128","v","d","xorwow","X","j","push","init","slice","Date","xorshift7","limit","Math","max","xor4096","b","a","floor","tychei","pool","math","nodecrypto","width","startdenom","pow","significance","overflow","mask","seedrandom","options","callback","key","shortseed","mixkey","flatten","entropy","tostring","out","randomBytes","Uint8Array","crypto","msCrypto","getRandomValues","e","browser","navigator","plugins","screen","autoseed","arc4","ARC4","g","S","pass","is_math_call","keylen","s","count","r","obj","depth","prop","typ","smear","stringseed","String","fromCharCode","apply","random","require","ex","sr","ZipMismatchMode","deepMapInternal","input","mapFn","seen","Map","containedIn","Set","has","Error","get","recurse","value","isIterable","mappedIterable","Array","isArray","add","childResult","delete","set","deepZip","inputs","zipFn","zipToList","deepZipInternal","map","async","deepMapAndAwaitAll","from","keys","tf.util","isPromise","mappedValue","ArrayBuffer","isView","tf.Tensor","deepClone","container","cloneIfTensor","item","clone","RingBuffer","[object Object]","capacity","RangeError","doubledCapacity","index","end","begin","isFull","wrap","values","isEmpty","undefined","relativeIndex","pop","GrowingRingBuffer","super","INITIAL_CAPACITY","expand","unshift","newCapacity","newData","len","iteratorFromItems","items","ArrayIterator","iteratorFromFunction","func","FunctionCallIterator","LazyIterator","done","stream","prefetch","predicate","shouldContinue","handler","ErrorHandlingLazyIterator","FilterIterator","transform","MapIterator","AsyncMapIterator","serial","FlatmapIterator","resolveFully","serialMapAsync","resolveWhile","batchSize","smallLastBatch","RowMajorBatchIterator","rowMajorBatch","iterator","baseErrorHandler","ChainedIterator","TakeIterator","SkipIterator","bufferSize","PrefetchIterator","windowSize","ShuffleIterator","SerialIterator","trav","nextFn","message","upstream","lastRead","Promise","resolve","summary","then","serialNext","maxCount","skipped","tf.dispose","enableSmallLastBatch","batch","inputTensors","tf.tensor_util","getTensorsInContainer","mapped","outputTensors","isTensorInList","dispose","OneToManyIterator","outputQueue","pump","shift","mappedArray","pushAll","iterators","moreIterators","readFromChain","iteratorResult","handleErrors","itemResult","ZipIterator","mismatchMode","FAIL","afterState","numIterators","iteratorsDone","SHORTEST","LONGEST","currentPromise","nextState","buffer","refill","seedrandom.alea","now","randomInt","upstreamExhausted","chosenIndex","chooseIndex","shuffleExcise","Dataset","base","size","assert","Infinity","ceil","datasetFromIteratorFn","columnMajorBatch","deepBatchConcat","dataset","concatenate","filter","tf.tidy","forEachAsync","mapAsync","iteratorIterator","baseIterators","take","skip","reshuffleEachIteration","seed2","shuffle","toArray","toArrayForTest","iteratorFn","array","zip","datasets","min","Object","ds","iteratorFromZipped","rows","exampleRow","isTypedArray","arrays","tf.stack","tf.tensor","batchConcat","TextLineDataset","decodeUTF8","split","line","endsWith","STATE_OUT","Symbol","STATE_FIELD","STATE_QUOTE","STATE_QUOTE_AFTER_QUOTE","STATE_WITHIN_QUOTE_IN_QUOTE","CSVDataset","csvConfig","hasHeader","fullColumnNames","columnNames","columnConfigs","configuredColumnsOnly","delimWhitespace","util","delimiter","columnNamesValidated","setColumnNames","columnNamesFromFile","maybeReadHeaderLine","counts","reduce","countAcc","name","duplicateNames","indexOf","iter","firstElement","firstLine","parseRow","lines","makeDataElement","features","labels","config","parsedValue","default","required","isLabel","valueAsNum","Number","isNaN","dtype","getBoolean","xs","ys","toLowerCase","validateElementCount","readOffset","readLength","currentState","charAt","substring","MicrophoneIterator","microphoneConfig","fftSize","fftSizeLog2","log2","isInteger","numFrames","numFramesPerSpectrogram","sampleRateHz","columnTruncateLength","audioTrackConstraints","smoothingTimeConstant","includeSpectrogram","includeWaveform","env","microphoneIterator","start","mediaDevices","getUserMedia","audio","video","ctxConstructor","window","AudioContext","webkitAudioContext","audioContext","sampleRate","streamSource","createMediaStreamSource","analyser","createAnalyser","connect","freqData","Float32Array","timeData","isClosed","spectrogramTensor","waveformTensor","audioDataQueue","getAudioData","flattenQueue","freqDataQueue","getTensorFromAudioDataArray","timeDataQueue","spectrogram","waveform","currentFrames","intervalID","setInterval","getFloatFrequencyData","getFloatTimeDomainData","clearInterval","disconnect","close","getTracks","stop","queue","frameSize","forEach","shape","vals","sizeFromShape","tensor","WebcamIterator","webcamVideoElement","webcamConfig","needToResize","resize","cropSize","resizeHeight","resizeWidth","cropBoxInd","tensor1d","centerCrop","widthCroppingRatio","heightCroppingRatio","height","widthCropStart","heightCropStart","widthCropEnd","heightCropEnd","cropBox","tensor2d","document","createElement","webcamIterator","facingMode","deviceId","srcObject","error","console","log","src","URL","createObjectURL","play","onloadedmetadata","img","fromPixels","JSON","stringify","cropAndResizeFrame","tidy","expandedImage","expandDims","cast","resizedImage","image","cropAndResize","reshape","track","DataSource","StringIterator","separator","SplitIterator","SplitIteratorImpl","chunkResult","carryover","ByteChunkIterator","Utf8Iterator","Utf8IteratorImpl","decoder","TextDecoder","StringDecoder","chunk","text","decode","write","Buffer","FileChunkIterator","file","File","Blob","offset","chunkSize","byteLength","reject","fileReader","FileReader","onload","event","TypeError","onabort","onerror","type","readAsArrayBuffer","getRequestInitFromRequest","request","method","headers","body","mode","credentials","cache","redirect","referrer","integrity","isLocalPath","source","substr","FileDataSource","fs","readFileSync","URLDataSource","url","fileOptions","urlString","requestInit","response","fetch","ok","uint8Array","arrayBuffer","statusText","urlChunkIterator","csv","generator","gen","webcam","create","microphone","version"],"mappings":";;;;;;;;;;;;;;;;4bA2BA,SAAUA,EAAQC,EAAQC,GAE1B,SAASC,EAAKC,GACZ,IAgDIC,EAhDAC,EAAKC,KAAMC,GAgDXH,EAAI,WAEG,SAASI,GAClBA,EAAOA,EAAKC,WACZ,IAAK,IAAIC,EAAI,EAAGA,EAAIF,EAAKG,OAAQD,IAAK,CAEpC,IAAIE,EAAI,oBADRR,GAAKI,EAAKK,WAAWH,IAGrBE,GADAR,EAAIQ,IAAM,EAGVR,GADAQ,GAAKR,KACK,EAEVA,GAAS,YADTQ,GAAKR,GAGP,OAAmB,wBAAXA,IAAM,KA5DhBC,EAAGS,KAAO,WACR,IAAIC,EAAI,QAAUV,EAAGW,GAAY,uBAAPX,EAAGY,EAG7B,OAFAZ,EAAGW,GAAKX,EAAGa,GACXb,EAAGa,GAAKb,EAAGc,GACJd,EAAGc,GAAKJ,GAAKV,EAAGY,EAAQ,EAAJF,IAI7BV,EAAGY,EAAI,EACPZ,EAAGW,GAAKT,EAAK,KACbF,EAAGa,GAAKX,EAAK,KACbF,EAAGc,GAAKZ,EAAK,KACbF,EAAGW,IAAMT,EAAKJ,GACVE,EAAGW,GAAK,IAAKX,EAAGW,IAAM,GAC1BX,EAAGa,IAAMX,EAAKJ,GACVE,EAAGa,GAAK,IAAKb,EAAGa,IAAM,GAC1Bb,EAAGc,IAAMZ,EAAKJ,GACVE,EAAGc,GAAK,IAAKd,EAAGc,IAAM,GAC1BZ,EAAO,KAGT,SAASa,EAAKC,EAAGN,GAKf,OAJAA,EAAEE,EAAII,EAAEJ,EACRF,EAAEC,GAAKK,EAAEL,GACTD,EAAEG,GAAKG,EAAEH,GACTH,EAAEI,GAAKE,EAAEF,GACFJ,EAGT,SAASO,EAAKnB,EAAMoB,GAClB,IAAIC,EAAK,IAAItB,EAAKC,GACdsB,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I6c,EACAC,EACiB,iBAATH,EACVE,EAAYF,GAEZE,EAAaF,EAAgBA,IAC7BG,EAAcrB,GAA0BkB,IAE1C,MAAMI,QAAiB/M,EAAKgN,MAAMH,EAAWC,GAC7C,GAAIC,EAASE,GAAI,CACf,MAAMC,EAAa,IAAIxc,iBAAiBqc,EAASI,eACjD,OAAO,IAAI3C,GAAkB0C,EAAYld,GAEzC,MAAM,IAAIoD,MAAM2Z,EAASK,YGQhBC,CAAiBrhB,KAAK2gB,IAAK3gB,KAAK4gB,uBCsD7BU,GACZjB,EAAqB5M,EAAuB,IAC9C,OAAO,IAAID,GAAW,IAAIkN,GAAcL,GAAS5M,YA2BnCzI,GACZjK,GACF,MAAM6T,EAAO7J,EAAqBhK,GAClC,OAAO6P,IAAsBtI,SAAYsM,aA+D3B2M,GACZA,GACF,OAAO3Q,IAAsBtI,UAC3B,MAAMkZ,QAAYD,IAClB,OAAOxW,GAAqB,IAAMyW,EAAIhhB,YAkCnC8H,eAAemZ,GAClBlH,EACAC,GACF,OAAOF,GAAeoH,OAAOnH,EAAoBC,GAqC5ClS,eAAeqZ,GAAWnL,GAE/B,OAAOD,GAAmBmL,OAAOlL,SCrR7BoL,GAAU"} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.js deleted file mode 100644 index e482de771..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.js +++ /dev/null @@ -1,5415 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tensorflow/tfjs-core')) : - typeof define === 'function' && define.amd ? define(['exports', '@tensorflow/tfjs-core'], factory) : - (global = global || self, factory((global.tf = global.tf || {}, global.tf.data = global.tf.data || {}), global.tf)); -}(this, (function (exports, tf) { 'use strict'; - - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */ - /* global Reflect, Promise */ - - 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); - }; - - function __extends(d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - } - - function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); - } - - function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } - } - - var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - - function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; - } - - var alea = createCommonjsModule(function (module) { - // A port of an algorithm by Johannes Baagøe , 2010 - // http://baagoe.com/en/RandomMusings/javascript/ - // https://github.com/nquinlan/better-random-numbers-for-javascript-mirror - // Original work is under MIT license - - - // Copyright (C) 2010 by Johannes Baagøe - // - // Permission is hereby granted, free of charge, to any person obtaining a copy - // of this software and associated documentation files (the "Software"), to deal - // in the Software without restriction, including without limitation the rights - // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - // copies of the Software, and to permit persons to whom the Software is - // furnished to do so, subject to the following conditions: - // - // The above copyright notice and this permission notice shall be included in - // all copies or substantial portions of the Software. - // - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - // THE SOFTWARE. - - - - (function(global, module, define) { - - function Alea(seed) { - var me = this, mash = Mash(); - - me.next = function() { - var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32 - me.s0 = me.s1; - me.s1 = me.s2; - return me.s2 = t - (me.c = t | 0); - }; - - // Apply the seeding algorithm from Baagoe. - me.c = 1; - me.s0 = mash(' '); - me.s1 = mash(' '); - me.s2 = mash(' '); - me.s0 -= mash(seed); - if (me.s0 < 0) { me.s0 += 1; } - me.s1 -= mash(seed); - if (me.s1 < 0) { me.s1 += 1; } - me.s2 -= mash(seed); - if (me.s2 < 0) { me.s2 += 1; } - mash = null; - } - - function copy(f, t) { - t.c = f.c; - t.s0 = f.s0; - t.s1 = f.s1; - t.s2 = f.s2; - return t; - } - - function impl(seed, opts) { - var xg = new Alea(seed), - state = opts && opts.state, - prng = xg.next; - prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }; - prng.double = function() { - return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53 - }; - prng.quick = prng; - if (state) { - if (typeof(state) == 'object') copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; - } - - function Mash() { - var n = 0xefc8249d; - - var mash = function(data) { - data = data.toString(); - for (var i = 0; i < data.length; i++) { - n += data.charCodeAt(i); - var h = 0.02519603282416938 * n; - n = h >>> 0; - h -= n; - h *= n; - n = h >>> 0; - h -= n; - n += h * 0x100000000; // 2^32 - } - return (n >>> 0) * 2.3283064365386963e-10; // 2^-32 - }; - - return mash; - } - - - if (module && module.exports) { - module.exports = impl; - } else if (define && define.amd) { - define(function() { return impl; }); - } else { - this.alea = impl; - } - - })( - commonjsGlobal, - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader - ); - }); - - var xor128 = createCommonjsModule(function (module) { - // A Javascript implementaion of the "xor128" prng algorithm by - // George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper - - (function(global, module, define) { - - function XorGen(seed) { - var me = this, strseed = ''; - - me.x = 0; - me.y = 0; - me.z = 0; - me.w = 0; - - // Set up generator function. - me.next = function() { - var t = me.x ^ (me.x << 11); - me.x = me.y; - me.y = me.z; - me.z = me.w; - return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8); - }; - - if (seed === (seed | 0)) { - // Integer seed. - me.x = seed; - } else { - // String seed. - strseed += seed; - } - - // Mix in string seed, then discard an initial batch of 64 values. - for (var k = 0; k < strseed.length + 64; k++) { - me.x ^= strseed.charCodeAt(k) | 0; - me.next(); - } - } - - function copy(f, t) { - t.x = f.x; - t.y = f.y; - t.z = f.z; - t.w = f.w; - return t; - } - - function impl(seed, opts) { - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (typeof(state) == 'object') copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; - } - - if (module && module.exports) { - module.exports = impl; - } else if (define && define.amd) { - define(function() { return impl; }); - } else { - this.xor128 = impl; - } - - })( - commonjsGlobal, - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader - ); - }); - - var xorwow = createCommonjsModule(function (module) { - // A Javascript implementaion of the "xorwow" prng algorithm by - // George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper - - (function(global, module, define) { - - function XorGen(seed) { - var me = this, strseed = ''; - - // Set up generator function. - me.next = function() { - var t = (me.x ^ (me.x >>> 2)); - me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v; - return (me.d = (me.d + 362437 | 0)) + - (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0; - }; - - me.x = 0; - me.y = 0; - me.z = 0; - me.w = 0; - me.v = 0; - - if (seed === (seed | 0)) { - // Integer seed. - me.x = seed; - } else { - // String seed. - strseed += seed; - } - - // Mix in string seed, then discard an initial batch of 64 values. - for (var k = 0; k < strseed.length + 64; k++) { - me.x ^= strseed.charCodeAt(k) | 0; - if (k == strseed.length) { - me.d = me.x << 10 ^ me.x >>> 4; - } - me.next(); - } - } - - function copy(f, t) { - t.x = f.x; - t.y = f.y; - t.z = f.z; - t.w = f.w; - t.v = f.v; - t.d = f.d; - return t; - } - - function impl(seed, opts) { - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (typeof(state) == 'object') copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; - } - - if (module && module.exports) { - module.exports = impl; - } else if (define && define.amd) { - define(function() { return impl; }); - } else { - this.xorwow = impl; - } - - })( - commonjsGlobal, - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader - ); - }); - - var xorshift7 = createCommonjsModule(function (module) { - // A Javascript implementaion of the "xorshift7" algorithm by - // François Panneton and Pierre L'ecuyer: - // "On the Xorgshift Random Number Generators" - // http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf - - (function(global, module, define) { - - function XorGen(seed) { - var me = this; - - // Set up generator function. - me.next = function() { - // Update xor generator. - var X = me.x, i = me.i, t, v; - t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24); - t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10); - t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3); - t = X[(i + 4) & 7]; v ^= t ^ (t << 7); - t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9); - X[i] = v; - me.i = (i + 1) & 7; - return v; - }; - - function init(me, seed) { - var j, w, X = []; - - if (seed === (seed | 0)) { - // Seed state array using a 32-bit integer. - w = X[0] = seed; - } else { - // Seed state using a string. - seed = '' + seed; - for (j = 0; j < seed.length; ++j) { - X[j & 7] = (X[j & 7] << 15) ^ - (seed.charCodeAt(j) + X[(j + 1) & 7] << 13); - } - } - // Enforce an array length of 8, not all zeroes. - while (X.length < 8) X.push(0); - for (j = 0; j < 8 && X[j] === 0; ++j); - if (j == 8) w = X[7] = -1; else w = X[j]; - - me.x = X; - me.i = 0; - - // Discard an initial 256 values. - for (j = 256; j > 0; --j) { - me.next(); - } - } - - init(me, seed); - } - - function copy(f, t) { - t.x = f.x.slice(); - t.i = f.i; - return t; - } - - function impl(seed, opts) { - if (seed == null) seed = +(new Date); - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (state.x) copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; - } - - if (module && module.exports) { - module.exports = impl; - } else if (define && define.amd) { - define(function() { return impl; }); - } else { - this.xorshift7 = impl; - } - - })( - commonjsGlobal, - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader - ); - }); - - var xor4096 = createCommonjsModule(function (module) { - // A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm. - // - // This fast non-cryptographic random number generator is designed for - // use in Monte-Carlo algorithms. It combines a long-period xorshift - // generator with a Weyl generator, and it passes all common batteries - // of stasticial tests for randomness while consuming only a few nanoseconds - // for each prng generated. For background on the generator, see Brent's - // paper: "Some long-period random number generators using shifts and xors." - // http://arxiv.org/pdf/1004.3115v1.pdf - // - // Usage: - // - // var xor4096 = require('xor4096'); - // random = xor4096(1); // Seed with int32 or string. - // assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits. - // assert.equal(random.int32(), 1806534897); // signed int32, 32 bits. - // - // For nonzero numeric keys, this impelementation provides a sequence - // identical to that by Brent's xorgens 3 implementaion in C. This - // implementation also provides for initalizing the generator with - // string seeds, or for saving and restoring the state of the generator. - // - // On Chrome, this prng benchmarks about 2.1 times slower than - // Javascript's built-in Math.random(). - - (function(global, module, define) { - - function XorGen(seed) { - var me = this; - - // Set up generator function. - me.next = function() { - var w = me.w, - X = me.X, i = me.i, t, v; - // Update Weyl generator. - me.w = w = (w + 0x61c88647) | 0; - // Update xor generator. - v = X[(i + 34) & 127]; - t = X[i = ((i + 1) & 127)]; - v ^= v << 13; - t ^= t << 17; - v ^= v >>> 15; - t ^= t >>> 12; - // Update Xor generator array state. - v = X[i] = v ^ t; - me.i = i; - // Result is the combination. - return (v + (w ^ (w >>> 16))) | 0; - }; - - function init(me, seed) { - var t, v, i, j, w, X = [], limit = 128; - if (seed === (seed | 0)) { - // Numeric seeds initialize v, which is used to generates X. - v = seed; - seed = null; - } else { - // String seeds are mixed into v and X one character at a time. - seed = seed + '\0'; - v = 0; - limit = Math.max(limit, seed.length); - } - // Initialize circular array and weyl value. - for (i = 0, j = -32; j < limit; ++j) { - // Put the unicode characters into the array, and shuffle them. - if (seed) v ^= seed.charCodeAt((j + 32) % seed.length); - // After 32 shuffles, take v as the starting w value. - if (j === 0) w = v; - v ^= v << 10; - v ^= v >>> 15; - v ^= v << 4; - v ^= v >>> 13; - if (j >= 0) { - w = (w + 0x61c88647) | 0; // Weyl. - t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array. - i = (0 == t) ? i + 1 : 0; // Count zeroes. - } - } - // We have detected all zeroes; make the key nonzero. - if (i >= 128) { - X[(seed && seed.length || 0) & 127] = -1; - } - // Run the generator 512 times to further mix the state before using it. - // Factoring this as a function slows the main generator, so it is just - // unrolled here. The weyl generator is not advanced while warming up. - i = 127; - for (j = 4 * 128; j > 0; --j) { - v = X[(i + 34) & 127]; - t = X[i = ((i + 1) & 127)]; - v ^= v << 13; - t ^= t << 17; - v ^= v >>> 15; - t ^= t >>> 12; - X[i] = v ^ t; - } - // Storing state as object members is faster than using closure variables. - me.w = w; - me.X = X; - me.i = i; - } - - init(me, seed); - } - - function copy(f, t) { - t.i = f.i; - t.w = f.w; - t.X = f.X.slice(); - return t; - } - function impl(seed, opts) { - if (seed == null) seed = +(new Date); - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (state.X) copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; - } - - if (module && module.exports) { - module.exports = impl; - } else if (define && define.amd) { - define(function() { return impl; }); - } else { - this.xor4096 = impl; - } - - })( - commonjsGlobal, // window object or global - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader - ); - }); - - var tychei = createCommonjsModule(function (module) { - // A Javascript implementaion of the "Tyche-i" prng algorithm by - // Samuel Neves and Filipe Araujo. - // See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf - - (function(global, module, define) { - - function XorGen(seed) { - var me = this, strseed = ''; - - // Set up generator function. - me.next = function() { - var b = me.b, c = me.c, d = me.d, a = me.a; - b = (b << 25) ^ (b >>> 7) ^ c; - c = (c - d) | 0; - d = (d << 24) ^ (d >>> 8) ^ a; - a = (a - b) | 0; - me.b = b = (b << 20) ^ (b >>> 12) ^ c; - me.c = c = (c - d) | 0; - me.d = (d << 16) ^ (c >>> 16) ^ a; - return me.a = (a - b) | 0; - }; - - /* The following is non-inverted tyche, which has better internal - * bit diffusion, but which is about 25% slower than tyche-i in JS. - me.next = function() { - var a = me.a, b = me.b, c = me.c, d = me.d; - a = (me.a + me.b | 0) >>> 0; - d = me.d ^ a; d = d << 16 ^ d >>> 16; - c = me.c + d | 0; - b = me.b ^ c; b = b << 12 ^ d >>> 20; - me.a = a = a + b | 0; - d = d ^ a; me.d = d = d << 8 ^ d >>> 24; - me.c = c = c + d | 0; - b = b ^ c; - return me.b = (b << 7 ^ b >>> 25); - } - */ - - me.a = 0; - me.b = 0; - me.c = 2654435769 | 0; - me.d = 1367130551; - - if (seed === Math.floor(seed)) { - // Integer seed. - me.a = (seed / 0x100000000) | 0; - me.b = seed | 0; - } else { - // String seed. - strseed += seed; - } - - // Mix in string seed, then discard an initial batch of 64 values. - for (var k = 0; k < strseed.length + 20; k++) { - me.b ^= strseed.charCodeAt(k) | 0; - me.next(); - } - } - - function copy(f, t) { - t.a = f.a; - t.b = f.b; - t.c = f.c; - t.d = f.d; - return t; - } - function impl(seed, opts) { - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (typeof(state) == 'object') copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; - } - - if (module && module.exports) { - module.exports = impl; - } else if (define && define.amd) { - define(function() { return impl; }); - } else { - this.tychei = impl; - } - - })( - commonjsGlobal, - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader - ); - }); - - var seedrandom = createCommonjsModule(function (module) { - /* - Copyright 2014 David Bau. - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - */ - - (function (pool, math) { - // - // The following constants are related to IEEE 754 limits. - // - var global = this, - width = 256, // each RC4 output is 0 <= x < 256 - chunks = 6, // at least six RC4 outputs for each double - digits = 52, // there are 52 significant digits in a double - rngname = 'random', // rngname: name for Math.random and Math.seedrandom - startdenom = math.pow(width, chunks), - significance = math.pow(2, digits), - overflow = significance * 2, - mask = width - 1, - nodecrypto; // node.js crypto module, initialized at the bottom. - - // - // seedrandom() - // This is the seedrandom function described above. - // - function seedrandom(seed, options, callback) { - var key = []; - options = (options == true) ? { entropy: true } : (options || {}); - - // Flatten the seed string or build one from local entropy if needed. - var shortseed = mixkey(flatten( - options.entropy ? [seed, tostring(pool)] : - (seed == null) ? autoseed() : seed, 3), key); - - // Use the seed to initialize an ARC4 generator. - var arc4 = new ARC4(key); - - // This function returns a random double in [0, 1) that contains - // randomness in every bit of the mantissa of the IEEE 754 value. - var prng = function() { - var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48 - d = startdenom, // and denominator d = 2 ^ 48. - x = 0; // and no 'extra last byte'. - while (n < significance) { // Fill up all significant digits by - n = (n + x) * width; // shifting numerator and - d *= width; // denominator and generating a - x = arc4.g(1); // new least-significant-byte. - } - while (n >= overflow) { // To avoid rounding up, before adding - n /= 2; // last byte, shift everything - d /= 2; // right using integer math until - x >>>= 1; // we have exactly the desired bits. - } - return (n + x) / d; // Form the number within [0, 1). - }; - - prng.int32 = function() { return arc4.g(4) | 0; }; - prng.quick = function() { return arc4.g(4) / 0x100000000; }; - prng.double = prng; - - // Mix the randomness into accumulated entropy. - mixkey(tostring(arc4.S), pool); - - // Calling convention: what to return as a function of prng, seed, is_math. - return (options.pass || callback || - function(prng, seed, is_math_call, state) { - if (state) { - // Load the arc4 state from the given state if it has an S array. - if (state.S) { copy(state, arc4); } - // Only provide the .state method if requested via options.state. - prng.state = function() { return copy(arc4, {}); }; - } - - // If called as a method of Math (Math.seedrandom()), mutate - // Math.random because that is how seedrandom.js has worked since v1.0. - if (is_math_call) { math[rngname] = prng; return seed; } - - // Otherwise, it is a newer calling convention, so return the - // prng directly. - else return prng; - })( - prng, - shortseed, - 'global' in options ? options.global : (this == math), - options.state); - } - math['seed' + rngname] = seedrandom; - - // - // ARC4 - // - // An ARC4 implementation. The constructor takes a key in the form of - // an array of at most (width) integers that should be 0 <= x < (width). - // - // The g(count) method returns a pseudorandom integer that concatenates - // the next (count) outputs from ARC4. Its return value is a number x - // that is in the range 0 <= x < (width ^ count). - // - function ARC4(key) { - var t, keylen = key.length, - me = this, i = 0, j = me.i = me.j = 0, s = me.S = []; - - // The empty key [] is treated as [0]. - if (!keylen) { key = [keylen++]; } - - // Set up S using the standard key scheduling algorithm. - while (i < width) { - s[i] = i++; - } - for (i = 0; i < width; i++) { - s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))]; - s[j] = t; - } - - // The "g" method returns the next (count) outputs as one number. - (me.g = function(count) { - // Using instance members instead of closure state nearly doubles speed. - var t, r = 0, - i = me.i, j = me.j, s = me.S; - while (count--) { - t = s[i = mask & (i + 1)]; - r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))]; - } - me.i = i; me.j = j; - return r; - // For robust unpredictability, the function call below automatically - // discards an initial batch of values. This is called RC4-drop[256]. - // See http://google.com/search?q=rsa+fluhrer+response&btnI - })(width); - } - - // - // copy() - // Copies internal state of ARC4 to or from a plain object. - // - function copy(f, t) { - t.i = f.i; - t.j = f.j; - t.S = f.S.slice(); - return t; - } - // - // flatten() - // Converts an object tree to nested arrays of strings. - // - function flatten(obj, depth) { - var result = [], typ = (typeof obj), prop; - if (depth && typ == 'object') { - for (prop in obj) { - try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {} - } - } - return (result.length ? result : typ == 'string' ? obj : obj + '\0'); - } - - // - // mixkey() - // Mixes a string seed into a key that is an array of integers, and - // returns a shortened string seed that is equivalent to the result key. - // - function mixkey(seed, key) { - var stringseed = seed + '', smear, j = 0; - while (j < stringseed.length) { - key[mask & j] = - mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++)); - } - return tostring(key); - } - - // - // autoseed() - // Returns an object for autoseeding, using window.crypto and Node crypto - // module if available. - // - function autoseed() { - try { - var out; - if (nodecrypto && (out = nodecrypto.randomBytes)) { - // The use of 'out' to remember randomBytes makes tight minified code. - out = out(width); - } else { - out = new Uint8Array(width); - (global.crypto || global.msCrypto).getRandomValues(out); - } - return tostring(out); - } catch (e) { - var browser = global.navigator, - plugins = browser && browser.plugins; - return [+new Date, global, plugins, global.screen, tostring(pool)]; - } - } - - // - // tostring() - // Converts an array of charcodes to a string - // - function tostring(a) { - return String.fromCharCode.apply(0, a); - } - - // - // When seedrandom.js is loaded, we immediately mix a few bits - // from the built-in RNG into the entropy pool. Because we do - // not want to interfere with deterministic PRNG state later, - // seedrandom will not call math.random on its own again after - // initialization. - // - mixkey(math.random(), pool); - - // - // Nodejs and AMD support: export the implementation as a module using - // either convention. - // - if ( module.exports) { - module.exports = seedrandom; - // When in node.js, try using crypto package for autoseeding. - try { - nodecrypto = require('crypto'); - } catch (ex) {} - } - - // End anonymous scope, and pass initial values. - })( - [], // pool: entropy pool starts empty - Math // math: package containing random, pow, and seedrandom - ); - }); - - // A library of seedable RNGs implemented in Javascript. - // - // Usage: - // - // var seedrandom = require('seedrandom'); - // var random = seedrandom(1); // or any seed. - // var x = random(); // 0 <= x < 1. Every bit is random. - // var x = random.quick(); // 0 <= x < 1. 32 bits of randomness. - - // alea, a 53-bit multiply-with-carry generator by Johannes Baagøe. - // Period: ~2^116 - // Reported to pass all BigCrush tests. - - - // xor128, a pure xor-shift generator by George Marsaglia. - // Period: 2^128-1. - // Reported to fail: MatrixRank and LinearComp. - - - // xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl. - // Period: 2^192-2^32 - // Reported to fail: CollisionOver, SimpPoker, and LinearComp. - - - // xorshift7, by François Panneton and Pierre L'ecuyer, takes - // a different approach: it adds robustness by allowing more shifts - // than Marsaglia's original three. It is a 7-shift generator - // with 256 bits, that passes BigCrush with no systmatic failures. - // Period 2^256-1. - // No systematic BigCrush failures reported. - - - // xor4096, by Richard Brent, is a 4096-bit xor-shift with a - // very long period that also adds a Weyl generator. It also passes - // BigCrush with no systematic failures. Its long period may - // be useful if you have many generators and need to avoid - // collisions. - // Period: 2^4128-2^32. - // No systematic BigCrush failures reported. - - - // Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random - // number generator derived from ChaCha, a modern stream cipher. - // https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf - // Period: ~2^127 - // No systematic BigCrush failures reported. - - - // The original ARC4-based prng included in this library. - // Period: ~2^1600 - - - seedrandom.alea = alea; - seedrandom.xor128 = xor128; - seedrandom.xorwow = xorwow; - seedrandom.xorshift7 = xorshift7; - seedrandom.xor4096 = xor4096; - seedrandom.tychei = tychei; - - var seedrandom$1 = seedrandom; - var seedrandom_1 = seedrandom$1.alea; - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /** - * Apply a mapping function to a nested structure in a recursive manner. - * - * The result of the mapping is an object with the same nested structure (i.e., - * of arrays and dicts) as the input, except that some subtrees are replaced, - * according to the results of the mapping function. - * - * Mappings are memoized. Thus, if the nested structure contains the same - * object in multiple positions, the output will contain the same mapped object - * in those positions. Cycles are not supported, however. - * - * @param input: The object to which to apply the mapping function. - * @param mapFn: A function that expects a single node of the object tree, and - * returns a `DeepMapResult`. The `DeepMapResult` either provides a - * replacement value for that node (i.e., replacing the subtree), or indicates - * that the node should be processed recursively. - */ - function deepMap(input, mapFn) { - return deepMapInternal(input, mapFn); - } - /** - * @param seen: A Map of known object mappings (i.e., memoized results of - * `mapFn()`) - * @param containedIn: An set containing objects on the reference path currently - * being processed (used to detect cycles). - */ - function deepMapInternal(input, mapFn, seen, containedIn) { - if (seen === void 0) { seen = new Map(); } - if (containedIn === void 0) { containedIn = new Set(); } - if (input == null) { - return null; - } - if (containedIn.has(input)) { - throw new Error('Circular references are not supported.'); - } - if (seen.has(input)) { - return seen.get(input); - } - var result = mapFn(input); - if (result.recurse && result.value !== null) { - throw new Error('A deep map function may not return both a value and recurse=true.'); - } - if (!result.recurse) { - seen.set(input, result.value); - return result.value; - } - else if (isIterable(input)) { - // tslint:disable-next-line:no-any - var mappedIterable = Array.isArray(input) ? [] : {}; - containedIn.add(input); - for (var k in input) { - var child = input[k]; - var childResult = deepMapInternal(child, mapFn, seen, containedIn); - mappedIterable[k] = childResult; - } - containedIn.delete(input); - return mappedIterable; - } - else { - throw new Error("Can't recurse into non-iterable type: " + input); - } - } - // TODO(soergel, kangyizhang) Reconsider naming of deepZip() to avoid confusion - // with zip() - /** - * Zip nested structures together in a recursive manner. - * - * This has the effect of transposing or pivoting data, e.g. converting it from - * a row-major representation to a column-major representation. - * - * For example, `deepZip([{a: 1, b: 2}, {a: 3, b: 4}])` returns - * `{a: [1, 3], b: [2, 4]}`. - * - * The inputs should all have the same nested structure (i.e., of arrays and - * dicts). The result is a single object with the same nested structure, where - * the leaves are arrays collecting the values of the inputs at that location - * (or, optionally, the result of a custom function applied to those arrays). - * - * @param inputs: An array of the objects to zip together. - * @param zipFn: (optional) A function that expects an array of elements at a - * single node of the object tree, and returns a `DeepMapResult`. The - * `DeepMapResult` either provides a result value for that node (i.e., - * representing the subtree), or indicates that the node should be processed - * recursively. The default zipFn recurses as far as possible and places - * arrays at the leaves. - */ - function deepZip(inputs, zipFn) { - if (zipFn === void 0) { zipFn = zipToList; } - return deepZipInternal(inputs, zipFn); - } - /** - * @param containedIn: An set containing objects on the reference path currently - * being processed (used to detect cycles). - */ - function deepZipInternal(inputs, zipFn, containedIn) { - if (containedIn === void 0) { containedIn = new Set(); } - // The recursion follows the structure of input 0; it's assumed that all the - // other inputs have the same structure. - var input = inputs[0]; - if (containedIn.has(input)) { - throw new Error('Circular references are not supported.'); - } - var result = zipFn(inputs); - if (result.recurse && result.value !== null) { - throw new Error('A deep zip function may not return both a value and recurse=true.'); - } - if (!result.recurse) { - return result.value; - } - else if (isIterable(input)) { - // tslint:disable-next-line:no-any - var mappedIterable = Array.isArray(input) ? [] : {}; - containedIn.add(input); - var _loop_1 = function (k) { - var children = inputs.map(function (x) { return x[k]; }); - var childResult = deepZipInternal(children, zipFn, containedIn); - mappedIterable[k] = childResult; - }; - for (var k in input) { - _loop_1(k); - } - containedIn.delete(input); - return mappedIterable; - } - else { - throw new Error("Can't recurse into non-iterable type: " + input); - } - } - // tslint:disable-next-line:no-any - function zipToList(x) { - if (x === null) { - return null; - } - // TODO(soergel): validate array type? - if (isIterable(x[0])) { - return { value: null, recurse: true }; - } - else { - return { value: x, recurse: false }; - } - } - /** - * Apply an async mapping function to a nested structure in a recursive manner. - * - * This first creates a nested structure of Promises, and then awaits all of - * those, resulting in a single Promise for a resolved nested structure. - * - * The result of the mapping is an object with the same nested structure (i.e., - * of arrays and dicts) as the input, except that some subtrees are replaced, - * according to the results of the mapping function. - * - * Mappings are memoized. Thus, if the nested structure contains the same - * object in multiple positions, the output will contain the same mapped object - * in those positions. Cycles are not supported, however. - * - * @param input: The object to which to apply the mapping function. - * @param mapFn: A function that expects a single node of the object tree, and - * returns a `DeepMapAsyncResult`. The `DeepMapAsyncResult` either provides - * a `Promise` for a replacement value for that node (i.e., replacing the - * subtree), or indicates that the node should be processed recursively. Note - * that the decision whether or not to recurse must be made immediately; only - * the mapped value may be promised. - */ - function deepMapAndAwaitAll(input, mapFn) { - return __awaiter(this, void 0, void 0, function () { - var seen, _i, _a, key, value, mappedValue, result; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - seen = new Map(); - // First do a normal deepMap, collecting Promises in 'seen' as a side effect. - deepMapInternal(input, mapFn, seen); - _i = 0, _a = Array.from(seen.keys()); - _b.label = 1; - case 1: - if (!(_i < _a.length)) return [3 /*break*/, 4]; - key = _a[_i]; - value = seen.get(key); - if (!tf.util.isPromise(value)) return [3 /*break*/, 3]; - return [4 /*yield*/, value]; - case 2: - mappedValue = _b.sent(); - seen.set(key, mappedValue); - _b.label = 3; - case 3: - _i++; - return [3 /*break*/, 1]; - case 4: - result = deepMapInternal(input, mapFn, seen); - return [2 /*return*/, result]; - } - }); - }); - } - /** - * Determine whether the argument is iterable. - * - * @returns true if the argument is an array or any non-Tensor object. - */ - // tslint:disable-next-line:no-any - function isIterable(obj) { - return obj != null && (!ArrayBuffer.isView(obj)) && - (Array.isArray(obj) || - (typeof obj === 'object' && !(obj instanceof tf.Tensor))); - } - /** - * Determine whether the argument can be converted to Tensor. - * - * Tensors, primitives, arrays, and TypedArrays all qualify; anything else does - * not. - * - * @returns true if the argument can be converted to Tensor. - */ - // tslint:disable-next-line:no-any - function canTensorify(obj) { - return obj == null || isPrimitive(obj) || Array.isArray(obj) || - (typeof obj === 'object' && (obj instanceof tf.Tensor)) || - tf.util.isTypedArray(obj); - } - /** - * Returns true if the given `value` is a primitive type. Otherwise returns - * false. This is equivalant to node util.isPrimitive - */ - function isPrimitive(value) { - return (value === null || - (typeof value !== 'object' && typeof value !== 'function')); - } - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - function deepClone(container) { - return deepMap(container, cloneIfTensor); - } - // tslint:disable-next-line: no-any - function cloneIfTensor(item) { - if (item instanceof tf.Tensor) { - return ({ value: item.clone(), recurse: false }); - } - else if (isIterable(item)) { - return { value: null, recurse: true }; - } - else { - return { value: item, recurse: false }; - } - } - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /** - * A ring buffer, providing O(1) FIFO, LIFO, and related operations. - */ - var RingBuffer = /** @class */ (function () { - /** - * Constructs a `RingBuffer`. - * @param capacity The number of items that the buffer can accomodate. - */ - function RingBuffer(capacity) { - this.capacity = capacity; - // Note we store the indices in the range 0 <= index < 2*capacity. - // This allows us to distinguish the full from the empty case. - // See https://www.snellman.net/blog/archive/2016-12-13-ring-buffers/ - this.begin = 0; // inclusive - this.end = 0; // exclusive - if (capacity == null) { - throw new RangeError('Can\'t create a ring buffer of unknown capacity.'); - } - if (capacity < 1) { - throw new RangeError('Can\'t create ring buffer of capacity < 1.'); - } - this.data = new Array(capacity); - this.doubledCapacity = 2 * capacity; - } - /** - * Map any index into the range 0 <= index < 2*capacity. - */ - RingBuffer.prototype.wrap = function (index) { - // don't trust % on negative numbers - while (index < 0) { - index += this.doubledCapacity; - } - return index % this.doubledCapacity; - }; - RingBuffer.prototype.get = function (index) { - if (index < 0) { - throw new RangeError('Can\'t get item at a negative index.'); - } - return this.data[index % this.capacity]; - }; - RingBuffer.prototype.set = function (index, value) { - if (index < 0) { - throw new RangeError('Can\'t set item at a negative index.'); - } - this.data[index % this.capacity] = value; - }; - /** - * Returns the current number of items in the buffer. - */ - RingBuffer.prototype.length = function () { - var length = this.end - this.begin; - if (length < 0) { - length = this.doubledCapacity + length; - } - return length; - }; - /** - * Reports whether the buffer is full. - * @returns true if the number of items in the buffer equals its capacity, and - * false otherwise. - */ - RingBuffer.prototype.isFull = function () { - return this.length() === this.capacity; - }; - /** - * Reports whether the buffer is empty. - * @returns true if the number of items in the buffer equals zero, and - * false otherwise. - */ - RingBuffer.prototype.isEmpty = function () { - return this.length() === 0; - }; - /** - * Adds an item to the end of the buffer. - */ - RingBuffer.prototype.push = function (value) { - if (this.isFull()) { - throw new RangeError('Ring buffer is full.'); - } - this.set(this.end, value); - this.end = this.wrap(this.end + 1); - }; - /** - * Adds many items to the end of the buffer, in order. - */ - RingBuffer.prototype.pushAll = function (values) { - for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { - var value = values_1[_i]; - this.push(value); - } - }; - /** - * Removes and returns the last item in the buffer. - */ - RingBuffer.prototype.pop = function () { - if (this.isEmpty()) { - throw new RangeError('Ring buffer is empty.'); - } - this.end = this.wrap(this.end - 1); - var result = this.get(this.end); - this.set(this.end, undefined); - return result; - }; - /** - * Adds an item to the beginning of the buffer. - */ - RingBuffer.prototype.unshift = function (value) { - if (this.isFull()) { - throw new RangeError('Ring buffer is full.'); - } - this.begin = this.wrap(this.begin - 1); - this.set(this.begin, value); - }; - /** - * Removes and returns the first item in the buffer. - */ - RingBuffer.prototype.shift = function () { - if (this.isEmpty()) { - throw new RangeError('Ring buffer is empty.'); - } - var result = this.get(this.begin); - this.set(this.begin, undefined); - this.begin = this.wrap(this.begin + 1); - return result; - }; - /** - * Removes and returns a specific item in the buffer, and moves the last item - * to the vacated slot. This is useful for implementing a shuffling stream. - * Note that this operation necessarily scrambles the original order. - * - * @param relativeIndex: the index of the item to remove, relative to the - * first item in the buffer (e.g., hiding the ring nature of the underlying - * storage). - */ - RingBuffer.prototype.shuffleExcise = function (relativeIndex) { - if (this.isEmpty()) { - throw new RangeError('Ring buffer is empty.'); - } - var index = this.wrap(this.begin + relativeIndex); - var result = this.get(index); - this.set(index, this.pop()); - return result; - }; - return RingBuffer; - }()); - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - var GrowingRingBuffer = /** @class */ (function (_super) { - __extends(GrowingRingBuffer, _super); - /** - * Constructs a `GrowingRingBuffer`. - */ - function GrowingRingBuffer() { - return _super.call(this, GrowingRingBuffer.INITIAL_CAPACITY) || this; - } - GrowingRingBuffer.prototype.isFull = function () { - return false; - }; - GrowingRingBuffer.prototype.push = function (value) { - if (_super.prototype.isFull.call(this)) { - this.expand(); - } - _super.prototype.push.call(this, value); - }; - GrowingRingBuffer.prototype.unshift = function (value) { - if (_super.prototype.isFull.call(this)) { - this.expand(); - } - _super.prototype.unshift.call(this, value); - }; - /** - * Doubles the capacity of the buffer. - */ - GrowingRingBuffer.prototype.expand = function () { - var newCapacity = this.capacity * 2; - var newData = new Array(newCapacity); - var len = this.length(); - // Rotate the buffer to start at index 0 again, since we can't just - // allocate more space at the end. - for (var i = 0; i < len; i++) { - newData[i] = this.get(this.wrap(this.begin + i)); - } - this.data = newData; - this.capacity = newCapacity; - this.doubledCapacity = 2 * this.capacity; - this.begin = 0; - this.end = len; - }; - GrowingRingBuffer.INITIAL_CAPACITY = 32; - return GrowingRingBuffer; - }(RingBuffer)); - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - // Here we implement a simple asynchronous iterator. - // This lets us avoid using either third-party stream libraries or - // recent TypeScript language support requiring polyfills. - /** - * Create a `LazyIterator` from an array of items. - */ - function iteratorFromItems(items) { - return new ArrayIterator(items); - } - /** - * Create a `LazyIterator` from a function. - * - * ```js - * let i = -1; - * const func = () => - * ++i < 5 ? {value: i, done: false} : {value: null, done: true}; - * const iter = tf.data.iteratorFromFunction(func); - * await iter.forEachAsync(e => console.log(e)); - * ``` - * - * @param func A function that produces data on each call. - */ - function iteratorFromFunction(func) { - return new FunctionCallIterator(func); - } - /** - * Create a `LazyIterator` by concatenating underlying streams, which are - * themselves provided as a stream. - * - * This can also be thought of as a "stream flatten" operation. - * - * @param baseIterators A stream of streams to be concatenated. - * @param baseErrorHandler An optional function that can intercept `Error`s - * raised during a `next()` call on the base stream. This function can decide - * whether the error should be propagated, whether the error should be - * ignored, or whether the base stream should be terminated. - */ - function iteratorFromConcatenated(baseIterators, baseErrorHandler) { - return new ChainedIterator(baseIterators, baseErrorHandler); - } - /** - * Create a `LazyIterator` by zipping together an array, dict, or nested - * structure of `LazyIterator`s (and perhaps additional constants). - * - * The underlying streams must provide elements in a consistent order such - * that they correspond. - * - * Typically, the underlying streams should have the same number of - * elements. If they do not, the behavior is determined by the - * `mismatchMode` argument. - * - * The nested structure of the `iterators` argument determines the - * structure of elements in the resulting iterator. - * - * @param iterators: An array or object containing LazyIterators at the - * leaves. - * @param mismatchMode: Determines what to do when one underlying iterator - * is exhausted before the others. `ZipMismatchMode.FAIL` (the default) - * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST` - * causes the zipped iterator to terminate with the furst underlying - * streams, so elements remaining on the longer streams are ignored. - * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling - * in nulls for the exhausted streams, until all streams are exhausted. - */ - function iteratorFromZipped(iterators, mismatchMode) { - if (mismatchMode === void 0) { mismatchMode = ZipMismatchMode.FAIL; } - return new ZipIterator(iterators, mismatchMode); - } - /** - * An asynchronous iterator, providing lazy access to a potentially - * unbounded stream of elements. - * - * Iterator can be obtained from a dataset: - * `const iter = await dataset.iterator();` - */ - var LazyIterator = /** @class */ (function () { - function LazyIterator() { - } - /** - * Collect all remaining elements of a bounded stream into an array. - * Obviously this will succeed only for small streams that fit in memory. - * Useful for testing. - * - * @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). - * - * @returns A Promise for an array of stream elements, which will resolve - * when the stream is exhausted. - */ - LazyIterator.prototype.toArrayForTest = function () { - return __awaiter(this, void 0, void 0, function () { - var stream, result, x; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - stream = this.prefetch(100); - result = []; - return [4 /*yield*/, stream.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*/, stream.next()]; - case 3: - x = _a.sent(); - return [3 /*break*/, 2]; - case 4: return [2 /*return*/, result]; - } - }); - }); - }; - /** - * Draw items from the stream until it is exhausted. - * - * This can be useful when the stream has side effects but no output. In - * that case, calling this function guarantees that the stream will be - * fully processed. - */ - LazyIterator.prototype.resolveFully = function () { - return __awaiter(this, void 0, void 0, function () { - var x; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.next()]; - case 1: - x = _a.sent(); - _a.label = 2; - case 2: - if (!!x.done) return [3 /*break*/, 4]; - return [4 /*yield*/, this.next()]; - case 3: - x = _a.sent(); - return [3 /*break*/, 2]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - /** - * Draw items from the stream until it is exhausted, or a predicate fails. - * - * This can be useful when the stream has side effects but no output. In - * that case, calling this function guarantees that the stream will be - * fully processed. - */ - LazyIterator.prototype.resolveWhile = function (predicate) { - return __awaiter(this, void 0, void 0, function () { - var x, shouldContinue; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.next()]; - case 1: - x = _a.sent(); - shouldContinue = predicate(x.value); - _a.label = 2; - case 2: - if (!((!x.done) && shouldContinue)) return [3 /*break*/, 4]; - return [4 /*yield*/, this.next()]; - case 3: - x = _a.sent(); - shouldContinue = predicate(x.value); - return [3 /*break*/, 2]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - /** - * Handles errors thrown on this stream using a provided handler function. - * - * @param handler A function that handles any `Error` thrown during a `next()` - * call and returns true if the stream should continue (dropping the failed - * call) or false if the stream should quietly terminate. If the handler - * itself throws (or rethrows) an `Error`, that will be propagated. - * - * @returns A `LazyIterator` of elements passed through from upstream, - * possibly filtering or terminating on upstream `next()` calls that - * throw an `Error`. - */ - LazyIterator.prototype.handleErrors = function (handler) { - return new ErrorHandlingLazyIterator(this, handler); - }; - // TODO(soergel): Implement reduce() etc. - /** - * Filters this stream according to `predicate`. - * - * @param predicate A function mapping a stream element to a boolean or a - * `Promise` for one. - * - * @returns A `LazyIterator` of elements for which the predicate was true. - */ - LazyIterator.prototype.filter = function (predicate) { - return new FilterIterator(this, predicate); - }; - /** - * Maps this stream through a 1-to-1 transform. - * - * @param transform A function mapping a stream element to a transformed - * element. - * - * @returns A `LazyIterator` of transformed elements. - */ - LazyIterator.prototype.map = function (transform) { - return new MapIterator(this, transform); - }; - /** - * Maps this stream through an async 1-to-1 transform. - * - * @param transform A function mapping a stream element to a `Promise` for a - * transformed stream element. - * - * @returns A `LazyIterator` of transformed elements. - */ - LazyIterator.prototype.mapAsync = function (transform) { - return new AsyncMapIterator(this, transform); - }; - /** - * Maps this stream through a 1-to-1 transform, forcing serial execution. - * - * @param transform A function mapping a stream element to a transformed - * element. - * - * @returns A `LazyIterator` of transformed elements. - */ - LazyIterator.prototype.serialMapAsync = function (transform) { - return new AsyncMapIterator(this, transform).serial(); - }; - /** - * Maps this stream through a 1-to-many transform. - * - * @param transform A function mapping a stream element to an array of - * transformed elements. - * - * @returns A `DataStream` of transformed elements. - */ - LazyIterator.prototype.flatmap = function (transform) { - return new FlatmapIterator(this, transform); - }; - /** - * Apply a function to every element of the stream. - * - * @param f A function to apply to each stream element. - */ - LazyIterator.prototype.forEachAsync = function (f) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.map(f).resolveFully()]; - }); - }); - }; - /** - * Apply a function to every element of the stream, forcing serial execution. - * - * @param f A function to apply to each stream element. Should return 'true' - * to indicate that the stream should continue, or 'false' to cause it to - * terminate. - */ - LazyIterator.prototype.serialForEach = function (f) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.serialMapAsync(f).resolveWhile(function (x) { return (x === true); })]; - }); - }); - }; - /** - * Groups elements into batches, represented as arrays of elements. - * - * We can think of the elements of this iterator as 'rows' (even if they are - * nested structures). By the same token, consecutive values for a given - * key within the elements form a 'column'. This matches the usual sense of - * 'row' and 'column' when processing tabular data (e.g., parsing a CSV). - * - * Thus, "Row-major" means that the resulting batch is simply a collection of - * rows: `[row1, row2, row3, ...]`. This is contrast to the column-major - * form, which is needed for vectorized computation. - * - * @param batchSize The number of elements desired per batch. - * @param smallLastBatch Whether to emit the final batch when it has fewer - * than batchSize elements. Default true. - * @returns A `LazyIterator` of batches of elements, represented as arrays - * of the original element type. - */ - LazyIterator.prototype.rowMajorBatch = function (batchSize, smallLastBatch) { - if (smallLastBatch === void 0) { smallLastBatch = true; } - return new RowMajorBatchIterator(this, batchSize, smallLastBatch); - }; - /** - * Groups elements into batches, represented in column-major form. - * - * We can think of the elements of this iterator as 'rows' (even if they are - * nested structures). By the same token, consecutive values for a given - * key within the elements form a 'column'. This matches the usual sense of - * 'row' and 'column' when processing tabular data (e.g., parsing a CSV). - * - * Thus, "column-major" means that the resulting batch is a (potentially - * nested) structure representing the columns. Each column entry, then, - * contains a collection of the values found in that column for a range of - * input elements. This representation allows for vectorized computation, in - * contrast to the row-major form. - * - * The inputs should all have the same nested structure (i.e., of arrays and - * dicts). The result is a single object with the same nested structure, - * where the leaves are arrays collecting the values of the inputs at that - * location (or, optionally, the result of a custom function applied to those - * arrays). - * - * @param batchSize The number of elements desired per batch. - * @param smallLastBatch Whether to emit the final batch when it has fewer - * than batchSize elements. Default true. - * @param zipFn: (optional) A function that expects an array of elements at a - * single node of the object tree, and returns a `DeepMapResult`. The - * `DeepMapResult` either provides a result value for that node (i.e., - * representing the subtree), or indicates that the node should be processed - * recursively. The default zipFn recurses as far as possible and places - * arrays at the leaves. - * @returns A `LazyIterator` of batches of elements, represented as an object - * with collections at the leaves. - */ - LazyIterator.prototype.columnMajorBatch = function (batchSize, smallLastBatch, - // tslint:disable-next-line:no-any - zipFn) { - if (smallLastBatch === void 0) { smallLastBatch = true; } - if (zipFn === void 0) { zipFn = zipToList; } - // First collect the desired number of input elements as a row-major batch. - var rowBatches = this.rowMajorBatch(batchSize, smallLastBatch); - // Now 'rotate' or 'pivot' the data, collecting all values from each column - // in the batch (i.e., for each key within the elements) into an array. - return rowBatches.map(function (x) { return deepZip(x, zipFn); }); - }; - /** - * Concatenate this `LazyIterator` with another. - * - * @param iterator A `LazyIterator` to be concatenated onto this one. - * @param baseErrorHandler An optional function that can intercept `Error`s - * raised during a `next()` call on the base stream. This function can - * decide whether the error should be propagated, whether the error should - * be ignored, or whether the base stream should be terminated. - * @returns A `LazyIterator`. - */ - LazyIterator.prototype.concatenate = function (iterator, baseErrorHandler) { - return new ChainedIterator(iteratorFromItems([this, iterator]), baseErrorHandler); - }; - /** - * Limits this stream to return at most `count` items. - * - * @param count The maximum number of items to provide from the stream. If - * a negative or undefined value is given, the entire stream is returned - * unaltered. - */ - LazyIterator.prototype.take = function (count) { - if (count < 0 || count == null) { - return this; - } - return new TakeIterator(this, count); - }; - /** - * Skips the first `count` items in this stream. - * - * @param count The number of items to skip. If a negative or undefined - * value is given, the entire stream is returned unaltered. - */ - LazyIterator.prototype.skip = function (count) { - if (count < 0 || count == null) { - return this; - } - return new SkipIterator(this, count); - }; - /** - * Prefetch the first `bufferSize` items in this stream. - * - * Note this prefetches Promises, but makes no guarantees about when those - * Promises resolve. - * - * @param bufferSize: An integer specifying the number of elements to be - * prefetched. - */ - LazyIterator.prototype.prefetch = function (bufferSize) { - return new PrefetchIterator(this, bufferSize); - }; - // TODO(soergel): deep sharded shuffle, where supported - /** - * Randomly shuffles the elements of this stream. - * - * @param bufferSize: An integer specifying the number of elements from - * this stream from which the new stream will sample. - * @param seed: (Optional.) An integer specifying the random seed that - * will be used to create the distribution. - */ - LazyIterator.prototype.shuffle = function (windowSize, seed) { - return new ShuffleIterator(this, windowSize, seed); - }; - /** - * Force an iterator to execute serially: each next() call will await the - * prior one, so that they cannot execute concurrently. - */ - LazyIterator.prototype.serial = function () { - return new SerialIterator(this); - }; - return LazyIterator; - }()); - // ============================================================================ - // The following private classes serve to implement the chainable methods - // on LazyIterator. Unfortunately they can't be placed in separate files, - // due to resulting trouble with circular imports. - // ============================================================================ - // Iterators that just extend LazyIterator directly - // ============================================================================ - var ArrayIterator = /** @class */ (function (_super) { - __extends(ArrayIterator, _super); - function ArrayIterator(items) { - var _this = _super.call(this) || this; - _this.items = items; - _this.trav = 0; - return _this; - } - ArrayIterator.prototype.summary = function () { - return "Array of " + this.items.length + " items"; - }; - ArrayIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var item; - return __generator(this, function (_a) { - if (this.trav >= this.items.length) { - return [2 /*return*/, { value: null, done: true }]; - } - item = this.items[this.trav]; - this.trav++; - return [2 /*return*/, { value: deepClone(item), done: false }]; - }); - }); - }; - return ArrayIterator; - }(LazyIterator)); - var FunctionCallIterator = /** @class */ (function (_super) { - __extends(FunctionCallIterator, _super); - function FunctionCallIterator(nextFn) { - var _this = _super.call(this) || this; - _this.nextFn = nextFn; - return _this; - } - FunctionCallIterator.prototype.summary = function () { - return "Function call"; - }; - FunctionCallIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - try { - return [2 /*return*/, this.nextFn()]; - } - catch (e) { - // Modify the error message but leave the stack trace intact - e.message = - "Error thrown while iterating through a dataset: " + e.message; - throw e; - } - return [2 /*return*/]; - }); - }); - }; - return FunctionCallIterator; - }(LazyIterator)); - var SerialIterator = /** @class */ (function (_super) { - __extends(SerialIterator, _super); - function SerialIterator(upstream) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.lastRead = Promise.resolve({ value: null, done: false }); - return _this; - } - SerialIterator.prototype.summary = function () { - return this.upstream.summary() + " -> Serial"; - }; - SerialIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var _this = this; - return __generator(this, function (_a) { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(function () { return _this.serialNext(); }); - return [2 /*return*/, this.lastRead]; - }); - }); - }; - SerialIterator.prototype.serialNext = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.upstream.next()]; - }); - }); - }; - return SerialIterator; - }(LazyIterator)); - var SkipIterator = /** @class */ (function (_super) { - __extends(SkipIterator, _super); - function SkipIterator(upstream, maxCount) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.maxCount = maxCount; - // Local state that should not be clobbered by out-of-order execution. - _this.count = 0; - _this.lastRead = Promise.resolve({ value: null, done: false }); - return _this; - } - SkipIterator.prototype.summary = function () { - return this.upstream.summary() + " -> Skip"; - }; - SkipIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var _this = this; - return __generator(this, function (_a) { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(function () { return _this.serialNext(); }); - return [2 /*return*/, this.lastRead]; - }); - }); - }; - SkipIterator.prototype.serialNext = function () { - return __awaiter(this, void 0, void 0, function () { - var skipped; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(this.count++ < this.maxCount)) return [3 /*break*/, 2]; - return [4 /*yield*/, this.upstream.next()]; - case 1: - skipped = _a.sent(); - // short-circuit if upstream is already empty - if (skipped.done) { - return [2 /*return*/, skipped]; - } - tf.dispose(skipped.value); - return [3 /*break*/, 0]; - case 2: return [2 /*return*/, this.upstream.next()]; - } - }); - }); - }; - return SkipIterator; - }(LazyIterator)); - var TakeIterator = /** @class */ (function (_super) { - __extends(TakeIterator, _super); - function TakeIterator(upstream, maxCount) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.maxCount = maxCount; - _this.count = 0; - return _this; - } - TakeIterator.prototype.summary = function () { - return this.upstream.summary() + " -> Take"; - }; - TakeIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (this.count++ >= this.maxCount) { - return [2 /*return*/, { value: null, done: true }]; - } - return [2 /*return*/, this.upstream.next()]; - }); - }); - }; - return TakeIterator; - }(LazyIterator)); - // Note this batch just groups items into row-wise element arrays. - // Rotating these to a column-wise representation happens only at the dataset - // level. - var RowMajorBatchIterator = /** @class */ (function (_super) { - __extends(RowMajorBatchIterator, _super); - function RowMajorBatchIterator(upstream, batchSize, enableSmallLastBatch) { - if (enableSmallLastBatch === void 0) { enableSmallLastBatch = true; } - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.batchSize = batchSize; - _this.enableSmallLastBatch = enableSmallLastBatch; - _this.lastRead = Promise.resolve({ value: null, done: false }); - return _this; - } - RowMajorBatchIterator.prototype.summary = function () { - return this.upstream.summary() + " -> RowMajorBatch"; - }; - RowMajorBatchIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var _this = this; - return __generator(this, function (_a) { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(function () { return _this.serialNext(); }); - return [2 /*return*/, this.lastRead]; - }); - }); - }; - RowMajorBatchIterator.prototype.serialNext = function () { - return __awaiter(this, void 0, void 0, function () { - var batch, item; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - batch = []; - _a.label = 1; - case 1: - if (!(batch.length < this.batchSize)) return [3 /*break*/, 3]; - return [4 /*yield*/, this.upstream.next()]; - case 2: - item = _a.sent(); - if (item.done) { - if (this.enableSmallLastBatch && batch.length > 0) { - return [2 /*return*/, { value: batch, done: false }]; - } - return [2 /*return*/, { value: null, done: true }]; - } - batch.push(item.value); - return [3 /*break*/, 1]; - case 3: return [2 /*return*/, { value: batch, done: false }]; - } - }); - }); - }; - return RowMajorBatchIterator; - }(LazyIterator)); - var FilterIterator = /** @class */ (function (_super) { - __extends(FilterIterator, _super); - function FilterIterator(upstream, predicate) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.predicate = predicate; - _this.lastRead = Promise.resolve({ value: null, done: false }); - return _this; - } - FilterIterator.prototype.summary = function () { - return this.upstream.summary() + " -> Filter"; - }; - FilterIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var _this = this; - return __generator(this, function (_a) { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(function () { return _this.serialNext(); }); - return [2 /*return*/, this.lastRead]; - }); - }); - }; - FilterIterator.prototype.serialNext = function () { - return __awaiter(this, void 0, void 0, function () { - var item; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - return [4 /*yield*/, this.upstream.next()]; - case 1: - item = _a.sent(); - if (item.done || this.predicate(item.value)) { - return [2 /*return*/, item]; - } - tf.dispose(item.value); - return [3 /*break*/, 0]; - case 2: return [2 /*return*/]; - } - }); - }); - }; - return FilterIterator; - }(LazyIterator)); - var MapIterator = /** @class */ (function (_super) { - __extends(MapIterator, _super); - function MapIterator(upstream, transform) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.transform = transform; - return _this; - } - MapIterator.prototype.summary = function () { - return this.upstream.summary() + " -> Map"; - }; - MapIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var item, inputTensors, mapped, outputTensors, _i, inputTensors_1, t; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.upstream.next()]; - case 1: - item = _a.sent(); - if (item.done) { - return [2 /*return*/, { value: null, done: true }]; - } - inputTensors = tf.tensor_util.getTensorsInContainer(item.value); - mapped = this.transform(item.value); - outputTensors = tf.tensor_util.getTensorsInContainer(mapped); - // TODO(soergel) faster intersection - // TODO(soergel) move to tf.disposeExcept(in, out)? - for (_i = 0, inputTensors_1 = inputTensors; _i < inputTensors_1.length; _i++) { - t = inputTensors_1[_i]; - if (!tf.tensor_util.isTensorInList(t, outputTensors)) { - t.dispose(); - } - } - return [2 /*return*/, { value: mapped, done: false }]; - } - }); - }); - }; - return MapIterator; - }(LazyIterator)); - var ErrorHandlingLazyIterator = /** @class */ (function (_super) { - __extends(ErrorHandlingLazyIterator, _super); - function ErrorHandlingLazyIterator(upstream, handler) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.handler = handler; - _this.count = 0; - _this.lastRead = Promise.resolve({ value: null, done: false }); - return _this; - } - ErrorHandlingLazyIterator.prototype.summary = function () { - return this.upstream.summary() + " -> handleErrors"; - }; - ErrorHandlingLazyIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var _this = this; - return __generator(this, function (_a) { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(function () { return _this.serialNext(); }); - return [2 /*return*/, this.lastRead]; - }); - }); - }; - ErrorHandlingLazyIterator.prototype.serialNext = function () { - return __awaiter(this, void 0, void 0, function () { - var e_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.upstream.next()]; - case 2: return [2 /*return*/, _a.sent()]; - case 3: - e_1 = _a.sent(); - if (!this.handler(e_1)) { - return [2 /*return*/, { value: null, done: true }]; - } - return [3 /*break*/, 4]; - case 4: return [3 /*break*/, 0]; - case 5: return [2 /*return*/]; - } - }); - }); - }; - return ErrorHandlingLazyIterator; - }(LazyIterator)); - var AsyncMapIterator = /** @class */ (function (_super) { - __extends(AsyncMapIterator, _super); - function AsyncMapIterator(upstream, transform) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.transform = transform; - return _this; - } - AsyncMapIterator.prototype.summary = function () { - return this.upstream.summary() + " -> AsyncMap"; - }; - AsyncMapIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var item, inputTensors, mapped, outputTensors, _i, inputTensors_2, t; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.upstream.next()]; - case 1: - item = _a.sent(); - if (item.done) { - return [2 /*return*/, { value: null, done: true }]; - } - inputTensors = tf.tensor_util.getTensorsInContainer(item.value); - return [4 /*yield*/, this.transform(item.value)]; - case 2: - mapped = _a.sent(); - outputTensors = tf.tensor_util.getTensorsInContainer(mapped); - // TODO(soergel) faster intersection - // TODO(soergel) move to tf.disposeExcept(in, out)? - for (_i = 0, inputTensors_2 = inputTensors; _i < inputTensors_2.length; _i++) { - t = inputTensors_2[_i]; - if (!tf.tensor_util.isTensorInList(t, outputTensors)) { - t.dispose(); - } - } - return [2 /*return*/, { value: mapped, done: false }]; - } - }); - }); - }; - return AsyncMapIterator; - }(LazyIterator)); - // Iterators that maintain a queue of pending items - // ============================================================================ - /** - * A base class for transforming streams that operate by maintaining an - * output queue of elements that are ready to return via next(). This is - * commonly required when the transformation is 1-to-many: A call to next() - * may trigger a call to the underlying stream, which will produce many - * mapped elements of this stream-- of which we need to return only one, so - * we have to queue the rest. - */ - var OneToManyIterator = /** @class */ (function (_super) { - __extends(OneToManyIterator, _super); - function OneToManyIterator() { - var _this = _super.call(this) || this; - _this.outputQueue = new GrowingRingBuffer(); - _this.lastRead = Promise.resolve({ value: null, done: false }); - return _this; - } - OneToManyIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var _this = this; - return __generator(this, function (_a) { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(function () { return _this.serialNext(); }); - return [2 /*return*/, this.lastRead]; - }); - }); - }; - OneToManyIterator.prototype.serialNext = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(this.outputQueue.length() === 0)) return [3 /*break*/, 2]; - return [4 /*yield*/, this.pump()]; - case 1: - // TODO(soergel): consider parallel reads. - if (!(_a.sent())) { - return [2 /*return*/, { value: null, done: true }]; - } - return [3 /*break*/, 0]; - case 2: return [2 /*return*/, { value: this.outputQueue.shift(), done: false }]; - } - }); - }); - }; - return OneToManyIterator; - }(LazyIterator)); - var FlatmapIterator = /** @class */ (function (_super) { - __extends(FlatmapIterator, _super); - function FlatmapIterator(upstream, transform) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.transform = transform; - return _this; - } - FlatmapIterator.prototype.summary = function () { - return this.upstream.summary() + " -> Flatmap"; - }; - FlatmapIterator.prototype.pump = function () { - return __awaiter(this, void 0, void 0, function () { - var item, inputTensors, mappedArray, outputTensors, _i, inputTensors_3, t; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.upstream.next()]; - case 1: - item = _a.sent(); - if (item.done) { - return [2 /*return*/, false]; - } - inputTensors = tf.tensor_util.getTensorsInContainer(item.value); - mappedArray = this.transform(item.value); - outputTensors = tf.tensor_util.getTensorsInContainer(mappedArray); - this.outputQueue.pushAll(mappedArray); - // TODO(soergel) faster intersection, and deduplicate outputTensors - // TODO(soergel) move to tf.disposeExcept(in, out)? - for (_i = 0, inputTensors_3 = inputTensors; _i < inputTensors_3.length; _i++) { - t = inputTensors_3[_i]; - if (!tf.tensor_util.isTensorInList(t, outputTensors)) { - t.dispose(); - } - } - return [2 /*return*/, true]; - } - }); - }); - }; - return FlatmapIterator; - }(OneToManyIterator)); - /** - * Provides a `LazyIterator` that concatenates a stream of underlying - * streams. - * - * Doing this in a concurrency-safe way requires some trickery. In - * particular, we want this stream to return the elements from the - * underlying streams in the correct order according to when next() was - * called, even if the resulting Promises resolve in a different order. - */ - var ChainedIterator = /** @class */ (function (_super) { - __extends(ChainedIterator, _super); - function ChainedIterator(iterators, baseErrorHandler) { - var _this = _super.call(this) || this; - _this.baseErrorHandler = baseErrorHandler; - // Strict Promise execution order: - // a next() call may not even begin until the previous one completes. - _this.lastRead = null; - // Local state that should not be clobbered by out-of-order execution. - _this.iterator = null; - _this.moreIterators = iterators; - return _this; - } - ChainedIterator.prototype.summary = function () { - var upstreamSummaries = 'TODO: fill in upstream of chained summaries'; - return upstreamSummaries + " -> Chained"; - }; - ChainedIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - this.lastRead = this.readFromChain(this.lastRead); - return [2 /*return*/, this.lastRead]; - }); - }); - }; - ChainedIterator.prototype.readFromChain = function (lastRead) { - return __awaiter(this, void 0, void 0, function () { - var iteratorResult, itemResult; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - // Must await on the previous read since the previous read may have advanced - // the stream of streams, from which we need to read. - // This is unfortunate since we can't parallelize reads. Which means - // prefetching of chained streams is a no-op. - // One solution is to prefetch immediately upstream of this. - return [4 /*yield*/, lastRead]; - case 1: - // Must await on the previous read since the previous read may have advanced - // the stream of streams, from which we need to read. - // This is unfortunate since we can't parallelize reads. Which means - // prefetching of chained streams is a no-op. - // One solution is to prefetch immediately upstream of this. - _a.sent(); - if (!(this.iterator == null)) return [3 /*break*/, 3]; - return [4 /*yield*/, this.moreIterators.next()]; - case 2: - iteratorResult = _a.sent(); - if (iteratorResult.done) { - // No more streams to stream from. - return [2 /*return*/, { value: null, done: true }]; - } - this.iterator = iteratorResult.value; - if (this.baseErrorHandler != null) { - this.iterator = this.iterator.handleErrors(this.baseErrorHandler); - } - _a.label = 3; - case 3: return [4 /*yield*/, this.iterator.next()]; - case 4: - itemResult = _a.sent(); - if (itemResult.done) { - this.iterator = null; - return [2 /*return*/, this.readFromChain(lastRead)]; - } - return [2 /*return*/, itemResult]; - } - }); - }); - }; - return ChainedIterator; - }(LazyIterator)); - var ZipMismatchMode; - (function (ZipMismatchMode) { - ZipMismatchMode[ZipMismatchMode["FAIL"] = 0] = "FAIL"; - ZipMismatchMode[ZipMismatchMode["SHORTEST"] = 1] = "SHORTEST"; - ZipMismatchMode[ZipMismatchMode["LONGEST"] = 2] = "LONGEST"; // use nulls for exhausted streams; use up the longest stream. - })(ZipMismatchMode || (ZipMismatchMode = {})); - /** - * Provides a `LazyIterator` that zips together an array, dict, or nested - * structure of `LazyIterator`s (and perhaps additional constants). - * - * The underlying streams must provide elements in a consistent order such - * that they correspond. - * - * Typically, the underlying streams should have the same number of - * elements. If they do not, the behavior is determined by the - * `mismatchMode` argument. - * - * The nested structure of the `iterators` argument determines the - * structure of elements in the resulting iterator. - * - * Doing this in a concurrency-safe way requires some trickery. In - * particular, we want this stream to return the elements from the - * underlying streams in the correct order according to when next() was - * called, even if the resulting Promises resolve in a different order. - * - * @param iterators: An array or object containing LazyIterators at the - * leaves. - * @param mismatchMode: Determines what to do when one underlying iterator - * is exhausted before the others. `ZipMismatchMode.FAIL` (the default) - * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST` - * causes the zipped iterator to terminate with the furst underlying - * streams, so elements remaining on the longer streams are ignored. - * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling - * in nulls for the exhausted streams, until all streams are exhausted. - */ - var ZipIterator = /** @class */ (function (_super) { - __extends(ZipIterator, _super); - function ZipIterator(iterators, mismatchMode) { - if (mismatchMode === void 0) { mismatchMode = ZipMismatchMode.FAIL; } - var _this = _super.call(this) || this; - _this.iterators = iterators; - _this.mismatchMode = mismatchMode; - _this.count = 0; - _this.currentPromise = null; - return _this; - } - ZipIterator.prototype.summary = function () { - var upstreamSummaries = 'TODO: fill in upstream of zip summaries'; - return "{" + upstreamSummaries + "} -> Zip"; - }; - ZipIterator.prototype.nextState = function (afterState) { - return __awaiter(this, void 0, void 0, function () { - function getNext(container) { - if (container instanceof LazyIterator) { - var result = container.next(); - return { - value: result.then(function (x) { - numIterators++; - if (x.done) { - iteratorsDone++; - } - return x.value; - }), - recurse: false - }; - } - else { - return { value: null, recurse: true }; - } - } - var numIterators, iteratorsDone, mapped; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - // This chaining ensures that the underlying next() are not even called - // before the previous ones have resolved. - return [4 /*yield*/, afterState]; - case 1: - // This chaining ensures that the underlying next() are not even called - // before the previous ones have resolved. - _a.sent(); - numIterators = 0; - iteratorsDone = 0; - return [4 /*yield*/, deepMapAndAwaitAll(this.iterators, getNext)]; - case 2: - mapped = _a.sent(); - if (numIterators === iteratorsDone) { - // The streams have all ended. - return [2 /*return*/, { value: null, done: true }]; - } - if (iteratorsDone > 0) { - switch (this.mismatchMode) { - case ZipMismatchMode.FAIL: - throw new Error('Zipped streams should have the same length. ' + - ("Mismatched at element " + this.count + ".")); - case ZipMismatchMode.SHORTEST: - return [2 /*return*/, { value: null, done: true }]; - case ZipMismatchMode.LONGEST: - // Continue. The exhausted streams already produced value: null. - } - } - this.count++; - return [2 /*return*/, { value: mapped, done: false }]; - } - }); - }); - }; - ZipIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - this.currentPromise = this.nextState(this.currentPromise); - return [2 /*return*/, this.currentPromise]; - }); - }); - }; - return ZipIterator; - }(LazyIterator)); - // Iterators that maintain a ring buffer of pending promises - // ============================================================================ - /** - * A stream that prefetches a given number of items from an upstream source, - * returning them in FIFO order. - * - * Note this prefetches Promises, but makes no guarantees about when those - * Promises resolve. - */ - var PrefetchIterator = /** @class */ (function (_super) { - __extends(PrefetchIterator, _super); - function PrefetchIterator(upstream, bufferSize) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.bufferSize = bufferSize; - _this.buffer = new RingBuffer(bufferSize); - return _this; - } - PrefetchIterator.prototype.summary = function () { - return this.upstream.summary() + " -> Prefetch"; - }; - /** - * Refill the prefetch buffer. Returns only after the buffer is full, or - * the upstream source is exhausted. - */ - PrefetchIterator.prototype.refill = function () { - while (!this.buffer.isFull()) { - var v = this.upstream.next(); - this.buffer.push(v); - } - }; - PrefetchIterator.prototype.next = function () { - this.refill(); - // This shift will never throw an error because the buffer is always - // full after a refill. If the stream is exhausted, the buffer will be - // full of Promises that will resolve to the end-of-stream signal. - return this.buffer.shift(); - }; - return PrefetchIterator; - }(LazyIterator)); - /** - * A stream that performs a sliding-window random shuffle on an upstream - * source. This is like a `PrefetchIterator` except that the items are - * returned in randomized order. Mixing naturally improves as the buffer - * size increases. - */ - var ShuffleIterator = /** @class */ (function (_super) { - __extends(ShuffleIterator, _super); - function ShuffleIterator(upstream, windowSize, seed) { - var _this = _super.call(this, upstream, windowSize) || this; - _this.upstream = upstream; - _this.windowSize = windowSize; - // Local state that should not be clobbered by out-of-order execution. - _this.upstreamExhausted = false; - _this.random = seedrandom_1(seed || tf.util.now().toString()); - _this.lastRead = Promise.resolve({ value: null, done: false }); - return _this; - } - ShuffleIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var _this = this; - return __generator(this, function (_a) { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(function () { return _this.serialNext(); }); - return [2 /*return*/, this.lastRead]; - }); - }); - }; - ShuffleIterator.prototype.randomInt = function (max) { - return Math.floor(this.random() * max); - }; - ShuffleIterator.prototype.chooseIndex = function () { - return this.randomInt(this.buffer.length()); - }; - ShuffleIterator.prototype.serialNext = function () { - return __awaiter(this, void 0, void 0, function () { - var chosenIndex, result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - // TODO(soergel): consider performance - if (!this.upstreamExhausted) { - this.refill(); - } - _a.label = 1; - case 1: - if (!!this.buffer.isEmpty()) return [3 /*break*/, 3]; - chosenIndex = this.chooseIndex(); - return [4 /*yield*/, this.buffer.shuffleExcise(chosenIndex)]; - case 2: - result = _a.sent(); - if (result.done) { - this.upstreamExhausted = true; - } - else { - this.refill(); - return [2 /*return*/, result]; - } - return [3 /*break*/, 1]; - case 3: return [2 /*return*/, { value: null, done: true }]; - } - }); - }); - }; - return ShuffleIterator; - }(PrefetchIterator)); - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - // TODO(soergel): consider vectorized operations within the pipeline. - /** - * Represents a potentially large list of independent data elements (typically - * 'samples' or 'examples'). - * - * A 'data example' may be a primitive, an array, a map from string keys to - * values, or any nested structure of these. - * - * A `Dataset` represents an ordered collection of elements, together with a - * chain of transformations to be performed on those elements. Each - * transformation is a method of `Dataset` that returns another `Dataset`, so - * these may be chained, e.g. - * `const processedDataset = rawDataset.filter(...).map(...).batch(...)`. - * - * Data loading and transformation is done in a lazy, streaming fashion. The - * dataset may be iterated over multiple times; each iteration starts the data - * loading anew and recapitulates the transformations. - * - * A `Dataset` is typically processed as a stream of unbatched examples --i.e., - * its transformations are applied one example at a time. Batching produces a - * new `Dataset` where each element is a batch. Batching should usually come - * last in a pipeline, because data transformations are easier to express on a - * per-example basis than on a per-batch basis. - * - * The following code examples are calling `await dataset.forEachAsync(...)` to - * iterate once over the entire dataset in order to print out the data. - * - * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'} - */ - var Dataset = /** @class */ (function () { - function Dataset() { - this.size = null; - } - // TODO(soergel): Make Datasets report whether repeated iterator() calls - // produce the same result (e.g., reading from a file) or different results - // (e.g., from the webcam). Currently we don't make this distinction but it - // could be important for the user to know. - // abstract isDeterministic(): boolean; - /** - * Groups elements into batches. - * - * It is assumed that each of the incoming dataset elements has the same - * structure-- i.e. the same set of keys at each location in an object - * hierarchy. For each key, the resulting `Dataset` provides a batched - * element collecting all of the incoming values for that key. - * - * * Incoming primitives are grouped into a 1-D Tensor. - * * Incoming Tensors are grouped into a new Tensor where the 0'th axis is - * the batch dimension. - * * Incoming arrays are converted to Tensor and then batched. - * * A nested array is interpreted as an n-D Tensor, so the batched result - * has n+1 dimensions. - * * An array that cannot be converted to Tensor produces an error. - * - * If an array should not be batched as a unit, it should first be converted - * to an object with integer keys. - * - * Here are a few examples: - * - * Batch a dataset of numbers: - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8]).batch(4); - * await a.forEachAsync(e => e.print()); - * ``` - * - * Batch a dataset of arrays: - * ```js - * const b = tf.data.array([[1], [2], [3], [4], [5], [6], [7], [8]]).batch(4); - * await b.forEachAsync(e => e.print()); - * ``` - * - * Batch a dataset of objects: - * ```js - * const c = tf.data.array([{a: 1, b: 11}, {a: 2, b: 12}, {a: 3, b: 13}, - * {a: 4, b: 14}, {a: 5, b: 15}, {a: 6, b: 16}, {a: 7, b: 17}, - * {a: 8, b: 18}]).batch(4); - * await c.forEachAsync(e => { - * console.log('{'); - * for(var key in e) { - * console.log(key+':'); - * e[key].print(); - * } - * console.log('}'); - * }) - * ``` - * - * @param batchSize The number of elements desired per batch. - * @param smallLastBatch Whether to emit the final batch when it has fewer - * than batchSize elements. Default true. - * @returns A `Dataset`, from which a stream of batches can be obtained. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.batch = function (batchSize, smallLastBatch) { - var _this = this; - if (smallLastBatch === void 0) { smallLastBatch = true; } - var base = this; - tf.util.assert(batchSize > 0, function () { return "batchSize needs to be positive, but it is\n " + batchSize; }); - var size; - if (this.size === Infinity || this.size == null) { - // If the size of this dataset is infinity or null, the new size keeps the - // same. - size = this.size; - } - else if (smallLastBatch) { - // If the size of this dataset is known and include small last batch, the - // new size is full batch count plus last batch. - size = Math.ceil(this.size / batchSize); - } - else { - // If the size of this dataset is known and not include small last batch, - // the new size is full batch count. - size = Math.floor(this.size / batchSize); - } - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, base.iterator()]; - case 1: return [2 /*return*/, (_a.sent()) - .columnMajorBatch(batchSize, smallLastBatch, deepBatchConcat)]; - } - }); - }); }, size); - }; - /** - * Concatenates this `Dataset` with another. - * - * ```js - * const a = tf.data.array([1, 2, 3]); - * const b = tf.data.array([4, 5, 6]); - * const c = a.concatenate(b); - * await c.forEachAsync(e => console.log(e)); - * ``` - * - * @param dataset A `Dataset` to be concatenated onto this one. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.concatenate = function (dataset) { - var _this = this; - var base = this; - var size; - if (this.size === Infinity || dataset.size === Infinity) { - // If the size of any of these two dataset is infinity, new size is - // infinity. - size = Infinity; - } - else if (this.size != null && dataset.size != null) { - // If the size of both datasets are known and not infinity, new size is - // sum the size of these two datasets. - size = this.size + dataset.size; - } - else { - // If neither of these two datasets has infinite size and any of these two - // datasets' size is null, the new size is null. - size = null; - } - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { var _a, _b; return __generator(this, function (_c) { - switch (_c.label) { - case 0: return [4 /*yield*/, base.iterator()]; - case 1: - _b = (_a = (_c.sent())).concatenate; - return [4 /*yield*/, dataset.iterator()]; - case 2: return [2 /*return*/, _b.apply(_a, [_c.sent()])]; - } - }); }); }, size); - }; - /** - * Filters this dataset according to `predicate`. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) - * .filter(x => x%2 === 0); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param predicate A function mapping a dataset element to a boolean or a - * `Promise` for one. - * - * @returns A `Dataset` of elements for which the predicate was true. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.filter = function (predicate) { - var _this = this; - var base = this; - var size; - if (this.size === Infinity) { - // If the size of this dataset is infinity, new size is infinity - size = Infinity; - } - else { - // If this dataset has limited elements, new size is null because it might - // exhausted randomly. - size = null; - } - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, base.iterator()]; - case 1: return [2 /*return*/, (_a.sent()).filter(function (x) { return tf.tidy(function () { return predicate(x); }); })]; - } - }); - }); }, size); - }; - /** - * Apply a function to every element of the dataset. - * - * After the function is applied to a dataset element, any Tensors contained - * within that element are disposed. - * - * ```js - * const a = tf.data.array([1, 2, 3]); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param f A function to apply to each dataset element. - * @returns A `Promise` that resolves after all elements have been processed. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.forEachAsync = function (f) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.iterator()]; - case 1: return [2 /*return*/, (_a.sent()).forEachAsync(f)]; - } - }); - }); - }; - /** - * Maps this dataset through a 1-to-1 transform. - * - * ```js - * const a = tf.data.array([1, 2, 3]).map(x => x*x); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param transform A function mapping a dataset element to a transformed - * dataset element. - * - * @returns A `Dataset` of transformed elements. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.map = function (transform) { - var _this = this; - var base = this; - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, base.iterator()]; - case 1: return [2 /*return*/, (_a.sent()).map(function (x) { return tf.tidy(function () { return transform(x); }); })]; - } - }); - }); }, this.size); - }; - /** - * Maps this dataset through an async 1-to-1 transform. - * - * ```js - * const a = - * tf.data.array([1, 2, 3]).mapAsync(x => new Promise(function(resolve){ - * setTimeout(() => { - * resolve(x * x); - * }, Math.random()*1000 + 500); - * })); - * console.log(await a.toArray()); - * ``` - * - * @param transform A function mapping a dataset element to a `Promise` for a - * transformed dataset element. This transform is responsible for disposing - * any intermediate `Tensor`s, i.e. by wrapping its computation in - * `tf.tidy()`; that cannot be automated here (as it is in the synchronous - * `map()` case). - * - * @returns A `Dataset` of transformed elements. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.mapAsync = function (transform) { - var _this = this; - var base = this; - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, base.iterator()]; - case 1: return [2 /*return*/, (_a.sent()).mapAsync(transform)]; - } - }); - }); }, this.size); - }; - /** - * Creates a `Dataset` that prefetches elements from this dataset. - * - * @param bufferSize: An integer specifying the number of elements to be - * prefetched. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.prefetch = function (bufferSize) { - var _this = this; - if (bufferSize == null) { - throw new RangeError('`Dataset.prefetch()` requires bufferSize to be specified.'); - } - var base = this; - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, base.iterator()]; - case 1: return [2 /*return*/, (_a.sent()).prefetch(bufferSize)]; - } - }); }); }, this.size); - }; - /** - * Repeats this dataset `count` times. - * - * NOTE: If this dataset is a function of global state (e.g. a random number - * generator), then different repetitions may produce different elements. - * - * ```js - * const a = tf.data.array([1, 2, 3]).repeat(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param count: (Optional) An integer, representing the number of times - * the dataset should be repeated. The default behavior (if `count` is - * `undefined` or negative) is for the dataset be repeated indefinitely. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.repeat = function (count) { - var _this = this; - var base = this; - var size; - if (this.size != null && count > 0) { - // If this dataset has size and count is positive, new size is current - // size multiply count. This also covers the case that current size is - // infinity. - size = this.size * count; - } - else if (count === 0) { - // If count is 0, new size is 0. - size = 0; - } - else if (this.size != null && (count === undefined || count < 0)) { - // If this dataset has size and count is undefined or negative, the - // dataset will be repeated indefinitely and new size is infinity. - size = Infinity; - } - else { - // If the size of this dataset is null, the new dataset's size is null. - size = null; - } - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { - var iteratorIterator; - var _this = this; - return __generator(this, function (_a) { - iteratorIterator = iteratorFromFunction(function () { return __awaiter(_this, void 0, void 0, function () { var _a; return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _a = {}; - return [4 /*yield*/, base.iterator()]; - case 1: return [2 /*return*/, (_a.value = _b.sent(), _a.done = false, _a)]; - } - }); }); }); - return [2 /*return*/, iteratorFromConcatenated(iteratorIterator.take(count))]; - }); - }); }, size); - }; - /** - * Creates a `Dataset` that skips `count` initial elements from this dataset. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]).skip(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param count: The number of elements of this dataset that should be skipped - * to form the new dataset. If `count` is greater than the size of this - * dataset, the new dataset will contain no elements. If `count` - * is `undefined` or negative, skips the entire dataset. - * - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.skip = function (count) { - var _this = this; - var base = this; - var size; - if (this.size != null && count >= 0 && this.size >= count) { - // If the size of this dataset is greater than count, the new dataset's - // size is current size minus skipped size.This also covers the case that - // current size is infinity. - size = this.size - count; - } - else if (this.size != null && - (this.size < count || count === undefined || count < 0)) { - // If the size of this dataset is smaller than count, or count is - // undefined or negative, skips the entire dataset and the new size is 0. - size = 0; - } - else { - // If the size of this dataset is null, the new dataset's size is null. - size = null; - } - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, base.iterator()]; - case 1: return [2 /*return*/, (_a.sent()).skip(count)]; - } - }); }); }, size); - }; - /** - * Pseudorandomly shuffles the elements of this dataset. This is done in a - * streaming manner, by sampling from a given number of prefetched elements. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]).shuffle(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param bufferSize: An integer specifying the number of elements from this - * dataset from which the new dataset will sample. - * @param seed: (Optional) An integer specifying the random seed that will - * be used to create the distribution. - * @param reshuffleEachIteration: (Optional) A boolean, which if true - * indicates that the dataset should be pseudorandomly reshuffled each time - * it is iterated over. If false, elements will be returned in the same - * shuffled order on each iteration. (Defaults to `true`.) - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.shuffle = function (bufferSize, seed, reshuffleEachIteration) { - var _this = this; - if (reshuffleEachIteration === void 0) { reshuffleEachIteration = true; } - if (bufferSize == null || bufferSize < 0) { - if (this.size == null) { - throw new RangeError('`Dataset.shuffle()` requires bufferSize to be specified.'); - } - else { - throw new RangeError('`Dataset.shuffle()` requires bufferSize to be specified. ' + - 'If your data fits in main memory (for regular JS objects), ' + - 'and/or GPU memory (for `tf.Tensor`s), consider setting ' + - ("bufferSize to the dataset size (" + this.size + " elements)")); - } - } - var base = this; - var random = seedrandom_1(seed || tf.util.now().toString()); - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { - var seed2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - seed2 = random.int32(); - if (reshuffleEachIteration) { - seed2 += random.int32(); - } - return [4 /*yield*/, base.iterator()]; - case 1: return [2 /*return*/, (_a.sent()).shuffle(bufferSize, seed2.toString())]; - } - }); - }); }, this.size); - }; - /** - * Creates a `Dataset` with at most `count` initial elements from this - * dataset. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]).take(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param count: The number of elements of this dataset that should be taken - * to form the new dataset. If `count` is `undefined` or negative, or if - * `count` is greater than the size of this dataset, the new dataset will - * contain all elements of this dataset. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.take = function (count) { - var _this = this; - var base = this; - var size; - if (this.size != null && this.size > count) { - // If the size of this dataset is greater than count, the new dataset's - // size is count. - size = count; - } - else if (this.size != null && this.size <= count) { - // If the size of this dataset is equal or smaller than count, the new - // dataset's size is the size of this dataset. - size = this.size; - } - else { - // If the size of this dataset is null, the new dataset's size is null. - size = null; - } - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, base.iterator()]; - case 1: return [2 /*return*/, (_a.sent()).take(count)]; - } - }); }); }, size); - }; - /** - * Collect all elements of this dataset into an array. - * - * Obviously this will succeed only for small datasets that fit in memory. - * Useful for testing and generally should be avoided if possible. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]); - * console.log(await a.toArray()); - * ``` - * - * @returns A Promise for an array of elements, which will resolve - * when a new stream has been obtained and fully consumed. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.toArray = 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()).toArray()]; - } - }); - }); - }; - /** - * 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 - Dataset.MAX_BUFFER_SIZE = 10000; - return Dataset; - }()); - /** - * Create a `Dataset` defined by a provided iterator() function. - * - * ```js - * let i = -1; - * const func = () => - * ++i < 5 ? {value: i, done: false} : {value: null, done: true}; - * const iter = tf.data.iteratorFromFunction(func); - * const ds = tf.data.datasetFromIteratorFn(iter); - * await ds.forEachAsync(e => console.log(e)); - * ``` - */ - function datasetFromIteratorFn(iteratorFn, size) { - if (size === void 0) { size = null; } - return new /** @class */ (function (_super) { - __extends(class_1, _super); - function class_1() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.size = size; - return _this; - } - /* - * Provide a new stream of elements. Note this will also start new streams - * from any underlying `Dataset`s. - */ - class_1.prototype.iterator = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, iteratorFn()]; - }); - }); - }; - return class_1; - }(Dataset))(); - } - /** - * Create a `Dataset` from an array of elements. - * - * Create a Dataset from an array of objects: - * ```js - * const a = tf.data.array([{'item': 1}, {'item': 2}, {'item': 3}]); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * Create a Dataset from an array of numbers: - * ```js - * const a = tf.data.array([4, 5, 6]); - * await a.forEachAsync(e => console.log(e)); - * ``` - * @param items An array of elements that will be parsed as items in a dataset. - * - * @doc {heading: 'Data', subheading: 'Creation', namespace: 'data'} - */ - function array(items) { - var _this = this; - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/, iteratorFromItems(items)]; - }); }); }, items.length); - } - /** - * Create a `Dataset` by zipping together an array, dict, or nested - * structure of `Dataset`s (and perhaps additional constants). - * The underlying datasets must provide elements in a consistent order such that - * they correspond. - * - * The number of elements in the resulting dataset is the same as the size of - * the smallest dataset in datasets. - * - * The nested structure of the `datasets` argument determines the - * structure of elements in the resulting iterator. - * - * Note this means that, given an array of two datasets that produce dict - * elements, the result is a dataset that produces elements that are arrays - * of two dicts: - * - * Zip an array of datasets: - * ```js - * console.log('Zip two datasets of objects:'); - * const ds1 = tf.data.array([{a: 1}, {a: 2}, {a: 3}]); - * const ds2 = tf.data.array([{b: 4}, {b: 5}, {b: 6}]); - * const ds3 = tf.data.zip([ds1, ds2]); - * await ds3.forEachAsync(e => console.log(JSON.stringify(e))); - * - * // If the goal is to merge the dicts in order to produce elements like - * // {a: ..., b: ...}, this requires a second step such as: - * console.log('Merge the objects:'); - * const ds4 = ds3.map(x => {return {a: x[0].a, b: x[1].b}}); - * await ds4.forEachAsync(e => console.log(e)); - * ``` - * - * Zip a dict of datasets: - * ```js - * const a = tf.data.array([{a: 1}, {a: 2}, {a: 3}]); - * const b = tf.data.array([{b: 4}, {b: 5}, {b: 6}]); - * const c = tf.data.zip({c: a, d: b}); - * await c.forEachAsync(e => console.log(JSON.stringify(e))); - * ``` - * - * @doc {heading: 'Data', subheading: 'Operations', namespace: 'data'} - */ - function zip(datasets) { - var _this = this; - // manually type-check the argument for JS users - if (!isIterable(datasets)) { - throw new Error('The argument to zip() must be an object or array.'); - } - var size; - if (Array.isArray(datasets)) { - for (var i = 0; i < datasets.length; i++) { - size = size == null ? datasets[i].size : - Math.min(size, datasets[i].size); - } - } - else if (datasets instanceof Object) { - for (var ds in datasets) { - size = size == null ? datasets[ds].size : - Math.min(size, datasets[ds].size); - } - } - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { - var streams; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, deepMapAndAwaitAll(datasets, function (d) { - if (d instanceof Dataset) { - return { value: d.iterator(), recurse: false }; - } - else if (isIterable(d)) { - return { value: null, recurse: true }; - } - else { - throw new Error('Leaves of the structure passed to zip() must be Datasets, ' + - 'not primitives.'); - } - })]; - case 1: - streams = _a.sent(); - return [2 /*return*/, iteratorFromZipped(streams, ZipMismatchMode.SHORTEST)]; - } - }); - }); }, size); - } - /** - * A zip function for use with deepZip, passed via the columnMajorBatch call. - * - * Accepts an array of identically-structured nested elements and either batches - * them (if they are primitives, numeric arrays, or Tensors) or requests - * recursion (if not). - */ - // tslint:disable-next-line:no-any - function deepBatchConcat(rows) { - if (rows === null) { - return null; - } - // use the first item to decide whether to recurse or batch here. - var exampleRow = rows[0]; - if (canTensorify(exampleRow)) { - // rows is an array of primitives, Tensors, or arrays. Batch them. - var value = batchConcat(rows); - return { value: value, recurse: false }; - } - // the example row is an object, so recurse into it. - return { value: null, recurse: true }; - } - /** - * Assembles a list of same-shaped numbers, number arrays, or Tensors - * into a single new Tensor where axis 0 is the batch dimension. - */ - function batchConcat(arrays) { - if (arrays.length === 0) { - // We can't return an empty Tensor because we don't know the element shape. - throw new Error('Can\'t make a batch of zero elements.'); - } - if (arrays[0] instanceof tf.Tensor) { - // Input is an array of Tensors - return tf.stack(arrays); - } - else { - // Input is a possibly-nested array of numbers. - return tf.tensor(arrays); - } - } - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /** - * Represents a potentially large collection of text lines. - * - * The results are not batched. - */ - var TextLineDataset = /** @class */ (function (_super) { - __extends(TextLineDataset, _super); - /** - * Create a `TextLineDataset`. - * - * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream. - */ - function TextLineDataset(input) { - var _this = _super.call(this) || this; - _this.input = input; - return _this; - } - TextLineDataset.prototype.iterator = function () { - return __awaiter(this, void 0, void 0, function () { - var inputIterator, utf8Iterator, lineIterator; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.input.iterator()]; - case 1: - inputIterator = _a.sent(); - utf8Iterator = inputIterator.decodeUTF8(); - lineIterator = utf8Iterator.split('\n').map(function (line) { - // Windows/DOS format text file has extra line breaker at the end of line. - if (line.endsWith('\r')) { - line = line.slice(0, -1); - } - return line; - }); - return [2 /*return*/, lineIterator]; - } - }); - }); - }; - return TextLineDataset; - }(Dataset)); - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - var CODE_QUOTE = '"'; - var STATE_OUT = Symbol('out'); - var STATE_FIELD = Symbol('field'); - var STATE_QUOTE = Symbol('quote'); - var STATE_QUOTE_AFTER_QUOTE = Symbol('quoteafterquote'); - var STATE_WITHIN_QUOTE_IN_QUOTE = Symbol('quoteinquote'); - /** - * Represents a potentially large collection of delimited text records. - * - * The produced `TensorContainer`s each contain one key-value pair for - * every column of the table. When a field is empty in the incoming data, the - * resulting value is `undefined`, or throw error if it is required. Values - * that can be parsed as numbers are emitted as type `number`, other values - * are parsed as `string`. - * - * The results are not batched. - * - * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'} - */ - var CSVDataset = /** @class */ (function (_super) { - __extends(CSVDataset, _super); - /** - * Create a `CSVDataset`. - * - * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream. - * @param csvConfig (Optional) A CSVConfig object that contains configurations - * of reading and decoding from CSV file(s). - * - * hasHeader: (Optional) A boolean value that indicates whether the first - * row of provided CSV file is a header line with column names, and should - * not be included in the data. Defaults to `true`. - * - * columnNames: (Optional) A list of strings that corresponds to - * the CSV column names, in order. If provided, it ignores the column - * names inferred from the header row. If not provided, infers the column - * names from the first row of the records. If hasHeader is false and - * columnNames is not provided, this method throws an error. - * - * columnConfigs: (Optional) A dictionary whose key is column names, value - * is an object stating if this column is required, column's data type, - * default value, and if this column is label. If provided, keys must - * correspond to names provided in columnNames or inferred from the file - * header lines. If isLabel is true any column, returns an array of two - * items: the first item is a dict of features key/value pairs, the second - * item is a dict of labels key/value pairs. If no feature is marked as - * label, returns a dict of features only. - * - * configuredColumnsOnly (Optional) If true, only columns provided in - * columnConfigs will be parsed and provided during iteration. - * - * delimiter (Optional) The string used to parse each line of the input - * file. Defaults to `,`. - */ - function CSVDataset(input, csvConfig) { - var _this = _super.call(this) || this; - _this.input = input; - _this.hasHeader = true; - _this.fullColumnNames = null; - _this.columnNamesValidated = false; - _this.columnConfigs = null; - _this.configuredColumnsOnly = false; - _this.delimiter = ','; - _this.delimWhitespace = false; - _this.base = new TextLineDataset(input); - if (!csvConfig) { - csvConfig = {}; - } - _this.hasHeader = csvConfig.hasHeader === false ? false : true; - _this.fullColumnNames = csvConfig.columnNames; - _this.columnConfigs = csvConfig.columnConfigs; - _this.configuredColumnsOnly = csvConfig.configuredColumnsOnly; - if (csvConfig.delimWhitespace) { - tf.util.assert(csvConfig.delimiter == null, function () { - return 'Delimiter should not be provided when delimWhitespace is true.'; - }); - _this.delimWhitespace = true; - _this.delimiter = ' '; - } - else { - _this.delimiter = csvConfig.delimiter ? csvConfig.delimiter : ','; - } - return _this; - } - /** - * Returns column names of the csv dataset. If `configuredColumnsOnly` is - * true, return column names in `columnConfigs`. If `configuredColumnsOnly` is - * false and `columnNames` is provided, `columnNames`. If - * `configuredColumnsOnly` is false and `columnNames` is not provided, return - * all column names parsed from the csv file. For example usage please go to - * `tf.data.csv`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - CSVDataset.prototype.columnNames = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!!this.columnNamesValidated) return [3 /*break*/, 2]; - return [4 /*yield*/, this.setColumnNames()]; - case 1: - _a.sent(); - _a.label = 2; - case 2: return [2 /*return*/, this.configuredColumnsOnly ? Object.keys(this.columnConfigs) : - this.fullColumnNames]; - } - }); - }); - }; - /* 1) If `columnNames` is provided as string[], use this string[] as output - * keys in corresponding order. The length must match the number of inferred - * columns if `hasHeader` is true . - * 2) If `columnNames` is not provided, parse header line as `columnNames` if - * hasHeader is true. If `hasHeader` is false, throw an error. - * 3) If `columnConfigs` is provided, all the keys in `columnConfigs` must - * exist in parsed `columnNames`. - */ - CSVDataset.prototype.setColumnNames = function () { - return __awaiter(this, void 0, void 0, function () { - var columnNamesFromFile, counts, duplicateNames, _i, _a, key, index; - var _this = this; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: return [4 /*yield*/, this.maybeReadHeaderLine()]; - case 1: - columnNamesFromFile = _b.sent(); - if (!this.fullColumnNames && !columnNamesFromFile) { - // Throw an error if columnNames is not provided and no header line. - throw new Error('Column names must be provided if there is no header line.'); - } - else if (this.fullColumnNames && columnNamesFromFile) { - // Check provided columnNames match header line. - tf.util.assert(columnNamesFromFile.length === this.fullColumnNames.length, function () { return 'The length of provided columnNames (' + - _this.fullColumnNames.length.toString() + - ') does not match the length of the header line read from ' + - 'file (' + columnNamesFromFile.length.toString() + ').'; }); - } - if (!this.fullColumnNames) { - this.fullColumnNames = columnNamesFromFile; - } - counts = this.fullColumnNames.reduce(function (countAcc, name) { - countAcc[name] = (countAcc[name] + 1) || 1; - return countAcc; - }, {}); - duplicateNames = Object.keys(counts).filter(function (name) { return (counts[name] > 1); }); - tf.util.assert(duplicateNames.length === 0, function () { return 'Duplicate column names found: ' + duplicateNames.toString(); }); - // Check if keys in columnConfigs match columnNames. - if (this.columnConfigs) { - for (_i = 0, _a = Object.keys(this.columnConfigs); _i < _a.length; _i++) { - key = _a[_i]; - index = this.fullColumnNames.indexOf(key); - if (index === -1) { - throw new Error('The key "' + key + - '" provided in columnConfigs does not match any of the column ' + - 'names (' + this.fullColumnNames.toString() + ').'); - } - } - } - this.columnNamesValidated = true; - return [2 /*return*/]; - } - }); - }); - }; - CSVDataset.prototype.maybeReadHeaderLine = function () { - return __awaiter(this, void 0, void 0, function () { - var iter, firstElement, firstLine, headers; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!this.hasHeader) return [3 /*break*/, 3]; - return [4 /*yield*/, this.base.iterator()]; - case 1: - iter = _a.sent(); - return [4 /*yield*/, iter.next()]; - case 2: - firstElement = _a.sent(); - if (firstElement.done) { - throw new Error('No data was found for CSV parsing.'); - } - firstLine = firstElement.value; - headers = this.parseRow(firstLine, false); - return [2 /*return*/, headers]; - case 3: return [2 /*return*/, null]; - } - }); - }); - }; - CSVDataset.prototype.iterator = function () { - return __awaiter(this, void 0, void 0, function () { - var lines; - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!!this.columnNamesValidated) return [3 /*break*/, 2]; - return [4 /*yield*/, this.setColumnNames()]; - case 1: - _a.sent(); - _a.label = 2; - case 2: return [4 /*yield*/, this.base.iterator()]; - case 3: - lines = _a.sent(); - if (this.hasHeader) { - // We previously read the first line to get the columnNames. - // Now that we're providing data, skip it. - lines = lines.skip(1); - } - return [2 /*return*/, lines.map(function (x) { return _this.makeDataElement(x); })]; - } - }); - }); - }; - CSVDataset.prototype.makeDataElement = function (line) { - var values = this.parseRow(line); - var features = {}; - var labels = {}; - for (var i = 0; i < this.fullColumnNames.length; i++) { - var key = this.fullColumnNames[i]; - var config = this.columnConfigs ? this.columnConfigs[key] : null; - if (this.configuredColumnsOnly && !config) { - // This column is not selected. - continue; - } - else { - var value = values[i]; - var parsedValue = null; - if (value === '') { - // If default value is provided, use it. If default value is not - // provided, set as undefined. - if (config && config.default !== undefined) { - parsedValue = config.default; - } - else if (config && (config.required || config.isLabel)) { - throw new Error("Required column " + key + " is empty in this line: " + line); - } - else { - parsedValue = undefined; - } - } - else { - // A value is present, so parse it based on type - var valueAsNum = Number(value); - if (isNaN(valueAsNum)) { - // The value is a string and this column is declared as boolean - // in config, parse it as boolean. - if (config && config.dtype === 'bool') { - parsedValue = this.getBoolean(value); - } - else { - // Set value as string - parsedValue = value; - } - } - else if (!config || !config.dtype) { - // If this value is a number and no type config is provided, return - // it as number. - parsedValue = valueAsNum; - } - else { - // If this value is a number and data type is provided, parse it - // according to provided data type. - switch (config.dtype) { - case 'float32': - parsedValue = valueAsNum; - break; - case 'int32': - parsedValue = Math.floor(valueAsNum); - break; - case 'bool': - parsedValue = this.getBoolean(value); - break; - default: - parsedValue = valueAsNum; - } - } - } - // Check if this column is label. - (config && config.isLabel) ? labels[key] = parsedValue : - features[key] = parsedValue; - } - } - // If label exists, return an object of features and labels as {xs:features, - // ys:labels}, otherwise return features only. - if (Object.keys(labels).length === 0) { - return features; - } - else { - return { xs: features, ys: labels }; - } - }; - CSVDataset.prototype.getBoolean = function (value) { - if (value === '1' || value.toLowerCase() === 'true') { - return 1; - } - else { - return 0; - } - }; - // adapted from https://beta.observablehq.com/@mbostock/streaming-csv - CSVDataset.prototype.parseRow = function (line, validateElementCount) { - if (validateElementCount === void 0) { validateElementCount = true; } - var result = []; - var readOffset = 0; - var readLength = line.length; - var currentState = STATE_OUT; - // Goes through the line to parse quote. - for (var i = 0; i < readLength; i++) { - switch (currentState) { - // Before enter a new field - case STATE_OUT: - switch (line.charAt(i)) { - // Enter a quoted field - case CODE_QUOTE: - readOffset = i + 1; - currentState = STATE_QUOTE; - break; - // Read an empty field - case this.delimiter: - readOffset = i + 1; - // If delimiter is white space and configured to collapse - // multiple white spaces, ignore this white space. - if (this.delimiter === ' ' && this.delimWhitespace) { - break; - } - result.push(''); - currentState = STATE_OUT; - break; - // Enter an unquoted field - default: - currentState = STATE_FIELD; - readOffset = i; - break; - } - break; - // In an unquoted field - case STATE_FIELD: - switch (line.charAt(i)) { - // Exit an unquoted field, add it to result - case this.delimiter: - result.push(line.substring(readOffset, i)); - currentState = STATE_OUT; - readOffset = i + 1; - break; - } - break; - // In a quoted field - case STATE_QUOTE: - switch (line.charAt(i)) { - // Read a quote after a quote - case CODE_QUOTE: - currentState = STATE_QUOTE_AFTER_QUOTE; - break; - } - break; - // This state means it's right after a second quote in a field - case STATE_QUOTE_AFTER_QUOTE: - switch (line.charAt(i)) { - // Finished a quoted field - case this.delimiter: - result.push(line.substring(readOffset, i - 1)); - currentState = STATE_OUT; - readOffset = i + 1; - break; - // Finished a quoted part in a quoted field - case CODE_QUOTE: - currentState = STATE_QUOTE; - break; - // In a quoted part in a quoted field - default: - currentState = STATE_WITHIN_QUOTE_IN_QUOTE; - break; - } - break; - case STATE_WITHIN_QUOTE_IN_QUOTE: - switch (line.charAt(i)) { - // Exit a quoted part in a quoted field - case CODE_QUOTE: - currentState = STATE_QUOTE; - break; - } - break; - } - } - // Adds last item based on if it is quoted. - if (currentState === STATE_QUOTE_AFTER_QUOTE) { - result.push(line.substring(readOffset, readLength - 1)); - } - else { - result.push(line.substring(readOffset)); - } - // Check if each row has the same number of elements as column names. - if (validateElementCount && result.length !== this.fullColumnNames.length) { - throw new Error("Invalid row in csv file. Should have " + this.fullColumnNames.length + " elements in a row, but got " + result); - } - return result; - }; - return CSVDataset; - }(Dataset)); - // TODO(soergel): add more basic datasets for parity with tf.data - // tf.data.FixedLengthRecordDataset() - // tf.data.TFRecordDataset() - - /** - * @license - * Copyright 2019 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /** - * Provide a stream of tensors from microphone audio stream. The tensors are - * representing audio data as frequency-domain spectrogram generated with - * browser's native FFT. Tensors representing time-domain waveform is available - * based on configuration. Only works in browser environment. - */ - var MicrophoneIterator = /** @class */ (function (_super) { - __extends(MicrophoneIterator, _super); - function MicrophoneIterator(microphoneConfig) { - var _this = _super.call(this) || this; - _this.microphoneConfig = microphoneConfig; - _this.isClosed = false; - _this.fftSize = microphoneConfig.fftSize || 1024; - var fftSizeLog2 = Math.log2(_this.fftSize); - if (_this.fftSize < 0 || fftSizeLog2 < 4 || fftSizeLog2 > 14 || - !Number.isInteger(fftSizeLog2)) { - throw new Error("Invalid fftSize: it must be a power of 2 between " + - ("2 to 4 and 2 to 14, but got " + _this.fftSize)); - } - _this.numFrames = microphoneConfig.numFramesPerSpectrogram || 43; - _this.sampleRateHz = microphoneConfig.sampleRateHz; - _this.columnTruncateLength = - microphoneConfig.columnTruncateLength || _this.fftSize; - _this.audioTrackConstraints = microphoneConfig.audioTrackConstraints; - _this.smoothingTimeConstant = microphoneConfig.smoothingTimeConstant || 0; - _this.includeSpectrogram = - microphoneConfig.includeSpectrogram === false ? false : true; - _this.includeWaveform = - microphoneConfig.includeWaveform === true ? true : false; - if (!_this.includeSpectrogram && !_this.includeWaveform) { - throw new Error('Both includeSpectrogram and includeWaveform are false. ' + - 'At least one type of data should be returned.'); - } - return _this; - } - MicrophoneIterator.prototype.summary = function () { - return "microphone"; - }; - // Construct a MicrophoneIterator and start the audio stream. - MicrophoneIterator.create = function (microphoneConfig) { - if (microphoneConfig === void 0) { microphoneConfig = {}; } - return __awaiter(this, void 0, void 0, function () { - var microphoneIterator; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (tf.env().get('IS_NODE')) { - throw new Error('microphone API is only supported in browser environment.'); - } - microphoneIterator = new MicrophoneIterator(microphoneConfig); - // Call async function start() to initialize the audio stream. - return [4 /*yield*/, microphoneIterator.start()]; - case 1: - // Call async function start() to initialize the audio stream. - _a.sent(); - return [2 /*return*/, microphoneIterator]; - } - }); - }); - }; - // Start the audio stream and FFT. - MicrophoneIterator.prototype.start = function () { - return __awaiter(this, void 0, void 0, function () { - var _a, e_1, ctxConstructor, streamSource; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _b.trys.push([0, 2, , 3]); - _a = this; - return [4 /*yield*/, navigator.mediaDevices.getUserMedia({ - audio: this.audioTrackConstraints == null ? true : - this.audioTrackConstraints, - video: false - })]; - case 1: - _a.stream = _b.sent(); - return [3 /*break*/, 3]; - case 2: - e_1 = _b.sent(); - throw new Error("Error thrown while initializing video stream: " + e_1.message); - case 3: - if (!this.stream) { - throw new Error('Could not obtain audio from microphone.'); - } - ctxConstructor = - // tslint:disable-next-line:no-any - window.AudioContext || window.webkitAudioContext; - this.audioContext = new ctxConstructor(); - if (!this.sampleRateHz) { - // If sample rate is not provided, use the available sample rate on - // device. - this.sampleRateHz = this.audioContext.sampleRate; - } - else if (this.audioContext.sampleRate !== this.sampleRateHz) { - throw new Error("Mismatch in sampling rate: " + - ("Expected: " + this.sampleRateHz + "; ") + - ("Actual: " + this.audioContext.sampleRate)); - } - streamSource = this.audioContext.createMediaStreamSource(this.stream); - this.analyser = this.audioContext.createAnalyser(); - this.analyser.fftSize = this.fftSize * 2; - this.analyser.smoothingTimeConstant = this.smoothingTimeConstant; - streamSource.connect(this.analyser); - this.freqData = new Float32Array(this.fftSize); - this.timeData = new Float32Array(this.fftSize); - return [2 /*return*/]; - } - }); - }); - }; - MicrophoneIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var spectrogramTensor, waveformTensor, audioDataQueue, freqData, timeData; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (this.isClosed) { - return [2 /*return*/, { value: null, done: true }]; - } - return [4 /*yield*/, this.getAudioData()]; - case 1: - audioDataQueue = _a.sent(); - if (this.includeSpectrogram) { - freqData = this.flattenQueue(audioDataQueue.freqDataQueue); - spectrogramTensor = this.getTensorFromAudioDataArray(freqData, [this.numFrames, this.columnTruncateLength, 1]); - } - if (this.includeWaveform) { - timeData = this.flattenQueue(audioDataQueue.timeDataQueue); - waveformTensor = this.getTensorFromAudioDataArray(timeData, [this.numFrames * this.fftSize, 1]); - } - return [2 /*return*/, { - value: { 'spectrogram': spectrogramTensor, 'waveform': waveformTensor }, - done: false - }]; - } - }); - }); - }; - // Capture one result from the audio stream, and extract the value from - // iterator.next() result. - MicrophoneIterator.prototype.capture = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.next()]; - case 1: return [2 /*return*/, (_a.sent()).value]; - } - }); - }); - }; - MicrophoneIterator.prototype.getAudioData = function () { - return __awaiter(this, void 0, void 0, function () { - var freqDataQueue, timeDataQueue, currentFrames; - var _this = this; - return __generator(this, function (_a) { - freqDataQueue = []; - timeDataQueue = []; - currentFrames = 0; - return [2 /*return*/, new Promise(function (resolve) { - var intervalID = setInterval(function () { - if (_this.includeSpectrogram) { - _this.analyser.getFloatFrequencyData(_this.freqData); - // If the audio stream is initializing, return empty queue. - if (_this.freqData[0] === -Infinity) { - resolve({ freqDataQueue: freqDataQueue, timeDataQueue: timeDataQueue }); - } - freqDataQueue.push(_this.freqData.slice(0, _this.columnTruncateLength)); - } - if (_this.includeWaveform) { - _this.analyser.getFloatTimeDomainData(_this.timeData); - timeDataQueue.push(_this.timeData.slice()); - } - // Clean interval and return when all frames have been collected - if (++currentFrames === _this.numFrames) { - clearInterval(intervalID); - resolve({ freqDataQueue: freqDataQueue, timeDataQueue: timeDataQueue }); - } - }, _this.fftSize / _this.sampleRateHz * 1e3); - })]; - }); - }); - }; - // Stop the audio stream and pause the iterator. - MicrophoneIterator.prototype.stop = function () { - if (!this.isClosed) { - this.isClosed = true; - this.analyser.disconnect(); - this.audioContext.close(); - if (this.stream != null && this.stream.getTracks().length > 0) { - this.stream.getTracks()[0].stop(); - } - } - }; - // Override toArray() function to prevent collecting. - MicrophoneIterator.prototype.toArray = function () { - throw new Error('Can not convert infinite audio stream to array.'); - }; - // Return audio sampling rate in Hz - MicrophoneIterator.prototype.getSampleRate = function () { - return this.sampleRateHz; - }; - MicrophoneIterator.prototype.flattenQueue = function (queue) { - var frameSize = queue[0].length; - var freqData = new Float32Array(queue.length * frameSize); - queue.forEach(function (data, i) { return freqData.set(data, i * frameSize); }); - return freqData; - }; - MicrophoneIterator.prototype.getTensorFromAudioDataArray = function (freqData, shape) { - var vals = new Float32Array(tf.util.sizeFromShape(shape)); - // If the data is less than the output shape, the rest is padded with zeros. - vals.set(freqData, vals.length - freqData.length); - return tf.tensor(vals, shape); - }; - return MicrophoneIterator; - }(LazyIterator)); - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /** - * Provide a stream of image tensors from webcam video stream. Only works in - * browser environment. - */ - var WebcamIterator = /** @class */ (function (_super) { - __extends(WebcamIterator, _super); - function WebcamIterator(webcamVideoElement, webcamConfig) { - var _this = _super.call(this) || this; - _this.webcamVideoElement = webcamVideoElement; - _this.webcamConfig = webcamConfig; - _this.isClosed = true; - _this.resize = false; - if (_this.needToResize()) { - _this.resize = true; - _this.cropSize = - [_this.webcamConfig.resizeHeight, _this.webcamConfig.resizeWidth]; - _this.cropBoxInd = tf.tensor1d([0], 'int32'); - if (_this.webcamConfig.centerCrop) { - // Calculate the box based on resizing shape. - var widthCroppingRatio = _this.webcamConfig.resizeWidth * 1.0 / _this.webcamVideoElement.width; - var heightCroppingRatio = _this.webcamConfig.resizeHeight * 1.0 / - _this.webcamVideoElement.height; - var widthCropStart = (1 - widthCroppingRatio) / 2; - var heightCropStart = (1 - heightCroppingRatio) / 2; - var widthCropEnd = widthCropStart + widthCroppingRatio; - var heightCropEnd = heightCroppingRatio + heightCropStart; - _this.cropBox = tf.tensor2d([heightCropStart, widthCropStart, heightCropEnd, widthCropEnd], [1, 4]); - } - else { - _this.cropBox = tf.tensor2d([0, 0, 1, 1], [1, 4]); - } - } - return _this; - } - WebcamIterator.prototype.summary = function () { - return "webcam"; - }; - // Construct a WebcamIterator and start it's video stream. - WebcamIterator.create = function (webcamVideoElement, webcamConfig) { - if (webcamConfig === void 0) { webcamConfig = {}; } - return __awaiter(this, void 0, void 0, function () { - var webcamIterator; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (tf.env().get('IS_NODE')) { - throw new Error('tf.data.webcam is only supported in browser environment.'); - } - if (!webcamVideoElement) { - // If webcam video element is not provided, create a hidden video element - // with provided width and height. - webcamVideoElement = document.createElement('video'); - if (!webcamConfig.resizeWidth || !webcamConfig.resizeHeight) { - throw new Error('Please provide webcam video element, or resizeWidth and ' + - 'resizeHeight to create a hidden video element.'); - } - webcamVideoElement.width = webcamConfig.resizeWidth; - webcamVideoElement.height = webcamConfig.resizeHeight; - } - webcamIterator = new WebcamIterator(webcamVideoElement, webcamConfig); - // Call async function to initialize the video stream. - return [4 /*yield*/, webcamIterator.start()]; - case 1: - // Call async function to initialize the video stream. - _a.sent(); - return [2 /*return*/, webcamIterator]; - } - }); - }); - }; - // Async function to start video stream. - WebcamIterator.prototype.start = function () { - return __awaiter(this, void 0, void 0, function () { - var _a, e_1; - var _this = this; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (this.webcamConfig.facingMode) { - tf.util.assert((this.webcamConfig.facingMode === 'user') || - (this.webcamConfig.facingMode === 'environment'), function () { - return "Invalid webcam facing mode: " + _this.webcamConfig.facingMode + ". " + - "Please provide 'user' or 'environment'"; - }); - } - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - _a = this; - return [4 /*yield*/, navigator.mediaDevices.getUserMedia({ - video: { - deviceId: this.webcamConfig.deviceId, - facingMode: this.webcamConfig.facingMode ? - this.webcamConfig.facingMode : - 'user', - width: this.webcamVideoElement.width, - height: this.webcamVideoElement.height - } - })]; - case 2: - _a.stream = _b.sent(); - return [3 /*break*/, 4]; - case 3: - e_1 = _b.sent(); - // Modify the error message but leave the stack trace intact - e_1.message = "Error thrown while initializing video stream: " + e_1.message; - throw e_1; - case 4: - if (!this.stream) { - throw new Error('Could not obtain video from webcam.'); - } - // Older browsers may not have srcObject - try { - this.webcamVideoElement.srcObject = this.stream; - } - catch (error) { - console.log(error); - this.webcamVideoElement.src = window.URL.createObjectURL(this.stream); - } - // Start the webcam video stream - this.webcamVideoElement.play(); - this.isClosed = false; - return [2 /*return*/, new Promise(function (resolve) { - // Add event listener to make sure the webcam has been fully initialized. - _this.webcamVideoElement.onloadedmetadata = function () { - resolve(); - }; - })]; - } - }); - }); - }; - WebcamIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var img; - return __generator(this, function (_a) { - if (this.isClosed) { - return [2 /*return*/, { value: null, done: true }]; - } - try { - img = tf.browser.fromPixels(this.webcamVideoElement); - } - catch (e) { - throw new Error("Error thrown converting video to pixels: " + JSON.stringify(e)); - } - if (this.resize) { - try { - return [2 /*return*/, { value: this.cropAndResizeFrame(img), done: false }]; - } - catch (e) { - throw new Error("Error thrown cropping the video: " + e.message); - } - finally { - img.dispose(); - } - } - else { - return [2 /*return*/, { value: img, done: false }]; - } - return [2 /*return*/]; - }); - }); - }; - WebcamIterator.prototype.needToResize = function () { - // If resizeWidth and resizeHeight are provided, and different from the - // width and height of original HTMLVideoElement, then resizing and cropping - // is required. - if (this.webcamConfig.resizeWidth && this.webcamConfig.resizeHeight && - (this.webcamVideoElement.width !== this.webcamConfig.resizeWidth || - this.webcamVideoElement.height !== this.webcamConfig.resizeHeight)) { - return true; - } - return false; - }; - // Cropping and resizing each frame based on config - WebcamIterator.prototype.cropAndResizeFrame = function (img) { - var _this = this; - return tf.tidy(function () { - var expandedImage = tf.expandDims(tf.cast(img, 'float32'), (0)); - var resizedImage; - resizedImage = tf.image.cropAndResize(expandedImage, _this.cropBox, _this.cropBoxInd, _this.cropSize, 'bilinear'); - // Extract image from batch cropping. - var shape = resizedImage.shape; - return tf.reshape(resizedImage, shape.slice(1)); - }); - }; - // Capture one frame from the video stream, and extract the value from - // iterator.next() result. - WebcamIterator.prototype.capture = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.next()]; - case 1: return [2 /*return*/, (_a.sent()).value]; - } - }); - }); - }; - // Stop the video stream and pause webcam iterator. - WebcamIterator.prototype.stop = function () { - var tracks = this.stream.getTracks(); - tracks.forEach(function (track) { return track.stop(); }); - try { - this.webcamVideoElement.srcObject = null; - } - catch (error) { - console.log(error); - this.webcamVideoElement.src = null; - } - this.isClosed = true; - }; - // Override toArray() function to prevent collecting. - WebcamIterator.prototype.toArray = function () { - throw new Error('Can not convert infinite video stream to array.'); - }; - return WebcamIterator; - }(LazyIterator)); - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /** - * Represents a data source readable as a stream of binary data chunks. - * - * Because `Dataset`s can be read repeatedly (via `Dataset.iterator()`), this - * provides a means to repeatedly create streams from the underlying data - * sources. - */ - var DataSource = /** @class */ (function () { - function DataSource() { - } - return DataSource; - }()); - // TODO(soergel): consider convenience factory functions here - // in combination with chainable source->dataset above, e.g.: - // tf.data.url(...).asCsvDataset().shuffle().batch() - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - var StringIterator = /** @class */ (function (_super) { - __extends(StringIterator, _super); - function StringIterator() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Splits a string stream on a given separator. - * - * It is assumed that the incoming chunk boundaries have no semantic meaning, - * so conceptually the incoming stream is treated simply as the concatenation - * of its elements. - * - * The outgoing stream provides chunks corresponding to the results of the - * standard string split() operation (even if such a chunk spanned incoming - * chunks). The separators are not included. - * - * A typical usage is to split a text file (represented as a stream with - * arbitrary chunk boundaries) into lines. - * - * @param upstream A readable stream of strings that can be treated as - * concatenated. - * @param separator A character to split on. - */ - StringIterator.prototype.split = function (separator) { - return new SplitIterator(this, separator); - }; - return StringIterator; - }(LazyIterator)); - // ============================================================================ - // The following private classes serve to implement the chainable methods - // on StringIterator. Unfortunately they can't be placed in separate files, due - // to resulting trouble with circular imports. - // ============================================================================ - // We wanted multiple inheritance, e.g. - // class SplitIterator extends QueueIterator, StringIterator - // but the TypeScript mixin approach is a bit hacky, so we take this adapter - // approach instead. - var SplitIterator = /** @class */ (function (_super) { - __extends(SplitIterator, _super); - function SplitIterator(upstream, separator) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.impl = new SplitIteratorImpl(upstream, separator); - return _this; - } - SplitIterator.prototype.summary = function () { - return this.impl.summary(); - }; - SplitIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.impl.next()]; - }); - }); - }; - return SplitIterator; - }(StringIterator)); - var SplitIteratorImpl = /** @class */ (function (_super) { - __extends(SplitIteratorImpl, _super); - function SplitIteratorImpl(upstream, separator) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.separator = separator; - // A partial string at the end of an upstream chunk - _this.carryover = ''; - return _this; - } - SplitIteratorImpl.prototype.summary = function () { - return this.upstream.summary() + " -> Split('" + this.separator + "')"; - }; - SplitIteratorImpl.prototype.pump = function () { - return __awaiter(this, void 0, void 0, function () { - var chunkResult, lines, _i, _a, line; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: return [4 /*yield*/, this.upstream.next()]; - case 1: - chunkResult = _b.sent(); - if (chunkResult.done) { - if (this.carryover === '') { - return [2 /*return*/, false]; - } - // Pretend that the pump succeeded in order to emit the small last batch. - // The next pump() call will actually fail. - this.outputQueue.push(this.carryover); - this.carryover = ''; - return [2 /*return*/, true]; - } - lines = chunkResult.value.split(this.separator); - // Note the behavior: " ab ".split(' ') === ['', 'ab', ''] - // Thus the carryover may be '' if the separator falls on a chunk - // boundary; this produces the correct result. - lines[0] = this.carryover + lines[0]; - for (_i = 0, _a = lines.slice(0, -1); _i < _a.length; _i++) { - line = _a[_i]; - this.outputQueue.push(line); - } - this.carryover = lines[lines.length - 1]; - return [2 /*return*/, true]; - } - }); - }); - }; - return SplitIteratorImpl; - }(OneToManyIterator)); - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - var ByteChunkIterator = /** @class */ (function (_super) { - __extends(ByteChunkIterator, _super); - function ByteChunkIterator() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Decode a stream of UTF8-encoded byte arrays to a stream of strings. - * - * The byte arrays producetd from the ByteChunkIterator on which this is - * called will be interpreted as concatenated. No assumptions are made about - * the boundaries of the incoming chunks, so a multi-byte UTF8 encoding of a - * character may span the boundary between chunks. This naturally happens, - * for instance, when reading fixed-size byte arrays from a file. - */ - ByteChunkIterator.prototype.decodeUTF8 = function () { - return new Utf8Iterator(this); - }; - return ByteChunkIterator; - }(LazyIterator)); - // ============================================================================ - // The following private classes serve to implement the chainable methods - // on ByteChunkIterator. Unfortunately they can't be placed in separate files, - // due to resulting trouble with circular imports. - // ============================================================================ - // We wanted multiple inheritance, e.g. - // class Utf8Iterator extends QueueIterator, StringIterator - // but the TypeScript mixin approach is a bit hacky, so we take this adapter - // approach instead. - var Utf8Iterator = /** @class */ (function (_super) { - __extends(Utf8Iterator, _super); - function Utf8Iterator(upstream) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.impl = new Utf8IteratorImpl(upstream); - return _this; - } - Utf8Iterator.prototype.summary = function () { - return this.impl.summary(); - }; - Utf8Iterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.impl.next()]; - }); - }); - }; - return Utf8Iterator; - }(StringIterator)); - /** - * Decode a stream of UTF8-encoded byte arrays to a stream of strings. - * - * This is tricky because the incoming byte array boundaries may disrupt a - * multi-byte UTF8 character. Thus any incomplete character data at the end of - * a chunk must be carried over and prepended to the next chunk before - * decoding. Luckily with native decoder, TextDecoder in browser and - * string_decoder in node, byte array boundaries are handled automatically. - * - * In the context of an input pipeline for machine learning, UTF8 decoding is - * needed to parse text files containing training examples or prediction - * requests (e.g., formatted as CSV or JSON). We cannot use the built-in - * decoding provided by FileReader.readAsText() because here we are in a - * streaming context, which FileReader does not support. - * - * @param upstream A `LazyIterator` of `Uint8Arrays` containing UTF8-encoded - * text, which should be interpreted as concatenated. No assumptions are - * made about the boundaries of the incoming chunks, so a multi-byte UTF8 - * encoding of a character may span the boundary between chunks. This - * naturally happens, for instance, when reading fixed-size byte arrays from a - * file. - */ - var Utf8IteratorImpl = /** @class */ (function (_super) { - __extends(Utf8IteratorImpl, _super); - function Utf8IteratorImpl(upstream) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - if (tf.env().get('IS_BROWSER')) { - _this.decoder = new TextDecoder('utf-8'); - } - else { - // tslint:disable-next-line:no-require-imports - var StringDecoder = require('string_decoder').StringDecoder; - _this.decoder = new StringDecoder('utf8'); - } - return _this; - } - Utf8IteratorImpl.prototype.summary = function () { - return this.upstream.summary() + " -> Utf8"; - }; - Utf8IteratorImpl.prototype.pump = function () { - return __awaiter(this, void 0, void 0, function () { - var chunkResult, chunk, text; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.upstream.next()]; - case 1: - chunkResult = _a.sent(); - if (chunkResult.done) { - return [2 /*return*/, false]; - } - else { - chunk = chunkResult.value; - } - if (tf.env().get('IS_BROWSER')) { - text = this.decoder.decode(chunk, { stream: true }); - } - else { - text = this.decoder.write(Buffer.from(chunk.buffer)); - } - this.outputQueue.push(text); - return [2 /*return*/, true]; - } - }); - }); - }; - return Utf8IteratorImpl; - }(OneToManyIterator)); - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /** - * Provide a stream of chunks from a File, Blob, or Uint8Array. - * @param file The source File, Blob or Uint8Array. - * @param options Optional settings controlling file reading. - * @returns a lazy Iterator of Uint8Arrays containing sequential chunks of the - * input File, Blob or Uint8Array. - */ - var FileChunkIterator = /** @class */ (function (_super) { - __extends(FileChunkIterator, _super); - function FileChunkIterator(file, options) { - if (options === void 0) { options = {}; } - var _this = _super.call(this) || this; - _this.file = file; - _this.options = options; - tf.util.assert((file instanceof Uint8Array) || - (tf.env().get('IS_BROWSER') ? - (file instanceof File || file instanceof Blob) : - false), function () { return 'FileChunkIterator only supports File, Blob and Uint8Array ' + - 'right now.'; }); - _this.offset = options.offset || 0; - // default 1MB chunk has tolerable perf on large files - _this.chunkSize = options.chunkSize || 1024 * 1024; - return _this; - } - FileChunkIterator.prototype.summary = function () { - return "FileChunks " + this.file; - }; - FileChunkIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var chunk, _a; - var _this = this; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (this.offset >= ((this.file instanceof Uint8Array) ? - this.file.byteLength : - this.file.size)) { - return [2 /*return*/, { value: null, done: true }]; - } - chunk = new Promise(function (resolve, reject) { - var end = _this.offset + _this.chunkSize; - if (_this.file instanceof Uint8Array) { - // Note if end > this.uint8Array.byteLength, we just get a small last - // chunk. - resolve(new Uint8Array(_this.file.slice(_this.offset, end))); - } - else { - // This branch assumes that this.file type is File or Blob, which - // means it is in the browser environment. - // TODO(soergel): is this a performance issue? - var fileReader_1 = new FileReader(); - fileReader_1.onload = function (event) { - var data = fileReader_1.result; - // Not sure we can trust the return type of - // FileReader.readAsArrayBuffer See e.g. - // https://github.com/node-file-api/FileReader/issues/2 - if (data instanceof ArrayBuffer) { - data = new Uint8Array(data); - } - if (!(data instanceof Uint8Array)) { - return reject(new TypeError('FileReader returned unknown type.')); - } - resolve(data); - }; - fileReader_1.onabort = function (event) { - return reject(new Error('Aborted')); - }; - fileReader_1.onerror = function (event) { - return reject(new Error(event.type)); - }; - // TODO(soergel): better handle onabort, onerror - // Note if end > this.file.size, we just get a small last chunk. - var slice = _this.file.slice(_this.offset, end); - // We can't use readAsText here (even if we know the file is text) - // because the slice boundary may fall within a multi-byte character. - fileReader_1.readAsArrayBuffer(slice); - } - _this.offset = end; - }); - _a = {}; - return [4 /*yield*/, chunk]; - case 1: return [2 /*return*/, (_a.value = (_b.sent()), _a.done = false, _a)]; - } - }); - }); - }; - return FileChunkIterator; - }(ByteChunkIterator)); - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /** - * Provide a stream of chunks from a URL. - * - * Note this class first downloads the entire file into memory before providing - * the first element from the stream. This is because the Fetch API does not - * yet reliably provide a reader stream for the response body. - */ - function urlChunkIterator(url, options) { - if (options === void 0) { options = {}; } - return __awaiter(this, void 0, void 0, function () { - var urlString, requestInit, response, uint8Array, _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if ((typeof url) === 'string') { - urlString = url; - } - else { - urlString = url.url; - requestInit = getRequestInitFromRequest(url); - } - return [4 /*yield*/, tf.util.fetch(urlString, requestInit)]; - case 1: - response = _b.sent(); - if (!response.ok) return [3 /*break*/, 3]; - _a = Uint8Array.bind; - return [4 /*yield*/, response.arrayBuffer()]; - case 2: - uint8Array = new (_a.apply(Uint8Array, [void 0, _b.sent()]))(); - return [2 /*return*/, new FileChunkIterator(uint8Array, options)]; - case 3: throw new Error(response.statusText); - } - }); - }); - } - // Generate RequestInit from Request to match tf.util.fetch signature. - var getRequestInitFromRequest = function (request) { - var init = { - method: request.method, - headers: request.headers, - body: request.body, - mode: request.mode, - credentials: request.credentials, - cache: request.cache, - redirect: request.redirect, - referrer: request.referrer, - integrity: request.integrity, - }; - return init; - }; - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - // Skip tslint any type check cause this method is aiming to check type of - // input. - // tslint:disable-next-line:no-any - function isLocalPath(source) { - return (typeof source === 'string') && source.substr(0, 7) === 'file://'; - } - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /** - * Represents a file, blob, or Uint8Array readable as a stream of binary data - * chunks. - */ - var FileDataSource = /** @class */ (function (_super) { - __extends(FileDataSource, _super); - /** - * Create a `FileDataSource`. - * - * @param input Local file path, or `File`/`Blob`/`Uint8Array` object to - * read. Local file only works in node environment. - * @param options Options passed to the underlying `FileChunkIterator`s, - * such as {chunksize: 1024}. - */ - function FileDataSource(input, options) { - if (options === void 0) { options = {}; } - var _this = _super.call(this) || this; - _this.input = input; - _this.options = options; - return _this; - } - FileDataSource.prototype.iterator = function () { - return __awaiter(this, void 0, void 0, function () { - var fs; - return __generator(this, function (_a) { - if (isLocalPath(this.input) && tf.env().get('IS_NODE')) { - fs = require('fs'); - this.input = fs.readFileSync(this.input.substr(7)); - } - // TODO(kangyizhang): Add LocalFileChunkIterator to split local streaming - // with file in browser. - return [2 /*return*/, new FileChunkIterator(this.input, this.options)]; - }); - }); - }; - return FileDataSource; - }(DataSource)); - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /* - * Represents a URL readable as a stream of binary data chunks. - */ - var URLDataSource = /** @class */ (function (_super) { - __extends(URLDataSource, _super); - /** - * Create a `URLDataSource`. - * - * @param url A source URL string, or a `Request` object. - * @param options Options passed to the underlying `FileChunkIterator`s, - * such as {chunksize: 1024}. - */ - function URLDataSource(url, fileOptions) { - if (fileOptions === void 0) { fileOptions = {}; } - var _this = _super.call(this) || this; - _this.url = url; - _this.fileOptions = fileOptions; - return _this; - } - // TODO(soergel): provide appropriate caching options. Currently this - // will download the URL anew for each call to iterator(). Since we have - // to treat the downloaded file as a blob/buffer anyway, we may as well retain - // it-- but that raises GC issues. Also we may want a persistent disk cache. - URLDataSource.prototype.iterator = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (isLocalPath(this.url)) { - return [2 /*return*/, (new FileDataSource(this.url, this.fileOptions)) - .iterator()]; - } - else { - return [2 /*return*/, urlChunkIterator(this.url, this.fileOptions)]; - } - }); - }); - }; - return URLDataSource; - }(DataSource)); - - /** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ - /** - * Create a `CSVDataset` by reading and decoding CSV file(s) from provided URL - * or local path if it's in Node environment. - * - * Note: If isLabel in columnConfigs is `true` for at least one column, the - * element in returned `CSVDataset` will be an object of - * `{xs:features, ys:labels}`: xs is a dict of features key/value pairs, ys - * is a dict of labels key/value pairs. If no column is marked as label, - * returns a dict of features only. - * - * ```js - * const csvUrl = - * 'https://storage.googleapis.com/tfjs-examples/multivariate-linear-regression/data/boston-housing-train.csv'; - * - * async function run() { - * // We want to predict the column "medv", which represents a median value of - * // a home (in $1000s), so we mark it as a label. - * const csvDataset = tf.data.csv( - * csvUrl, { - * columnConfigs: { - * medv: { - * isLabel: true - * } - * } - * }); - * - * // Number of features is the number of column names minus one for the label - * // column. - * const numOfFeatures = (await csvDataset.columnNames()).length - 1; - * - * // Prepare the Dataset for training. - * const flattenedDataset = - * csvDataset - * .map(({xs, ys}) => - * { - * // Convert xs(features) and ys(labels) from object form (keyed by - * // column name) to array form. - * return {xs:Object.values(xs), ys:Object.values(ys)}; - * }) - * .batch(10); - * - * // Define the model. - * const model = tf.sequential(); - * model.add(tf.layers.dense({ - * inputShape: [numOfFeatures], - * units: 1 - * })); - * model.compile({ - * optimizer: tf.train.sgd(0.000001), - * loss: 'meanSquaredError' - * }); - * - * // Fit the model using the prepared Dataset - * return model.fitDataset(flattenedDataset, { - * epochs: 10, - * callbacks: { - * onEpochEnd: async (epoch, logs) => { - * console.log(epoch + ':' + logs.loss); - * } - * } - * }); - * } - * - * await run(); - * ``` - * - * @param source URL or local path to get CSV file. If it's a local path, it - * must have prefix `file://` and it only works in node environment. - * @param csvConfig (Optional) A CSVConfig object that contains configurations - * of reading and decoding from CSV file(s). - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * configParamIndices: [1] - * } - */ - function csv(source, csvConfig) { - if (csvConfig === void 0) { csvConfig = {}; } - return new CSVDataset(new URLDataSource(source), csvConfig); - } - /** - * Create a `Dataset` that produces each element by calling a provided function. - * - * Note that repeated iterations over this `Dataset` may produce different - * results, because the function will be called anew for each element of each - * iteration. - * - * Also, beware that the sequence of calls to this function may be out of order - * in time with respect to the logical order of the Dataset. This is due to the - * asynchronous lazy nature of stream processing, and depends on downstream - * transformations (e.g. .shuffle()). If the provided function is pure, this is - * no problem, but if it is a closure over a mutable state (e.g., a traversal - * pointer), then the order of the produced elements may be scrambled. - * - * ```js - * let i = -1; - * const func = () => - * ++i < 5 ? {value: i, done: false} : {value: null, done: true}; - * const ds = tf.data.func(func); - * await ds.forEachAsync(e => console.log(e)); - * ``` - * - * @param f A function that produces one data element on each call. - */ - function func(f) { - var _this = this; - var iter = iteratorFromFunction(f); - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/, iter]; - }); }); }); - } - /** - * Create a `Dataset` that produces each element from provided JavaScript - * generator, which is a function* - * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions), - * or a function that returns an - * iterator - * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions). - * - * The returned iterator should have `.next()` function that returns element in - * format of `{value: TensorContainer, done:boolean}`. - * - * Example of creating a dataset from an iterator factory: - * ```js - * function makeIterator() { - * const numElements = 10; - * let index = 0; - * - * const iterator = { - * next: () => { - * let result; - * if (index < numElements) { - * result = {value: index, done: false}; - * index++; - * return result; - * } - * return {value: index, done: true}; - * } - * }; - * return iterator; - * } - * const ds = tf.data.generator(makeIterator); - * await ds.forEachAsync(e => console.log(e)); - * ``` - * - * Example of creating a dataset from a generator: - * ```js - * function* dataGenerator() { - * const numElements = 10; - * let index = 0; - * while (index < numElements) { - * const x = index; - * index++; - * yield x; - * } - * } - * - * const ds = tf.data.generator(dataGenerator); - * await ds.forEachAsync(e => console.log(e)); - * ``` - * - * @param generator A Javascript generator function that returns a JavaScript - * iterator. - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * configParamIndices: [1] - * } - */ - function generator(generator) { - var _this = this; - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { - var gen; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, generator()]; - case 1: - gen = _a.sent(); - return [2 /*return*/, iteratorFromFunction(function () { return gen.next(); })]; - } - }); - }); }); - } - /** - * Create an iterator that generate `Tensor`s from webcam video stream. This API - * only works in Browser environment when the device has webcam. - * - * Note: this code snippet only works when the device has a webcam. It will - * request permission to open the webcam when running. - * ```js - * const videoElement = document.createElement('video'); - * videoElement.width = 100; - * videoElement.height = 100; - * const cam = await tf.data.webcam(videoElement); - * const img = await cam.capture(); - * img.print(); - * cam.stop(); - * ``` - * - * @param webcamVideoElement A `HTMLVideoElement` used to play video from - * webcam. If this element is not provided, a hidden `HTMLVideoElement` will - * be created. In that case, `resizeWidth` and `resizeHeight` must be - * provided to set the generated tensor shape. - * @param webcamConfig A `WebcamConfig` object that contains configurations of - * reading and manipulating data from webcam video stream. - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * ignoreCI: true - * } - */ - function webcam(webcamVideoElement, webcamConfig) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, WebcamIterator.create(webcamVideoElement, webcamConfig)]; - }); - }); - } - /** - * Create an iterator that generate frequency-domain spectrogram `Tensor`s from - * microphone audio stream with browser's native FFT. This API only works in - * browser environment when the device has microphone. - * - * Note: this code snippet only works when the device has a microphone. It will - * request permission to open the microphone when running. - * ```js - * const mic = await tf.data.microphone({ - * fftSize: 1024, - * columnTruncateLength: 232, - * numFramesPerSpectrogram: 43, - * sampleRateHz:44100, - * includeSpectrogram: true, - * includeWaveform: true - * }); - * const audioData = await mic.capture(); - * const spectrogramTensor = audioData.spectrogram; - * spectrogramTensor.print(); - * const waveformTensor = audioData.waveform; - * waveformTensor.print(); - * mic.stop(); - * ``` - * - * @param microphoneConfig A `MicrophoneConfig` object that contains - * configurations of reading audio data from microphone. - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * ignoreCI: true - * } - */ - function microphone(microphoneConfig) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, MicrophoneIterator.create(microphoneConfig)]; - }); - }); - } - - /** @license See the LICENSE file. */ - // This code is auto-generated, do not modify this file! - var version = '3.6.0'; - - exports.CSVDataset = CSVDataset; - exports.Dataset = Dataset; - exports.FileDataSource = FileDataSource; - exports.TextLineDataset = TextLineDataset; - exports.URLDataSource = URLDataSource; - exports.array = array; - exports.csv = csv; - exports.func = func; - exports.generator = generator; - exports.microphone = microphone; - exports.version_data = version; - exports.webcam = webcam; - exports.zip = zip; - - Object.defineProperty(exports, '__esModule', { value: true }); - -}))); -//# sourceMappingURL=tf-data.js.map diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.js.map deleted file mode 100644 index a71fa1dd0..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tf-data.js","sources":["../node_modules/seedrandom/lib/alea.js","../node_modules/seedrandom/lib/xor128.js","../node_modules/seedrandom/lib/xorwow.js","../node_modules/seedrandom/lib/xorshift7.js","../node_modules/seedrandom/lib/xor4096.js","../node_modules/seedrandom/lib/tychei.js","../node_modules/seedrandom/seedrandom.js","../node_modules/seedrandom/index.js","../src/util/deep_map.ts","../src/util/deep_clone.ts","../src/util/ring_buffer.ts","../src/util/growing_ring_buffer.ts","../src/iterators/lazy_iterator.ts","../src/dataset.ts","../src/datasets/text_line_dataset.ts","../src/datasets/csv_dataset.ts","../src/iterators/microphone_iterator.ts","../src/iterators/webcam_iterator.ts","../src/datasource.ts","../src/iterators/string_iterator.ts","../src/iterators/byte_chunk_iterator.ts","../src/iterators/file_chunk_iterator.ts","../src/iterators/url_chunk_iterator.ts","../src/util/source_util.ts","../src/sources/file_data_source.ts","../src/sources/url_data_source.ts","../src/readers.ts","../src/version.ts"],"sourcesContent":["// A port of an algorithm by Johannes Baagøe , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baagøe \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xorshift7\" algorithm by\n// François Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n","// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n","// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","/*\nCopyright 2014 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\nvar global = this,\n width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\nmath['seed' + rngname] = seedrandom;\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n}\n\n// End anonymous scope, and pass initial values.\n})(\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n","// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by François Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\n\n// tslint:disable:no-any\n\n/**\n * A return value for a mapping function that can be applied via deepMap.\n *\n * If recurse is true, the value should be empty, and iteration will continue\n * into the object or array.\n */\nexport type DeepMapResult = {\n value: any,\n recurse: boolean\n};\n\n/**\n * Apply a mapping function to a nested structure in a recursive manner.\n *\n * The result of the mapping is an object with the same nested structure (i.e.,\n * of arrays and dicts) as the input, except that some subtrees are replaced,\n * according to the results of the mapping function.\n *\n * Mappings are memoized. Thus, if the nested structure contains the same\n * object in multiple positions, the output will contain the same mapped object\n * in those positions. Cycles are not supported, however.\n *\n * @param input: The object to which to apply the mapping function.\n * @param mapFn: A function that expects a single node of the object tree, and\n * returns a `DeepMapResult`. The `DeepMapResult` either provides a\n * replacement value for that node (i.e., replacing the subtree), or indicates\n * that the node should be processed recursively.\n */\nexport function deepMap(input: any, mapFn: (x: any) => DeepMapResult): any|\n any[] {\n return deepMapInternal(input, mapFn);\n}\n\n/**\n * @param seen: A Map of known object mappings (i.e., memoized results of\n * `mapFn()`)\n * @param containedIn: An set containing objects on the reference path currently\n * being processed (used to detect cycles).\n */\nfunction deepMapInternal(\n input: any, mapFn: (x: any) => DeepMapResult,\n seen: Map = new Map(), containedIn: Set<{}> = new Set()): any|\n any[] {\n if (input == null) {\n return null;\n }\n if (containedIn.has(input)) {\n throw new Error('Circular references are not supported.');\n }\n if (seen.has(input)) {\n return seen.get(input);\n }\n const result = mapFn(input);\n\n if (result.recurse && result.value !== null) {\n throw new Error(\n 'A deep map function may not return both a value and recurse=true.');\n }\n\n if (!result.recurse) {\n seen.set(input, result.value);\n return result.value;\n } else if (isIterable(input)) {\n // tslint:disable-next-line:no-any\n const mappedIterable: any|any[] = Array.isArray(input) ? [] : {};\n containedIn.add(input);\n for (const k in input) {\n const child = input[k];\n const childResult = deepMapInternal(child, mapFn, seen, containedIn);\n mappedIterable[k] = childResult;\n }\n containedIn.delete(input);\n return mappedIterable;\n } else {\n throw new Error(`Can't recurse into non-iterable type: ${input}`);\n }\n}\n\n// TODO(soergel, kangyizhang) Reconsider naming of deepZip() to avoid confusion\n// with zip()\n\n/**\n * Zip nested structures together in a recursive manner.\n *\n * This has the effect of transposing or pivoting data, e.g. converting it from\n * a row-major representation to a column-major representation.\n *\n * For example, `deepZip([{a: 1, b: 2}, {a: 3, b: 4}])` returns\n * `{a: [1, 3], b: [2, 4]}`.\n *\n * The inputs should all have the same nested structure (i.e., of arrays and\n * dicts). The result is a single object with the same nested structure, where\n * the leaves are arrays collecting the values of the inputs at that location\n * (or, optionally, the result of a custom function applied to those arrays).\n *\n * @param inputs: An array of the objects to zip together.\n * @param zipFn: (optional) A function that expects an array of elements at a\n * single node of the object tree, and returns a `DeepMapResult`. The\n * `DeepMapResult` either provides a result value for that node (i.e.,\n * representing the subtree), or indicates that the node should be processed\n * recursively. The default zipFn recurses as far as possible and places\n * arrays at the leaves.\n */\nexport function deepZip(\n inputs: any[], zipFn: (xs: any[]) => DeepMapResult = zipToList): any|any[] {\n return deepZipInternal(inputs, zipFn);\n}\n\n/**\n * @param containedIn: An set containing objects on the reference path currently\n * being processed (used to detect cycles).\n */\nfunction deepZipInternal(\n inputs: any[], zipFn: (xs: any[]) => DeepMapResult,\n containedIn: Set<{}> = new Set()): any|any[] {\n // The recursion follows the structure of input 0; it's assumed that all the\n // other inputs have the same structure.\n const input = inputs[0];\n if (containedIn.has(input)) {\n throw new Error('Circular references are not supported.');\n }\n const result = zipFn(inputs);\n\n if (result.recurse && result.value !== null) {\n throw new Error(\n 'A deep zip function may not return both a value and recurse=true.');\n }\n\n if (!result.recurse) {\n return result.value;\n } else if (isIterable(input)) {\n // tslint:disable-next-line:no-any\n const mappedIterable: any|any[] = Array.isArray(input) ? [] : {};\n containedIn.add(input);\n for (const k in input) {\n const children = inputs.map(x => x[k]);\n const childResult = deepZipInternal(children, zipFn, containedIn);\n mappedIterable[k] = childResult;\n }\n containedIn.delete(input);\n return mappedIterable;\n } else {\n throw new Error(`Can't recurse into non-iterable type: ${input}`);\n }\n}\n\n// tslint:disable-next-line:no-any\nexport function zipToList(x: any[]): DeepMapResult {\n if (x === null) {\n return null;\n }\n // TODO(soergel): validate array type?\n\n if (isIterable(x[0])) {\n return {value: null, recurse: true};\n } else {\n return {value: x, recurse: false};\n }\n}\n\n/**\n * A return value for an async map function for use with deepMapAndAwaitAll.\n *\n * If recurse is true, the value should be empty, and iteration will continue\n * into the object or array.\n */\nexport type DeepMapAsyncResult = {\n value: Promise,\n recurse: boolean\n};\n\n/**\n * Apply an async mapping function to a nested structure in a recursive manner.\n *\n * This first creates a nested structure of Promises, and then awaits all of\n * those, resulting in a single Promise for a resolved nested structure.\n *\n * The result of the mapping is an object with the same nested structure (i.e.,\n * of arrays and dicts) as the input, except that some subtrees are replaced,\n * according to the results of the mapping function.\n *\n * Mappings are memoized. Thus, if the nested structure contains the same\n * object in multiple positions, the output will contain the same mapped object\n * in those positions. Cycles are not supported, however.\n *\n * @param input: The object to which to apply the mapping function.\n * @param mapFn: A function that expects a single node of the object tree, and\n * returns a `DeepMapAsyncResult`. The `DeepMapAsyncResult` either provides\n * a `Promise` for a replacement value for that node (i.e., replacing the\n * subtree), or indicates that the node should be processed recursively. Note\n * that the decision whether or not to recurse must be made immediately; only\n * the mapped value may be promised.\n */\nexport async function deepMapAndAwaitAll(\n input: any, mapFn: (x: any) => DeepMapAsyncResult): Promise {\n const seen: Map> = new Map();\n\n // First do a normal deepMap, collecting Promises in 'seen' as a side effect.\n deepMapInternal(input, mapFn, seen);\n\n // Replace the Promises in 'seen' in place.\n // Note TypeScript provides no async map iteration, and regular map iteration\n // is broken too, so sadly we have to do Array.from() to make it work.\n // (There's no advantage to Promise.all(), and that would be tricky anyway.)\n for (const key of Array.from(seen.keys())) {\n const value = seen.get(key);\n if (tf.util.isPromise(value)) {\n const mappedValue = await value;\n seen.set(key, mappedValue);\n }\n }\n\n // Normal deepMap again, this time filling in the resolved values.\n // It's unfortunate that we have to do two passes.\n // TODO(soergel): test performance and think harder about a fast solution.\n const result = deepMapInternal(input, mapFn, seen);\n return result;\n}\n\n/**\n * Determine whether the argument is iterable.\n *\n * @returns true if the argument is an array or any non-Tensor object.\n */\n// tslint:disable-next-line:no-any\nexport function isIterable(obj: any): boolean {\n return obj != null && (!ArrayBuffer.isView(obj)) &&\n (Array.isArray(obj) ||\n (typeof obj === 'object' && !(obj instanceof tf.Tensor)));\n}\n\n/**\n * Determine whether the argument can be converted to Tensor.\n *\n * Tensors, primitives, arrays, and TypedArrays all qualify; anything else does\n * not.\n *\n * @returns true if the argument can be converted to Tensor.\n */\n// tslint:disable-next-line:no-any\nexport function canTensorify(obj: any): boolean {\n return obj == null || isPrimitive(obj) || Array.isArray(obj) ||\n (typeof obj === 'object' && (obj instanceof tf.Tensor)) ||\n tf.util.isTypedArray(obj);\n}\n\n/**\n * Returns true if the given `value` is a primitive type. Otherwise returns\n * false. This is equivalant to node util.isPrimitive\n */\nfunction isPrimitive(value: any): boolean {\n return (\n value === null ||\n (typeof value !== 'object' && typeof value !== 'function'));\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport {deepMap, DeepMapResult, isIterable} from './deep_map';\n\nexport function deepClone(container: T): T {\n return deepMap(container, cloneIfTensor);\n}\n\n// tslint:disable-next-line: no-any\nfunction cloneIfTensor(item: any): DeepMapResult {\n if (item instanceof tf.Tensor) {\n return ({value: item.clone(), recurse: false});\n } else if (isIterable(item)) {\n return {value: null, recurse: true};\n } else {\n return {value: item, recurse: false};\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\n/**\n * A ring buffer, providing O(1) FIFO, LIFO, and related operations.\n */\nexport class RingBuffer {\n // Note we store the indices in the range 0 <= index < 2*capacity.\n // This allows us to distinguish the full from the empty case.\n // See https://www.snellman.net/blog/archive/2016-12-13-ring-buffers/\n protected begin = 0; // inclusive\n protected end = 0; // exclusive\n protected doubledCapacity: number;\n\n protected data: T[];\n\n /**\n * Constructs a `RingBuffer`.\n * @param capacity The number of items that the buffer can accomodate.\n */\n constructor(public capacity: number) {\n if (capacity == null) {\n throw new RangeError('Can\\'t create a ring buffer of unknown capacity.');\n }\n if (capacity < 1) {\n throw new RangeError('Can\\'t create ring buffer of capacity < 1.');\n }\n this.data = new Array(capacity);\n this.doubledCapacity = 2 * capacity;\n }\n\n /**\n * Map any index into the range 0 <= index < 2*capacity.\n */\n protected wrap(index: number) {\n // don't trust % on negative numbers\n while (index < 0) {\n index += this.doubledCapacity;\n }\n return index % this.doubledCapacity;\n }\n\n protected get(index: number) {\n if (index < 0) {\n throw new RangeError('Can\\'t get item at a negative index.');\n }\n return this.data[index % this.capacity];\n }\n\n protected set(index: number, value: T) {\n if (index < 0) {\n throw new RangeError('Can\\'t set item at a negative index.');\n }\n this.data[index % this.capacity] = value;\n }\n\n /**\n * Returns the current number of items in the buffer.\n */\n length(): number {\n let length = this.end - this.begin;\n if (length < 0) {\n length = this.doubledCapacity + length;\n }\n return length;\n }\n\n /**\n * Reports whether the buffer is full.\n * @returns true if the number of items in the buffer equals its capacity, and\n * false otherwise.\n */\n isFull() {\n return this.length() === this.capacity;\n }\n\n /**\n * Reports whether the buffer is empty.\n * @returns true if the number of items in the buffer equals zero, and\n * false otherwise.\n */\n isEmpty() {\n return this.length() === 0;\n }\n\n /**\n * Adds an item to the end of the buffer.\n */\n push(value: T) {\n if (this.isFull()) {\n throw new RangeError('Ring buffer is full.');\n }\n this.set(this.end, value);\n this.end = this.wrap(this.end + 1);\n }\n\n /**\n * Adds many items to the end of the buffer, in order.\n */\n pushAll(values: T[]) {\n for (const value of values) {\n this.push(value);\n }\n }\n\n /**\n * Removes and returns the last item in the buffer.\n */\n pop(): T {\n if (this.isEmpty()) {\n throw new RangeError('Ring buffer is empty.');\n }\n this.end = this.wrap(this.end - 1);\n const result = this.get(this.end);\n this.set(this.end, undefined);\n return result;\n }\n\n /**\n * Adds an item to the beginning of the buffer.\n */\n unshift(value: T) {\n if (this.isFull()) {\n throw new RangeError('Ring buffer is full.');\n }\n this.begin = this.wrap(this.begin - 1);\n this.set(this.begin, value);\n }\n\n /**\n * Removes and returns the first item in the buffer.\n */\n shift(): T {\n if (this.isEmpty()) {\n throw new RangeError('Ring buffer is empty.');\n }\n const result = this.get(this.begin);\n this.set(this.begin, undefined);\n this.begin = this.wrap(this.begin + 1);\n return result;\n }\n\n /**\n * Removes and returns a specific item in the buffer, and moves the last item\n * to the vacated slot. This is useful for implementing a shuffling stream.\n * Note that this operation necessarily scrambles the original order.\n *\n * @param relativeIndex: the index of the item to remove, relative to the\n * first item in the buffer (e.g., hiding the ring nature of the underlying\n * storage).\n */\n shuffleExcise(relativeIndex: number): T {\n if (this.isEmpty()) {\n throw new RangeError('Ring buffer is empty.');\n }\n const index = this.wrap(this.begin + relativeIndex);\n const result = this.get(index);\n this.set(index, this.pop());\n return result;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {RingBuffer} from './ring_buffer';\n\nexport class GrowingRingBuffer extends RingBuffer {\n private static INITIAL_CAPACITY = 32;\n\n /**\n * Constructs a `GrowingRingBuffer`.\n */\n constructor() {\n super(GrowingRingBuffer.INITIAL_CAPACITY);\n }\n\n isFull() {\n return false;\n }\n\n push(value: T) {\n if (super.isFull()) {\n this.expand();\n }\n super.push(value);\n }\n\n unshift(value: T) {\n if (super.isFull()) {\n this.expand();\n }\n super.unshift(value);\n }\n\n /**\n * Doubles the capacity of the buffer.\n */\n private expand() {\n const newCapacity = this.capacity * 2;\n const newData = new Array(newCapacity);\n const len = this.length();\n\n // Rotate the buffer to start at index 0 again, since we can't just\n // allocate more space at the end.\n for (let i = 0; i < len; i++) {\n newData[i] = this.get(this.wrap(this.begin + i));\n }\n\n this.data = newData;\n this.capacity = newCapacity;\n this.doubledCapacity = 2 * this.capacity;\n this.begin = 0;\n this.end = len;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport * as seedrandom from 'seedrandom';\n\nimport {Container} from '../types';\nimport {deepClone} from '../util/deep_clone';\nimport {deepMapAndAwaitAll, DeepMapAsyncResult, DeepMapResult, deepZip, zipToList} from '../util/deep_map';\nimport {GrowingRingBuffer} from '../util/growing_ring_buffer';\nimport {RingBuffer} from '../util/ring_buffer';\n\n/**\n * A nested structure of LazyIterators, used as the input to zip().\n */\nexport type IteratorContainer = Container>;\n\n// Here we implement a simple asynchronous iterator.\n// This lets us avoid using either third-party stream libraries or\n// recent TypeScript language support requiring polyfills.\n\n/**\n * Create a `LazyIterator` from an array of items.\n */\nexport function iteratorFromItems(items: T[]): LazyIterator {\n return new ArrayIterator(items);\n}\n\n/**\n * Create a `LazyIterator` of incrementing integers.\n */\nexport function iteratorFromIncrementing(start: number): LazyIterator {\n let i = start;\n return iteratorFromFunction(() => ({value: i++, done: false}));\n}\n\n/**\n * Create a `LazyIterator` from a function.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const iter = tf.data.iteratorFromFunction(func);\n * await iter.forEachAsync(e => console.log(e));\n * ```\n *\n * @param func A function that produces data on each call.\n */\nexport function iteratorFromFunction(\n func: () =>\n IteratorResult| Promise>): LazyIterator {\n return new FunctionCallIterator(func);\n}\n\n/**\n * Create a `LazyIterator` by concatenating underlying streams, which are\n * themselves provided as a stream.\n *\n * This can also be thought of as a \"stream flatten\" operation.\n *\n * @param baseIterators A stream of streams to be concatenated.\n * @param baseErrorHandler An optional function that can intercept `Error`s\n * raised during a `next()` call on the base stream. This function can decide\n * whether the error should be propagated, whether the error should be\n * ignored, or whether the base stream should be terminated.\n */\nexport function iteratorFromConcatenated(\n baseIterators: LazyIterator>,\n baseErrorHandler?: (e: Error) => boolean): LazyIterator {\n return new ChainedIterator(baseIterators, baseErrorHandler);\n}\n\n/**\n * Create a `LazyIterator` by concatenating streams produced by calling a\n * stream-generating function a given number of times.\n *\n * Since a `LazyIterator` is read-once, it cannot be repeated, but this\n * function can be used to achieve a similar effect:\n *\n * LazyIterator.ofConcatenatedFunction(() => new MyIterator(), 6);\n *\n * @param iteratorFunc: A function that produces a new stream on each call.\n * @param count: The number of times to call the function.\n * @param baseErrorHandler An optional function that can intercept `Error`s\n * raised during a `next()` call on the base stream. This function can decide\n * whether the error should be propagated, whether the error should be\n * ignored, or whether the base stream should be terminated.\n */\nexport function iteratorFromConcatenatedFunction(\n iteratorFunc: () => IteratorResult>, count: number,\n baseErrorHandler?: (e: Error) => boolean): LazyIterator {\n return iteratorFromConcatenated(\n iteratorFromFunction(iteratorFunc).take(count), baseErrorHandler);\n}\n\n/**\n * Create a `LazyIterator` by zipping together an array, dict, or nested\n * structure of `LazyIterator`s (and perhaps additional constants).\n *\n * The underlying streams must provide elements in a consistent order such\n * that they correspond.\n *\n * Typically, the underlying streams should have the same number of\n * elements. If they do not, the behavior is determined by the\n * `mismatchMode` argument.\n *\n * The nested structure of the `iterators` argument determines the\n * structure of elements in the resulting iterator.\n *\n * @param iterators: An array or object containing LazyIterators at the\n * leaves.\n * @param mismatchMode: Determines what to do when one underlying iterator\n * is exhausted before the others. `ZipMismatchMode.FAIL` (the default)\n * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST`\n * causes the zipped iterator to terminate with the furst underlying\n * streams, so elements remaining on the longer streams are ignored.\n * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling\n * in nulls for the exhausted streams, until all streams are exhausted.\n */\nexport function iteratorFromZipped(\n iterators: IteratorContainer,\n mismatchMode: ZipMismatchMode = ZipMismatchMode.FAIL): LazyIterator {\n return new ZipIterator(iterators, mismatchMode);\n}\n\n/**\n * An asynchronous iterator, providing lazy access to a potentially\n * unbounded stream of elements.\n *\n * Iterator can be obtained from a dataset:\n * `const iter = await dataset.iterator();`\n */\nexport abstract class LazyIterator {\n // This class implements AsyncIterator, but we have not yet set the\n // TypeScript --downlevelIteration flag to enable that.\n\n abstract summary(): string;\n\n /**\n * Returns a `Promise` for the next element in the stream.\n *\n * When an item can be provided successfully, the return value is\n * `{value:T, done:false}`.\n *\n * Calling next() on a closed stream returns `{value:null, done:true}`.\n */\n abstract async next(): Promise>;\n\n /**\n * Collect all remaining elements of a bounded stream into an array.\n * Obviously this will succeed only for small streams that fit in memory.\n * Useful for testing.\n *\n * @returns A Promise for an array of stream elements, which will resolve\n * when the stream is exhausted.\n */\n async toArray(): Promise {\n const result: T[] = [];\n let x = await this.next();\n while (!x.done) {\n result.push(x.value);\n x = await this.next();\n }\n return result;\n }\n\n /**\n * Collect all elements of this dataset into an array with prefetching 100\n * elements. This is useful for testing, because the prefetch changes the\n * order in which the Promises are resolved along the processing pipeline.\n * This may help expose bugs where results are dependent on the order of\n * Promise resolution rather than on the logical order of the stream (i.e.,\n * due to hidden mutable state).\n *\n * @returns A Promise for an array of stream elements, which will resolve\n * when the stream is exhausted.\n */\n async toArrayForTest(): Promise {\n const stream = this.prefetch(100);\n const result: T[] = [];\n let x = await stream.next();\n while (!x.done) {\n result.push(x.value);\n x = await stream.next();\n }\n return result;\n }\n\n /**\n * Draw items from the stream until it is exhausted.\n *\n * This can be useful when the stream has side effects but no output. In\n * that case, calling this function guarantees that the stream will be\n * fully processed.\n */\n async resolveFully(): Promise {\n let x = await this.next();\n while (!x.done) {\n x = await this.next();\n }\n }\n\n /**\n * Draw items from the stream until it is exhausted, or a predicate fails.\n *\n * This can be useful when the stream has side effects but no output. In\n * that case, calling this function guarantees that the stream will be\n * fully processed.\n */\n async resolveWhile(predicate: (r: T) => boolean): Promise {\n let x = await this.next();\n let shouldContinue = predicate(x.value);\n while ((!x.done) && shouldContinue) {\n x = await this.next();\n shouldContinue = predicate(x.value);\n }\n }\n\n /**\n * Handles errors thrown on this stream using a provided handler function.\n *\n * @param handler A function that handles any `Error` thrown during a `next()`\n * call and returns true if the stream should continue (dropping the failed\n * call) or false if the stream should quietly terminate. If the handler\n * itself throws (or rethrows) an `Error`, that will be propagated.\n *\n * @returns A `LazyIterator` of elements passed through from upstream,\n * possibly filtering or terminating on upstream `next()` calls that\n * throw an `Error`.\n */\n handleErrors(handler: (error: Error) => boolean): LazyIterator {\n return new ErrorHandlingLazyIterator(this, handler);\n }\n\n // TODO(soergel): Implement reduce() etc.\n\n /**\n * Filters this stream according to `predicate`.\n *\n * @param predicate A function mapping a stream element to a boolean or a\n * `Promise` for one.\n *\n * @returns A `LazyIterator` of elements for which the predicate was true.\n */\n filter(predicate: (value: T) => boolean): LazyIterator {\n return new FilterIterator(this, predicate);\n }\n\n /**\n * Maps this stream through a 1-to-1 transform.\n *\n * @param transform A function mapping a stream element to a transformed\n * element.\n *\n * @returns A `LazyIterator` of transformed elements.\n */\n map(transform: (value: T) => O): LazyIterator {\n return new MapIterator(this, transform);\n }\n\n /**\n * Maps this stream through an async 1-to-1 transform.\n *\n * @param transform A function mapping a stream element to a `Promise` for a\n * transformed stream element.\n *\n * @returns A `LazyIterator` of transformed elements.\n */\n mapAsync(transform: (value: T) => Promise): LazyIterator {\n return new AsyncMapIterator(this, transform);\n }\n\n /**\n * Maps this stream through a 1-to-1 transform, forcing serial execution.\n *\n * @param transform A function mapping a stream element to a transformed\n * element.\n *\n * @returns A `LazyIterator` of transformed elements.\n */\n serialMapAsync(transform: (value: T) => Promise): LazyIterator {\n return new AsyncMapIterator(this, transform).serial();\n }\n\n /**\n * Maps this stream through a 1-to-many transform.\n *\n * @param transform A function mapping a stream element to an array of\n * transformed elements.\n *\n * @returns A `DataStream` of transformed elements.\n */\n flatmap(transform: (value: T) => O[]): LazyIterator {\n return new FlatmapIterator(this, transform);\n }\n\n /**\n * Apply a function to every element of the stream.\n *\n * @param f A function to apply to each stream element.\n */\n async forEachAsync(f: (value: T) => void): Promise {\n return this.map(f).resolveFully();\n }\n\n /**\n * Apply a function to every element of the stream, forcing serial execution.\n *\n * @param f A function to apply to each stream element. Should return 'true'\n * to indicate that the stream should continue, or 'false' to cause it to\n * terminate.\n */\n async serialForEach(f: (value: T) => Promise): Promise {\n return this.serialMapAsync(f).resolveWhile(x => (x === true));\n }\n\n /**\n * Groups elements into batches, represented as arrays of elements.\n *\n * We can think of the elements of this iterator as 'rows' (even if they are\n * nested structures). By the same token, consecutive values for a given\n * key within the elements form a 'column'. This matches the usual sense of\n * 'row' and 'column' when processing tabular data (e.g., parsing a CSV).\n *\n * Thus, \"Row-major\" means that the resulting batch is simply a collection of\n * rows: `[row1, row2, row3, ...]`. This is contrast to the column-major\n * form, which is needed for vectorized computation.\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @returns A `LazyIterator` of batches of elements, represented as arrays\n * of the original element type.\n */\n rowMajorBatch(batchSize: number, smallLastBatch = true): LazyIterator {\n return new RowMajorBatchIterator(this, batchSize, smallLastBatch);\n }\n\n /**\n * Groups elements into batches, represented in column-major form.\n *\n * We can think of the elements of this iterator as 'rows' (even if they are\n * nested structures). By the same token, consecutive values for a given\n * key within the elements form a 'column'. This matches the usual sense of\n * 'row' and 'column' when processing tabular data (e.g., parsing a CSV).\n *\n * Thus, \"column-major\" means that the resulting batch is a (potentially\n * nested) structure representing the columns. Each column entry, then,\n * contains a collection of the values found in that column for a range of\n * input elements. This representation allows for vectorized computation, in\n * contrast to the row-major form.\n *\n * The inputs should all have the same nested structure (i.e., of arrays and\n * dicts). The result is a single object with the same nested structure,\n * where the leaves are arrays collecting the values of the inputs at that\n * location (or, optionally, the result of a custom function applied to those\n * arrays).\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @param zipFn: (optional) A function that expects an array of elements at a\n * single node of the object tree, and returns a `DeepMapResult`. The\n * `DeepMapResult` either provides a result value for that node (i.e.,\n * representing the subtree), or indicates that the node should be processed\n * recursively. The default zipFn recurses as far as possible and places\n * arrays at the leaves.\n * @returns A `LazyIterator` of batches of elements, represented as an object\n * with collections at the leaves.\n */\n columnMajorBatch(\n batchSize: number, smallLastBatch = true,\n // tslint:disable-next-line:no-any\n zipFn: (xs: any[]) => DeepMapResult = zipToList):\n LazyIterator {\n // First collect the desired number of input elements as a row-major batch.\n const rowBatches = this.rowMajorBatch(batchSize, smallLastBatch);\n // Now 'rotate' or 'pivot' the data, collecting all values from each column\n // in the batch (i.e., for each key within the elements) into an array.\n return rowBatches.map(x => deepZip(x, zipFn));\n }\n\n /**\n * Concatenate this `LazyIterator` with another.\n *\n * @param iterator A `LazyIterator` to be concatenated onto this one.\n * @param baseErrorHandler An optional function that can intercept `Error`s\n * raised during a `next()` call on the base stream. This function can\n * decide whether the error should be propagated, whether the error should\n * be ignored, or whether the base stream should be terminated.\n * @returns A `LazyIterator`.\n */\n concatenate(\n iterator: LazyIterator,\n baseErrorHandler?: (e: Error) => boolean): LazyIterator {\n return new ChainedIterator(\n iteratorFromItems([this, iterator]), baseErrorHandler);\n }\n\n /**\n * Limits this stream to return at most `count` items.\n *\n * @param count The maximum number of items to provide from the stream. If\n * a negative or undefined value is given, the entire stream is returned\n * unaltered.\n */\n take(count: number): LazyIterator {\n if (count < 0 || count == null) {\n return this;\n }\n return new TakeIterator(this, count);\n }\n\n /**\n * Skips the first `count` items in this stream.\n *\n * @param count The number of items to skip. If a negative or undefined\n * value is given, the entire stream is returned unaltered.\n */\n skip(count: number): LazyIterator {\n if (count < 0 || count == null) {\n return this;\n }\n return new SkipIterator(this, count);\n }\n\n /**\n * Prefetch the first `bufferSize` items in this stream.\n *\n * Note this prefetches Promises, but makes no guarantees about when those\n * Promises resolve.\n *\n * @param bufferSize: An integer specifying the number of elements to be\n * prefetched.\n */\n prefetch(bufferSize: number): LazyIterator {\n return new PrefetchIterator(this, bufferSize);\n }\n\n // TODO(soergel): deep sharded shuffle, where supported\n\n /**\n * Randomly shuffles the elements of this stream.\n *\n * @param bufferSize: An integer specifying the number of elements from\n * this stream from which the new stream will sample.\n * @param seed: (Optional.) An integer specifying the random seed that\n * will be used to create the distribution.\n */\n shuffle(windowSize: number, seed?: string): LazyIterator {\n return new ShuffleIterator(this, windowSize, seed);\n }\n\n /**\n * Force an iterator to execute serially: each next() call will await the\n * prior one, so that they cannot execute concurrently.\n */\n serial(): LazyIterator {\n return new SerialIterator(this);\n }\n}\n\n// ============================================================================\n// The following private classes serve to implement the chainable methods\n// on LazyIterator. Unfortunately they can't be placed in separate files,\n// due to resulting trouble with circular imports.\n// ============================================================================\n\n// Iterators that just extend LazyIterator directly\n// ============================================================================\n\nclass ArrayIterator extends LazyIterator {\n private trav = 0;\n constructor(protected items: T[]) {\n super();\n }\n\n summary() {\n return `Array of ${this.items.length} items`;\n }\n\n async next(): Promise> {\n if (this.trav >= this.items.length) {\n return {value: null, done: true};\n }\n const item = this.items[this.trav];\n this.trav++;\n return {value: deepClone(item), done: false};\n }\n}\n\nclass FunctionCallIterator extends LazyIterator {\n constructor(\n protected nextFn: () => IteratorResult| Promise>) {\n super();\n }\n\n summary() {\n return `Function call`;\n }\n\n async next(): Promise> {\n try {\n return this.nextFn();\n } catch (e) {\n // Modify the error message but leave the stack trace intact\n e.message =\n `Error thrown while iterating through a dataset: ${e.message}`;\n throw e;\n }\n }\n}\n\nclass SerialIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n constructor(protected upstream: LazyIterator) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> Serial`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n return this.upstream.next();\n }\n}\n\nclass SkipIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n // Local state that should not be clobbered by out-of-order execution.\n count = 0;\n\n constructor(protected upstream: LazyIterator, protected maxCount: number) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> Skip`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n // TODO(soergel): consider tradeoffs of reading in parallel, eg.\n // collecting next() promises in an Array and then waiting for\n // Promise.all() of those. Benefit: pseudo-parallel execution. Drawback:\n // maybe delayed GC.\n while (this.count++ < this.maxCount) {\n const skipped = await this.upstream.next();\n // short-circuit if upstream is already empty\n if (skipped.done) {\n return skipped;\n }\n tf.dispose(skipped.value as {});\n }\n return this.upstream.next();\n }\n}\n\nclass TakeIterator extends LazyIterator {\n count = 0;\n constructor(protected upstream: LazyIterator, protected maxCount: number) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Take`;\n }\n\n async next(): Promise> {\n if (this.count++ >= this.maxCount) {\n return {value: null, done: true};\n }\n return this.upstream.next();\n }\n}\n\n// Note this batch just groups items into row-wise element arrays.\n// Rotating these to a column-wise representation happens only at the dataset\n// level.\nclass RowMajorBatchIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n constructor(\n protected upstream: LazyIterator, protected batchSize: number,\n protected enableSmallLastBatch = true) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> RowMajorBatch`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n const batch: T[] = [];\n while (batch.length < this.batchSize) {\n const item = await this.upstream.next();\n if (item.done) {\n if (this.enableSmallLastBatch && batch.length > 0) {\n return {value: batch, done: false};\n }\n return {value: null, done: true};\n }\n batch.push(item.value);\n }\n return {value: batch, done: false};\n }\n}\n\nclass FilterIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n constructor(\n protected upstream: LazyIterator,\n protected predicate: (value: T) => boolean) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> Filter`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n while (true) {\n const item = await this.upstream.next();\n if (item.done || this.predicate(item.value)) {\n return item;\n }\n tf.dispose(item.value as {});\n }\n }\n}\n\nclass MapIterator extends LazyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected transform: (value: I) => O) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Map`;\n }\n\n async next(): Promise> {\n const item = await this.upstream.next();\n if (item.done) {\n return {value: null, done: true};\n }\n const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {});\n // Careful: the transform may mutate the item in place.\n // That's why we have to remember the input Tensors above, and then\n // below dispose only those that were not passed through to the output.\n // Note too that the transform function is responsible for tidying\n // any intermediate Tensors. Here we are concerned only about the\n // inputs.\n const mapped = this.transform(item.value);\n const outputTensors = tf.tensor_util.getTensorsInContainer(mapped as {});\n\n // TODO(soergel) faster intersection\n // TODO(soergel) move to tf.disposeExcept(in, out)?\n for (const t of inputTensors) {\n if (!tf.tensor_util.isTensorInList(t, outputTensors)) {\n t.dispose();\n }\n }\n return {value: mapped, done: false};\n }\n}\n\nclass ErrorHandlingLazyIterator extends LazyIterator {\n count = 0;\n constructor(\n protected upstream: LazyIterator,\n protected handler: (error: Error) => boolean) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> handleErrors`;\n }\n\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n async serialNext(): Promise> {\n while (true) {\n try {\n return await this.upstream.next();\n } catch (e) {\n if (!this.handler(e)) {\n return {value: null, done: true};\n }\n // If the handler returns true, loop and fetch the next upstream item.\n\n // If the upstream iterator throws an endless stream of errors, and if\n // the handler says to ignore them, then we loop forever here. That is\n // the correct behavior-- it's up to the handler to decide when to stop.\n }\n }\n }\n}\n\nclass AsyncMapIterator extends LazyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected transform: (value: I) => Promise) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> AsyncMap`;\n }\n\n async next(): Promise> {\n const item = await this.upstream.next();\n if (item.done) {\n return {value: null, done: true};\n }\n const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {});\n // Careful: the transform may mutate the item in place.\n // That's why we have to remember the input Tensors above, and then\n // below dispose only those that were not passed through to the output.\n // Note too that the transform function is responsible for tidying\n // any intermediate Tensors. Here we are concerned only about the\n // inputs.\n const mapped = await this.transform(item.value);\n const outputTensors = tf.tensor_util.getTensorsInContainer(mapped as {});\n\n // TODO(soergel) faster intersection\n // TODO(soergel) move to tf.disposeExcept(in, out)?\n for (const t of inputTensors) {\n if (!tf.tensor_util.isTensorInList(t, outputTensors)) {\n t.dispose();\n }\n }\n return {value: mapped, done: false};\n }\n}\n\n// Iterators that maintain a queue of pending items\n// ============================================================================\n\n/**\n * A base class for transforming streams that operate by maintaining an\n * output queue of elements that are ready to return via next(). This is\n * commonly required when the transformation is 1-to-many: A call to next()\n * may trigger a call to the underlying stream, which will produce many\n * mapped elements of this stream-- of which we need to return only one, so\n * we have to queue the rest.\n */\nexport abstract class OneToManyIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n // Local state that should not be clobbered by out-of-order execution.\n protected outputQueue: RingBuffer;\n\n constructor() {\n super();\n this.outputQueue = new GrowingRingBuffer();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n /**\n * Read one or more chunks from upstream and process them, possibly\n * reading or writing a carryover, and adding processed items to the\n * output queue. Note it's possible that no items are added to the queue\n * on a given pump() call, even if the upstream stream is not closed\n * (e.g., because items are filtered).\n *\n * @return `true` if any action was taken, i.e. fetching items from the\n * upstream source OR adding items to the output queue. `false` if the\n * upstream source is exhausted AND nothing was added to the queue\n * (i.e., any remaining carryover).\n */\n protected abstract async pump(): Promise;\n\n async serialNext(): Promise> {\n // Fetch so that the queue contains at least one item if possible.\n // If the upstream source is exhausted, AND there are no items left in\n // the output queue, then this stream is also exhausted.\n while (this.outputQueue.length() === 0) {\n // TODO(soergel): consider parallel reads.\n if (!await this.pump()) {\n return {value: null, done: true};\n }\n }\n return {value: this.outputQueue.shift(), done: false};\n }\n}\nclass FlatmapIterator extends OneToManyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected transform: (value: I) => O[]) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Flatmap`;\n }\n\n async pump(): Promise {\n const item = await this.upstream.next();\n if (item.done) {\n return false;\n }\n const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {});\n // Careful: the transform may mutate the item in place.\n // that's why we have to remember the input Tensors above, and then\n // below dispose only those that were not passed through to the output.\n // Note too that the transform function is responsible for tidying any\n // intermediate Tensors. Here we are concerned only about the inputs.\n const mappedArray = this.transform(item.value);\n const outputTensors =\n tf.tensor_util.getTensorsInContainer(mappedArray as {});\n this.outputQueue.pushAll(mappedArray);\n\n // TODO(soergel) faster intersection, and deduplicate outputTensors\n // TODO(soergel) move to tf.disposeExcept(in, out)?\n for (const t of inputTensors) {\n if (!tf.tensor_util.isTensorInList(t, outputTensors)) {\n t.dispose();\n }\n }\n\n return true;\n }\n}\n\n/**\n * Provides a `LazyIterator` that concatenates a stream of underlying\n * streams.\n *\n * Doing this in a concurrency-safe way requires some trickery. In\n * particular, we want this stream to return the elements from the\n * underlying streams in the correct order according to when next() was\n * called, even if the resulting Promises resolve in a different order.\n */\nexport class ChainedIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise> = null;\n\n // Local state that should not be clobbered by out-of-order execution.\n private iterator: LazyIterator = null;\n private moreIterators: LazyIterator>;\n\n constructor(\n iterators: LazyIterator>,\n private readonly baseErrorHandler?: (e: Error) => boolean) {\n super();\n this.moreIterators = iterators;\n }\n\n summary() {\n const upstreamSummaries = 'TODO: fill in upstream of chained summaries';\n return `${upstreamSummaries} -> Chained`;\n }\n\n async next(): Promise> {\n this.lastRead = this.readFromChain(this.lastRead);\n return this.lastRead;\n }\n\n private async readFromChain(lastRead: Promise>):\n Promise> {\n // Must await on the previous read since the previous read may have advanced\n // the stream of streams, from which we need to read.\n // This is unfortunate since we can't parallelize reads. Which means\n // prefetching of chained streams is a no-op.\n // One solution is to prefetch immediately upstream of this.\n await lastRead;\n if (this.iterator == null) {\n const iteratorResult = await this.moreIterators.next();\n if (iteratorResult.done) {\n // No more streams to stream from.\n return {value: null, done: true};\n }\n this.iterator = iteratorResult.value;\n if (this.baseErrorHandler != null) {\n this.iterator = this.iterator.handleErrors(this.baseErrorHandler);\n }\n }\n const itemResult = await this.iterator.next();\n if (itemResult.done) {\n this.iterator = null;\n return this.readFromChain(lastRead);\n }\n return itemResult;\n }\n}\n\nexport enum ZipMismatchMode {\n FAIL, // require zipped streams to have the same length\n SHORTEST, // terminate zip when the first stream is exhausted\n LONGEST // use nulls for exhausted streams; use up the longest stream.\n}\n\n/**\n * Provides a `LazyIterator` that zips together an array, dict, or nested\n * structure of `LazyIterator`s (and perhaps additional constants).\n *\n * The underlying streams must provide elements in a consistent order such\n * that they correspond.\n *\n * Typically, the underlying streams should have the same number of\n * elements. If they do not, the behavior is determined by the\n * `mismatchMode` argument.\n *\n * The nested structure of the `iterators` argument determines the\n * structure of elements in the resulting iterator.\n *\n * Doing this in a concurrency-safe way requires some trickery. In\n * particular, we want this stream to return the elements from the\n * underlying streams in the correct order according to when next() was\n * called, even if the resulting Promises resolve in a different order.\n *\n * @param iterators: An array or object containing LazyIterators at the\n * leaves.\n * @param mismatchMode: Determines what to do when one underlying iterator\n * is exhausted before the others. `ZipMismatchMode.FAIL` (the default)\n * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST`\n * causes the zipped iterator to terminate with the furst underlying\n * streams, so elements remaining on the longer streams are ignored.\n * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling\n * in nulls for the exhausted streams, until all streams are exhausted.\n */\nclass ZipIterator extends LazyIterator {\n private count = 0;\n private currentPromise: Promise> = null;\n\n constructor(\n protected readonly iterators: IteratorContainer,\n protected readonly mismatchMode: ZipMismatchMode = ZipMismatchMode.FAIL) {\n super();\n }\n\n summary() {\n const upstreamSummaries = 'TODO: fill in upstream of zip summaries';\n return `{${upstreamSummaries}} -> Zip`;\n }\n\n private async nextState(afterState: Promise>):\n Promise> {\n // This chaining ensures that the underlying next() are not even called\n // before the previous ones have resolved.\n await afterState;\n\n // Collect underlying iterator \"done\" signals as a side effect in\n // getNext()\n let numIterators = 0;\n let iteratorsDone = 0;\n\n function getNext(container: IteratorContainer): DeepMapAsyncResult {\n if (container instanceof LazyIterator) {\n const result = container.next();\n return {\n value: result.then(x => {\n numIterators++;\n if (x.done) {\n iteratorsDone++;\n }\n return x.value;\n }),\n recurse: false\n };\n } else {\n return {value: null, recurse: true};\n }\n }\n\n const mapped: O = await deepMapAndAwaitAll(this.iterators, getNext);\n\n if (numIterators === iteratorsDone) {\n // The streams have all ended.\n return {value: null, done: true};\n }\n if (iteratorsDone > 0) {\n switch (this.mismatchMode) {\n case ZipMismatchMode.FAIL:\n throw new Error(\n 'Zipped streams should have the same length. ' +\n `Mismatched at element ${this.count}.`);\n case ZipMismatchMode.SHORTEST:\n return {value: null, done: true};\n case ZipMismatchMode.LONGEST:\n default:\n // Continue. The exhausted streams already produced value: null.\n }\n }\n\n this.count++;\n return {value: mapped, done: false};\n }\n\n async next(): Promise> {\n this.currentPromise = this.nextState(this.currentPromise);\n return this.currentPromise;\n }\n}\n\n// Iterators that maintain a ring buffer of pending promises\n// ============================================================================\n\n/**\n * A stream that prefetches a given number of items from an upstream source,\n * returning them in FIFO order.\n *\n * Note this prefetches Promises, but makes no guarantees about when those\n * Promises resolve.\n */\nexport class PrefetchIterator extends LazyIterator {\n protected buffer: RingBuffer>>;\n\n constructor(\n protected upstream: LazyIterator, protected bufferSize: number) {\n super();\n this.buffer = new RingBuffer>>(bufferSize);\n }\n\n summary() {\n return `${this.upstream.summary()} -> Prefetch`;\n }\n\n /**\n * Refill the prefetch buffer. Returns only after the buffer is full, or\n * the upstream source is exhausted.\n */\n protected refill() {\n while (!this.buffer.isFull()) {\n const v = this.upstream.next();\n this.buffer.push(v);\n }\n }\n\n next(): Promise> {\n this.refill();\n // This shift will never throw an error because the buffer is always\n // full after a refill. If the stream is exhausted, the buffer will be\n // full of Promises that will resolve to the end-of-stream signal.\n return this.buffer.shift();\n }\n}\n\n/**\n * A stream that performs a sliding-window random shuffle on an upstream\n * source. This is like a `PrefetchIterator` except that the items are\n * returned in randomized order. Mixing naturally improves as the buffer\n * size increases.\n */\nexport class ShuffleIterator extends PrefetchIterator {\n private readonly random: seedrandom.prng;\n\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n // Local state that should not be clobbered by out-of-order execution.\n private upstreamExhausted = false;\n\n constructor(\n protected upstream: LazyIterator, protected windowSize: number,\n seed?: string) {\n super(upstream, windowSize);\n this.random = seedrandom.alea(seed || tf.util.now().toString());\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private randomInt(max: number) {\n return Math.floor(this.random() * max);\n }\n\n protected chooseIndex(): number {\n return this.randomInt(this.buffer.length());\n }\n\n async serialNext(): Promise> {\n // TODO(soergel): consider performance\n if (!this.upstreamExhausted) {\n this.refill();\n }\n while (!this.buffer.isEmpty()) {\n const chosenIndex = this.chooseIndex();\n const result = await this.buffer.shuffleExcise(chosenIndex);\n if (result.done) {\n this.upstreamExhausted = true;\n } else {\n this.refill();\n return result;\n }\n }\n return {value: null, done: true};\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport {TensorContainer, TensorLike} from '@tensorflow/tfjs-core';\nimport * as seedrandom from 'seedrandom';\n\nimport {iteratorFromConcatenated, iteratorFromFunction, iteratorFromItems, iteratorFromZipped, LazyIterator, ZipMismatchMode} from './iterators/lazy_iterator';\nimport {Container} from './types';\nimport {canTensorify, deepMapAndAwaitAll, DeepMapResult, isIterable} from './util/deep_map';\n\n/**\n * A nested structure of Datasets, used as the input to zip().\n */\nexport type DatasetContainer = Container>;\n\n// TODO(soergel): consider vectorized operations within the pipeline.\n\n/**\n * Represents a potentially large list of independent data elements (typically\n * 'samples' or 'examples').\n *\n * A 'data example' may be a primitive, an array, a map from string keys to\n * values, or any nested structure of these.\n *\n * A `Dataset` represents an ordered collection of elements, together with a\n * chain of transformations to be performed on those elements. Each\n * transformation is a method of `Dataset` that returns another `Dataset`, so\n * these may be chained, e.g.\n * `const processedDataset = rawDataset.filter(...).map(...).batch(...)`.\n *\n * Data loading and transformation is done in a lazy, streaming fashion. The\n * dataset may be iterated over multiple times; each iteration starts the data\n * loading anew and recapitulates the transformations.\n *\n * A `Dataset` is typically processed as a stream of unbatched examples --i.e.,\n * its transformations are applied one example at a time. Batching produces a\n * new `Dataset` where each element is a batch. Batching should usually come\n * last in a pipeline, because data transformations are easier to express on a\n * per-example basis than on a per-batch basis.\n *\n * The following code examples are calling `await dataset.forEachAsync(...)` to\n * iterate once over the entire dataset in order to print out the data.\n *\n * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'}\n */\nexport abstract class Dataset {\n /*\n * Provide a new stream of elements. Note this will also start new streams\n * from any underlying `Dataset`s.\n *\n * CAUTION: Any Tensors contained within the elements returned from\n * this stream *must* be manually disposed to avoid a GPU memory leak.\n * The tf.tidy() approach cannot be used in an asynchronous context.\n */\n abstract async iterator(): Promise>;\n\n readonly size: number = null;\n\n // TODO(soergel): Make Datasets report whether repeated iterator() calls\n // produce the same result (e.g., reading from a file) or different results\n // (e.g., from the webcam). Currently we don't make this distinction but it\n // could be important for the user to know.\n // abstract isDeterministic(): boolean;\n\n /**\n * Groups elements into batches.\n *\n * It is assumed that each of the incoming dataset elements has the same\n * structure-- i.e. the same set of keys at each location in an object\n * hierarchy. For each key, the resulting `Dataset` provides a batched\n * element collecting all of the incoming values for that key.\n *\n * * Incoming primitives are grouped into a 1-D Tensor.\n * * Incoming Tensors are grouped into a new Tensor where the 0'th axis is\n * the batch dimension.\n * * Incoming arrays are converted to Tensor and then batched.\n * * A nested array is interpreted as an n-D Tensor, so the batched result\n * has n+1 dimensions.\n * * An array that cannot be converted to Tensor produces an error.\n *\n * If an array should not be batched as a unit, it should first be converted\n * to an object with integer keys.\n *\n * Here are a few examples:\n *\n * Batch a dataset of numbers:\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8]).batch(4);\n * await a.forEachAsync(e => e.print());\n * ```\n *\n * Batch a dataset of arrays:\n * ```js\n * const b = tf.data.array([[1], [2], [3], [4], [5], [6], [7], [8]]).batch(4);\n * await b.forEachAsync(e => e.print());\n * ```\n *\n * Batch a dataset of objects:\n * ```js\n * const c = tf.data.array([{a: 1, b: 11}, {a: 2, b: 12}, {a: 3, b: 13},\n * {a: 4, b: 14}, {a: 5, b: 15}, {a: 6, b: 16}, {a: 7, b: 17},\n * {a: 8, b: 18}]).batch(4);\n * await c.forEachAsync(e => {\n * console.log('{');\n * for(var key in e) {\n * console.log(key+':');\n * e[key].print();\n * }\n * console.log('}');\n * })\n * ```\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @returns A `Dataset`, from which a stream of batches can be obtained.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n batch(batchSize: number, smallLastBatch = true): Dataset {\n const base = this;\n tf.util.assert(\n batchSize > 0, () => `batchSize needs to be positive, but it is\n ${batchSize}`);\n let size;\n if (this.size === Infinity || this.size == null) {\n // If the size of this dataset is infinity or null, the new size keeps the\n // same.\n size = this.size;\n } else if (smallLastBatch) {\n // If the size of this dataset is known and include small last batch, the\n // new size is full batch count plus last batch.\n size = Math.ceil(this.size / batchSize);\n } else {\n // If the size of this dataset is known and not include small last batch,\n // the new size is full batch count.\n size = Math.floor(this.size / batchSize);\n }\n return datasetFromIteratorFn(async () => {\n return (await base.iterator())\n .columnMajorBatch(batchSize, smallLastBatch, deepBatchConcat);\n }, size);\n }\n\n /**\n * Concatenates this `Dataset` with another.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]);\n * const b = tf.data.array([4, 5, 6]);\n * const c = a.concatenate(b);\n * await c.forEachAsync(e => console.log(e));\n * ```\n *\n * @param dataset A `Dataset` to be concatenated onto this one.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n concatenate(dataset: Dataset): Dataset {\n const base = this;\n let size;\n if (this.size === Infinity || dataset.size === Infinity) {\n // If the size of any of these two dataset is infinity, new size is\n // infinity.\n size = Infinity;\n } else if (this.size != null && dataset.size != null) {\n // If the size of both datasets are known and not infinity, new size is\n // sum the size of these two datasets.\n size = this.size + dataset.size;\n } else {\n // If neither of these two datasets has infinite size and any of these two\n // datasets' size is null, the new size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () =>\n (await base.iterator()).concatenate(await dataset.iterator()),\n size);\n }\n\n /**\n * Filters this dataset according to `predicate`.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])\n * .filter(x => x%2 === 0);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param predicate A function mapping a dataset element to a boolean or a\n * `Promise` for one.\n *\n * @returns A `Dataset` of elements for which the predicate was true.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n filter(predicate: (value: T) => boolean): Dataset {\n const base = this;\n let size;\n if (this.size === Infinity) {\n // If the size of this dataset is infinity, new size is infinity\n size = Infinity;\n } else {\n // If this dataset has limited elements, new size is null because it might\n // exhausted randomly.\n size = null;\n }\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).filter(x => tf.tidy(() => predicate(x)));\n }, size);\n }\n\n /**\n * Apply a function to every element of the dataset.\n *\n * After the function is applied to a dataset element, any Tensors contained\n * within that element are disposed.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param f A function to apply to each dataset element.\n * @returns A `Promise` that resolves after all elements have been processed.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async forEachAsync(f: (input: T) => void): Promise {\n return (await this.iterator()).forEachAsync(f);\n }\n\n /**\n * Maps this dataset through a 1-to-1 transform.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]).map(x => x*x);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param transform A function mapping a dataset element to a transformed\n * dataset element.\n *\n * @returns A `Dataset` of transformed elements.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n map(transform: (value: T) => O): Dataset {\n const base = this;\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).map(x => tf.tidy(() => transform(x)));\n }, this.size);\n }\n\n /**\n * Maps this dataset through an async 1-to-1 transform.\n *\n * ```js\n * const a =\n * tf.data.array([1, 2, 3]).mapAsync(x => new Promise(function(resolve){\n * setTimeout(() => {\n * resolve(x * x);\n * }, Math.random()*1000 + 500);\n * }));\n * console.log(await a.toArray());\n * ```\n *\n * @param transform A function mapping a dataset element to a `Promise` for a\n * transformed dataset element. This transform is responsible for disposing\n * any intermediate `Tensor`s, i.e. by wrapping its computation in\n * `tf.tidy()`; that cannot be automated here (as it is in the synchronous\n * `map()` case).\n *\n * @returns A `Dataset` of transformed elements.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n mapAsync(transform: (value: T) => Promise):\n Dataset {\n const base = this;\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).mapAsync(transform);\n }, this.size);\n }\n\n /**\n * Creates a `Dataset` that prefetches elements from this dataset.\n *\n * @param bufferSize: An integer specifying the number of elements to be\n * prefetched.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n prefetch(bufferSize: number): Dataset {\n if (bufferSize == null) {\n throw new RangeError(\n '`Dataset.prefetch()` requires bufferSize to be specified.');\n }\n\n const base = this;\n return datasetFromIteratorFn(\n async () => (await base.iterator()).prefetch(bufferSize), this.size);\n }\n\n /**\n * Repeats this dataset `count` times.\n *\n * NOTE: If this dataset is a function of global state (e.g. a random number\n * generator), then different repetitions may produce different elements.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]).repeat(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: (Optional) An integer, representing the number of times\n * the dataset should be repeated. The default behavior (if `count` is\n * `undefined` or negative) is for the dataset be repeated indefinitely.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n repeat(count?: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && count > 0) {\n // If this dataset has size and count is positive, new size is current\n // size multiply count. This also covers the case that current size is\n // infinity.\n size = this.size * count;\n } else if (count === 0) {\n // If count is 0, new size is 0.\n size = 0;\n } else if (this.size != null && (count === undefined || count < 0)) {\n // If this dataset has size and count is undefined or negative, the\n // dataset will be repeated indefinitely and new size is infinity.\n size = Infinity;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(async () => {\n const iteratorIterator = iteratorFromFunction(\n async () => ({value: await base.iterator(), done: false}));\n return iteratorFromConcatenated(iteratorIterator.take(count));\n }, size);\n }\n\n /**\n * Creates a `Dataset` that skips `count` initial elements from this dataset.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).skip(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: The number of elements of this dataset that should be skipped\n * to form the new dataset. If `count` is greater than the size of this\n * dataset, the new dataset will contain no elements. If `count`\n * is `undefined` or negative, skips the entire dataset.\n *\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n skip(count: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && count >= 0 && this.size >= count) {\n // If the size of this dataset is greater than count, the new dataset's\n // size is current size minus skipped size.This also covers the case that\n // current size is infinity.\n size = this.size - count;\n } else if (\n this.size != null &&\n (this.size < count || count === undefined || count < 0)) {\n // If the size of this dataset is smaller than count, or count is\n // undefined or negative, skips the entire dataset and the new size is 0.\n size = 0;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () => (await base.iterator()).skip(count), size);\n }\n\n // TODO(soergel): deep sharded shuffle, where supported\n\n static readonly MAX_BUFFER_SIZE = 10000;\n\n /**\n * Pseudorandomly shuffles the elements of this dataset. This is done in a\n * streaming manner, by sampling from a given number of prefetched elements.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).shuffle(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param bufferSize: An integer specifying the number of elements from this\n * dataset from which the new dataset will sample.\n * @param seed: (Optional) An integer specifying the random seed that will\n * be used to create the distribution.\n * @param reshuffleEachIteration: (Optional) A boolean, which if true\n * indicates that the dataset should be pseudorandomly reshuffled each time\n * it is iterated over. If false, elements will be returned in the same\n * shuffled order on each iteration. (Defaults to `true`.)\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n shuffle(bufferSize: number, seed?: string, reshuffleEachIteration = true):\n Dataset {\n if (bufferSize == null || bufferSize < 0) {\n if (this.size == null) {\n throw new RangeError(\n '`Dataset.shuffle()` requires bufferSize to be specified.');\n } else {\n throw new RangeError(\n '`Dataset.shuffle()` requires bufferSize to be specified. ' +\n 'If your data fits in main memory (for regular JS objects), ' +\n 'and/or GPU memory (for `tf.Tensor`s), consider setting ' +\n `bufferSize to the dataset size (${this.size} elements)`);\n }\n }\n const base = this;\n const random = seedrandom.alea(seed || tf.util.now().toString());\n return datasetFromIteratorFn(async () => {\n let seed2 = random.int32();\n if (reshuffleEachIteration) {\n seed2 += random.int32();\n }\n return (await base.iterator()).shuffle(bufferSize, seed2.toString());\n }, this.size);\n }\n\n /**\n * Creates a `Dataset` with at most `count` initial elements from this\n * dataset.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).take(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: The number of elements of this dataset that should be taken\n * to form the new dataset. If `count` is `undefined` or negative, or if\n * `count` is greater than the size of this dataset, the new dataset will\n * contain all elements of this dataset.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n take(count: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && this.size > count) {\n // If the size of this dataset is greater than count, the new dataset's\n // size is count.\n size = count;\n } else if (this.size != null && this.size <= count) {\n // If the size of this dataset is equal or smaller than count, the new\n // dataset's size is the size of this dataset.\n size = this.size;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () => (await base.iterator()).take(count), size);\n }\n\n /**\n * Collect all elements of this dataset into an array.\n *\n * Obviously this will succeed only for small datasets that fit in memory.\n * Useful for testing and generally should be avoided if possible.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]);\n * console.log(await a.toArray());\n * ```\n *\n * @returns A Promise for an array of elements, which will resolve\n * when a new stream has been obtained and fully consumed.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async toArray() {\n if (this.size === Infinity) {\n throw new Error('Can not convert infinite data stream to array.');\n }\n return (await this.iterator()).toArray();\n }\n\n /**\n * Collect all elements of this dataset into an array with prefetching 100\n * elements. This is useful for testing, because the prefetch changes the\n * order in which the Promises are resolved along the processing pipeline.\n * This may help expose bugs where results are dependent on the order of\n * Promise resolution rather than on the logical order of the stream (i.e.,\n * due to hidden mutable state).\n *\n * @returns A Promise for an array of elements, which will resolve\n * when a new stream has been obtained and fully consumed.\n */\n async toArrayForTest() {\n if (this.size === Infinity) {\n throw new Error('Can not convert infinite data stream to array.');\n }\n return (await this.iterator()).toArrayForTest();\n }\n}\n\n/**\n * Create a `Dataset` defined by a provided iterator() function.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const iter = tf.data.iteratorFromFunction(func);\n * const ds = tf.data.datasetFromIteratorFn(iter);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n */\nexport function datasetFromIteratorFn(\n iteratorFn: () => Promise>,\n size: number = null): Dataset {\n return new class extends Dataset {\n size = size;\n\n /*\n * Provide a new stream of elements. Note this will also start new streams\n * from any underlying `Dataset`s.\n */\n async iterator(): Promise> {\n return iteratorFn();\n }\n }\n ();\n}\n\n/**\n * Create a `Dataset` from an array of elements.\n *\n * Create a Dataset from an array of objects:\n * ```js\n * const a = tf.data.array([{'item': 1}, {'item': 2}, {'item': 3}]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * Create a Dataset from an array of numbers:\n * ```js\n * const a = tf.data.array([4, 5, 6]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n * @param items An array of elements that will be parsed as items in a dataset.\n *\n * @doc {heading: 'Data', subheading: 'Creation', namespace: 'data'}\n */\nexport function array(items: T[]): Dataset {\n return datasetFromIteratorFn(\n async () => iteratorFromItems(items), items.length);\n}\n\n/**\n * Create a `Dataset` by zipping together an array, dict, or nested\n * structure of `Dataset`s (and perhaps additional constants).\n * The underlying datasets must provide elements in a consistent order such that\n * they correspond.\n *\n * The number of elements in the resulting dataset is the same as the size of\n * the smallest dataset in datasets.\n *\n * The nested structure of the `datasets` argument determines the\n * structure of elements in the resulting iterator.\n *\n * Note this means that, given an array of two datasets that produce dict\n * elements, the result is a dataset that produces elements that are arrays\n * of two dicts:\n *\n * Zip an array of datasets:\n * ```js\n * console.log('Zip two datasets of objects:');\n * const ds1 = tf.data.array([{a: 1}, {a: 2}, {a: 3}]);\n * const ds2 = tf.data.array([{b: 4}, {b: 5}, {b: 6}]);\n * const ds3 = tf.data.zip([ds1, ds2]);\n * await ds3.forEachAsync(e => console.log(JSON.stringify(e)));\n *\n * // If the goal is to merge the dicts in order to produce elements like\n * // {a: ..., b: ...}, this requires a second step such as:\n * console.log('Merge the objects:');\n * const ds4 = ds3.map(x => {return {a: x[0].a, b: x[1].b}});\n * await ds4.forEachAsync(e => console.log(e));\n * ```\n *\n * Zip a dict of datasets:\n * ```js\n * const a = tf.data.array([{a: 1}, {a: 2}, {a: 3}]);\n * const b = tf.data.array([{b: 4}, {b: 5}, {b: 6}]);\n * const c = tf.data.zip({c: a, d: b});\n * await c.forEachAsync(e => console.log(JSON.stringify(e)));\n * ```\n *\n * @doc {heading: 'Data', subheading: 'Operations', namespace: 'data'}\n */\nexport function zip(datasets: DatasetContainer):\n Dataset {\n // manually type-check the argument for JS users\n if (!isIterable(datasets)) {\n throw new Error('The argument to zip() must be an object or array.');\n }\n let size;\n if (Array.isArray(datasets)) {\n for (let i = 0; i < datasets.length; i++) {\n size = size == null ? (datasets[i] as Dataset).size :\n Math.min(size, (datasets[i] as Dataset).size);\n }\n } else if (datasets instanceof Object) {\n for (const ds in datasets) {\n size = size == null ? (datasets[ds] as Dataset).size :\n Math.min(size, (datasets[ds] as Dataset).size);\n }\n }\n return datasetFromIteratorFn(async () => {\n const streams = await deepMapAndAwaitAll(datasets, d => {\n if (d instanceof Dataset) {\n return {value: d.iterator(), recurse: false};\n } else if (isIterable(d)) {\n return {value: null, recurse: true};\n } else {\n throw new Error(\n 'Leaves of the structure passed to zip() must be Datasets, ' +\n 'not primitives.');\n }\n });\n return iteratorFromZipped(streams, ZipMismatchMode.SHORTEST);\n }, size);\n}\n\n/**\n * A zip function for use with deepZip, passed via the columnMajorBatch call.\n *\n * Accepts an array of identically-structured nested elements and either batches\n * them (if they are primitives, numeric arrays, or Tensors) or requests\n * recursion (if not).\n */\n// tslint:disable-next-line:no-any\nfunction deepBatchConcat(rows: any[]): DeepMapResult {\n if (rows === null) {\n return null;\n }\n\n // use the first item to decide whether to recurse or batch here.\n const exampleRow = rows[0];\n\n if (canTensorify(exampleRow)) {\n // rows is an array of primitives, Tensors, or arrays. Batch them.\n const value = batchConcat(rows);\n return {value, recurse: false};\n }\n\n // the example row is an object, so recurse into it.\n return {value: null, recurse: true};\n}\n\n/**\n * Assembles a list of same-shaped numbers, number arrays, or Tensors\n * into a single new Tensor where axis 0 is the batch dimension.\n */\nfunction batchConcat(arrays: T[]):\n tf.Tensor {\n if (arrays.length === 0) {\n // We can't return an empty Tensor because we don't know the element shape.\n throw new Error('Can\\'t make a batch of zero elements.');\n }\n\n if (arrays[0] instanceof tf.Tensor) {\n // Input is an array of Tensors\n return tf.stack(arrays as tf.Tensor[]);\n } else {\n // Input is a possibly-nested array of numbers.\n return tf.tensor(arrays as TensorLike);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {Dataset} from '../dataset';\nimport {DataSource} from '../datasource';\nimport {LazyIterator} from '../iterators/lazy_iterator';\n\n/**\n * Represents a potentially large collection of text lines.\n *\n * The results are not batched.\n */\nexport class TextLineDataset extends Dataset {\n /**\n * Create a `TextLineDataset`.\n *\n * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream.\n */\n constructor(protected readonly input: DataSource) {\n super();\n }\n\n async iterator(): Promise> {\n const inputIterator = await this.input.iterator();\n const utf8Iterator = inputIterator.decodeUTF8();\n const lineIterator = utf8Iterator.split('\\n').map(line => {\n // Windows/DOS format text file has extra line breaker at the end of line.\n if (line.endsWith('\\r')) {\n line = line.slice(0, -1);\n }\n return line;\n });\n return lineIterator;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {TensorContainer, util} from '@tensorflow/tfjs-core';\nimport {Dataset} from '../dataset';\nimport {DataSource} from '../datasource';\nimport {LazyIterator} from '../iterators/lazy_iterator';\nimport {ColumnConfig, CSVConfig} from '../types';\nimport {TextLineDataset} from './text_line_dataset';\n\nconst CODE_QUOTE = '\"';\nconst STATE_OUT = Symbol('out');\nconst STATE_FIELD = Symbol('field');\nconst STATE_QUOTE = Symbol('quote');\nconst STATE_QUOTE_AFTER_QUOTE = Symbol('quoteafterquote');\nconst STATE_WITHIN_QUOTE_IN_QUOTE = Symbol('quoteinquote');\n\n/**\n * Represents a potentially large collection of delimited text records.\n *\n * The produced `TensorContainer`s each contain one key-value pair for\n * every column of the table. When a field is empty in the incoming data, the\n * resulting value is `undefined`, or throw error if it is required. Values\n * that can be parsed as numbers are emitted as type `number`, other values\n * are parsed as `string`.\n *\n * The results are not batched.\n *\n * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'}\n */\nexport class CSVDataset extends Dataset {\n base: TextLineDataset;\n private hasHeader = true;\n private fullColumnNames: string[] = null;\n private columnNamesValidated = false;\n private columnConfigs: {[key: string]: ColumnConfig} = null;\n private configuredColumnsOnly = false;\n private delimiter = ',';\n private delimWhitespace = false;\n\n /**\n * Returns column names of the csv dataset. If `configuredColumnsOnly` is\n * true, return column names in `columnConfigs`. If `configuredColumnsOnly` is\n * false and `columnNames` is provided, `columnNames`. If\n * `configuredColumnsOnly` is false and `columnNames` is not provided, return\n * all column names parsed from the csv file. For example usage please go to\n * `tf.data.csv`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async columnNames() {\n if (!this.columnNamesValidated) {\n await this.setColumnNames();\n }\n return this.configuredColumnsOnly ? Object.keys(this.columnConfigs) :\n this.fullColumnNames;\n }\n\n /* 1) If `columnNames` is provided as string[], use this string[] as output\n * keys in corresponding order. The length must match the number of inferred\n * columns if `hasHeader` is true .\n * 2) If `columnNames` is not provided, parse header line as `columnNames` if\n * hasHeader is true. If `hasHeader` is false, throw an error.\n * 3) If `columnConfigs` is provided, all the keys in `columnConfigs` must\n * exist in parsed `columnNames`.\n */\n private async setColumnNames() {\n const columnNamesFromFile = await this.maybeReadHeaderLine();\n if (!this.fullColumnNames && !columnNamesFromFile) {\n // Throw an error if columnNames is not provided and no header line.\n throw new Error(\n 'Column names must be provided if there is no header line.');\n } else if (this.fullColumnNames && columnNamesFromFile) {\n // Check provided columnNames match header line.\n util.assert(\n columnNamesFromFile.length === this.fullColumnNames.length,\n () => 'The length of provided columnNames (' +\n this.fullColumnNames.length.toString() +\n ') does not match the length of the header line read from ' +\n 'file (' + columnNamesFromFile.length.toString() + ').');\n }\n if (!this.fullColumnNames) {\n this.fullColumnNames = columnNamesFromFile;\n }\n // Check if there are duplicate column names.\n const counts: {[key: string]: number} = this.fullColumnNames.reduce(\n (countAcc: {[key: string]: number}, name) => {\n countAcc[name] = (countAcc[name] + 1) || 1;\n return countAcc;\n },\n {});\n const duplicateNames =\n Object.keys(counts).filter((name) => (counts[name] > 1));\n util.assert(\n duplicateNames.length === 0,\n () => 'Duplicate column names found: ' + duplicateNames.toString());\n // Check if keys in columnConfigs match columnNames.\n if (this.columnConfigs) {\n for (const key of Object.keys(this.columnConfigs)) {\n const index = this.fullColumnNames.indexOf(key);\n if (index === -1) {\n throw new Error(\n 'The key \"' + key +\n '\" provided in columnConfigs does not match any of the column ' +\n 'names (' + this.fullColumnNames.toString() + ').');\n }\n }\n }\n this.columnNamesValidated = true;\n }\n\n private async maybeReadHeaderLine() {\n if (this.hasHeader) {\n const iter = await this.base.iterator();\n const firstElement = await iter.next();\n if (firstElement.done) {\n throw new Error('No data was found for CSV parsing.');\n }\n const firstLine: string = firstElement.value;\n const headers = this.parseRow(firstLine, false);\n return headers;\n } else {\n return null;\n }\n }\n\n /**\n * Create a `CSVDataset`.\n *\n * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream.\n * @param csvConfig (Optional) A CSVConfig object that contains configurations\n * of reading and decoding from CSV file(s).\n *\n * hasHeader: (Optional) A boolean value that indicates whether the first\n * row of provided CSV file is a header line with column names, and should\n * not be included in the data. Defaults to `true`.\n *\n * columnNames: (Optional) A list of strings that corresponds to\n * the CSV column names, in order. If provided, it ignores the column\n * names inferred from the header row. If not provided, infers the column\n * names from the first row of the records. If hasHeader is false and\n * columnNames is not provided, this method throws an error.\n *\n * columnConfigs: (Optional) A dictionary whose key is column names, value\n * is an object stating if this column is required, column's data type,\n * default value, and if this column is label. If provided, keys must\n * correspond to names provided in columnNames or inferred from the file\n * header lines. If isLabel is true any column, returns an array of two\n * items: the first item is a dict of features key/value pairs, the second\n * item is a dict of labels key/value pairs. If no feature is marked as\n * label, returns a dict of features only.\n *\n * configuredColumnsOnly (Optional) If true, only columns provided in\n * columnConfigs will be parsed and provided during iteration.\n *\n * delimiter (Optional) The string used to parse each line of the input\n * file. Defaults to `,`.\n */\n constructor(protected readonly input: DataSource, csvConfig?: CSVConfig) {\n super();\n this.base = new TextLineDataset(input);\n if (!csvConfig) {\n csvConfig = {};\n }\n this.hasHeader = csvConfig.hasHeader === false ? false : true;\n this.fullColumnNames = csvConfig.columnNames;\n this.columnConfigs = csvConfig.columnConfigs;\n this.configuredColumnsOnly = csvConfig.configuredColumnsOnly;\n if (csvConfig.delimWhitespace) {\n util.assert(\n csvConfig.delimiter == null,\n () =>\n 'Delimiter should not be provided when delimWhitespace is true.');\n this.delimWhitespace = true;\n this.delimiter = ' ';\n } else {\n this.delimiter = csvConfig.delimiter ? csvConfig.delimiter : ',';\n }\n }\n\n async iterator(): Promise> {\n if (!this.columnNamesValidated) {\n await this.setColumnNames();\n }\n let lines = await this.base.iterator();\n if (this.hasHeader) {\n // We previously read the first line to get the columnNames.\n // Now that we're providing data, skip it.\n lines = lines.skip(1);\n }\n return lines.map(x => this.makeDataElement(x));\n }\n\n makeDataElement(line: string): TensorContainer {\n const values = this.parseRow(line);\n const features: {[key: string]: TensorContainer} = {};\n const labels: {[key: string]: TensorContainer} = {};\n\n for (let i = 0; i < this.fullColumnNames.length; i++) {\n const key = this.fullColumnNames[i];\n const config = this.columnConfigs ? this.columnConfigs[key] : null;\n if (this.configuredColumnsOnly && !config) {\n // This column is not selected.\n continue;\n } else {\n const value = values[i];\n let parsedValue = null;\n if (value === '') {\n // If default value is provided, use it. If default value is not\n // provided, set as undefined.\n if (config && config.default !== undefined) {\n parsedValue = config.default;\n } else if (config && (config.required || config.isLabel)) {\n throw new Error(\n `Required column ${key} is empty in this line: ${line}`);\n } else {\n parsedValue = undefined;\n }\n } else {\n // A value is present, so parse it based on type\n const valueAsNum = Number(value);\n if (isNaN(valueAsNum)) {\n // The value is a string and this column is declared as boolean\n // in config, parse it as boolean.\n if (config && config.dtype === 'bool') {\n parsedValue = this.getBoolean(value);\n } else {\n // Set value as string\n parsedValue = value;\n }\n } else if (!config || !config.dtype) {\n // If this value is a number and no type config is provided, return\n // it as number.\n parsedValue = valueAsNum;\n } else {\n // If this value is a number and data type is provided, parse it\n // according to provided data type.\n switch (config.dtype) {\n case 'float32':\n parsedValue = valueAsNum;\n break;\n case 'int32':\n parsedValue = Math.floor(valueAsNum);\n break;\n case 'bool':\n parsedValue = this.getBoolean(value);\n break;\n default:\n parsedValue = valueAsNum;\n }\n }\n }\n // Check if this column is label.\n (config && config.isLabel) ? labels[key] = parsedValue :\n features[key] = parsedValue;\n }\n }\n // If label exists, return an object of features and labels as {xs:features,\n // ys:labels}, otherwise return features only.\n if (Object.keys(labels).length === 0) {\n return features;\n\n } else {\n return {xs: features, ys: labels};\n }\n }\n\n private getBoolean(value: string): number {\n if (value === '1' || value.toLowerCase() === 'true') {\n return 1;\n } else {\n return 0;\n }\n }\n\n // adapted from https://beta.observablehq.com/@mbostock/streaming-csv\n private parseRow(line: string, validateElementCount = true): string[] {\n const result: string[] = [];\n let readOffset = 0;\n const readLength = line.length;\n let currentState = STATE_OUT;\n // Goes through the line to parse quote.\n for (let i = 0; i < readLength; i++) {\n switch (currentState) {\n // Before enter a new field\n case STATE_OUT:\n switch (line.charAt(i)) {\n // Enter a quoted field\n case CODE_QUOTE:\n readOffset = i + 1;\n currentState = STATE_QUOTE;\n break;\n // Read an empty field\n case this.delimiter:\n readOffset = i + 1;\n // If delimiter is white space and configured to collapse\n // multiple white spaces, ignore this white space.\n if (this.delimiter === ' ' && this.delimWhitespace) {\n break;\n }\n result.push('');\n currentState = STATE_OUT;\n break;\n // Enter an unquoted field\n default:\n currentState = STATE_FIELD;\n readOffset = i;\n break;\n }\n break;\n // In an unquoted field\n case STATE_FIELD:\n switch (line.charAt(i)) {\n // Exit an unquoted field, add it to result\n case this.delimiter:\n result.push(line.substring(readOffset, i));\n currentState = STATE_OUT;\n readOffset = i + 1;\n break;\n default:\n }\n break;\n // In a quoted field\n case STATE_QUOTE:\n switch (line.charAt(i)) {\n // Read a quote after a quote\n case CODE_QUOTE:\n currentState = STATE_QUOTE_AFTER_QUOTE;\n break;\n default:\n }\n break;\n // This state means it's right after a second quote in a field\n case STATE_QUOTE_AFTER_QUOTE:\n switch (line.charAt(i)) {\n // Finished a quoted field\n case this.delimiter:\n result.push(line.substring(readOffset, i - 1));\n currentState = STATE_OUT;\n readOffset = i + 1;\n break;\n // Finished a quoted part in a quoted field\n case CODE_QUOTE:\n currentState = STATE_QUOTE;\n break;\n // In a quoted part in a quoted field\n default:\n currentState = STATE_WITHIN_QUOTE_IN_QUOTE;\n break;\n }\n break;\n case STATE_WITHIN_QUOTE_IN_QUOTE:\n switch (line.charAt(i)) {\n // Exit a quoted part in a quoted field\n case CODE_QUOTE:\n currentState = STATE_QUOTE;\n break;\n default:\n }\n break;\n default:\n }\n }\n // Adds last item based on if it is quoted.\n if (currentState === STATE_QUOTE_AFTER_QUOTE) {\n result.push(line.substring(readOffset, readLength - 1));\n } else {\n result.push(line.substring(readOffset));\n }\n // Check if each row has the same number of elements as column names.\n if (validateElementCount && result.length !== this.fullColumnNames.length) {\n throw new Error(`Invalid row in csv file. Should have ${\n this.fullColumnNames.length} elements in a row, but got ${result}`);\n }\n return result;\n }\n}\n\n// TODO(soergel): add more basic datasets for parity with tf.data\n// tf.data.FixedLengthRecordDataset()\n// tf.data.TFRecordDataset()\n","/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {env, Tensor, tensor, Tensor2D, Tensor3D, TensorContainer, util} from '@tensorflow/tfjs-core';\nimport {MicrophoneConfig} from '../types';\nimport {LazyIterator} from './lazy_iterator';\n\n/**\n * Provide a stream of tensors from microphone audio stream. The tensors are\n * representing audio data as frequency-domain spectrogram generated with\n * browser's native FFT. Tensors representing time-domain waveform is available\n * based on configuration. Only works in browser environment.\n */\nexport class MicrophoneIterator extends LazyIterator {\n private isClosed = false;\n private stream: MediaStream;\n private readonly fftSize: number;\n private readonly columnTruncateLength: number;\n private freqData: Float32Array;\n private timeData: Float32Array;\n private readonly numFrames: number;\n private analyser: AnalyserNode;\n private audioContext: AudioContext;\n private sampleRateHz: number;\n private readonly audioTrackConstraints: MediaTrackConstraints;\n private readonly smoothingTimeConstant: number;\n private readonly includeSpectrogram: boolean;\n private readonly includeWaveform: boolean;\n\n private constructor(protected readonly microphoneConfig: MicrophoneConfig) {\n super();\n this.fftSize = microphoneConfig.fftSize || 1024;\n const fftSizeLog2 = Math.log2(this.fftSize);\n if (this.fftSize < 0 || fftSizeLog2 < 4 || fftSizeLog2 > 14 ||\n !Number.isInteger(fftSizeLog2)) {\n throw new Error(\n `Invalid fftSize: it must be a power of 2 between ` +\n `2 to 4 and 2 to 14, but got ${this.fftSize}`);\n }\n\n this.numFrames = microphoneConfig.numFramesPerSpectrogram || 43;\n this.sampleRateHz = microphoneConfig.sampleRateHz;\n this.columnTruncateLength =\n microphoneConfig.columnTruncateLength || this.fftSize;\n this.audioTrackConstraints = microphoneConfig.audioTrackConstraints;\n this.smoothingTimeConstant = microphoneConfig.smoothingTimeConstant || 0;\n\n this.includeSpectrogram =\n microphoneConfig.includeSpectrogram === false ? false : true;\n this.includeWaveform =\n microphoneConfig.includeWaveform === true ? true : false;\n if (!this.includeSpectrogram && !this.includeWaveform) {\n throw new Error(\n 'Both includeSpectrogram and includeWaveform are false. ' +\n 'At least one type of data should be returned.');\n }\n }\n\n summary() {\n return `microphone`;\n }\n\n // Construct a MicrophoneIterator and start the audio stream.\n static async create(microphoneConfig: MicrophoneConfig = {}) {\n if (env().get('IS_NODE')) {\n throw new Error(\n 'microphone API is only supported in browser environment.');\n }\n\n const microphoneIterator = new MicrophoneIterator(microphoneConfig);\n\n // Call async function start() to initialize the audio stream.\n await microphoneIterator.start();\n\n return microphoneIterator;\n }\n\n // Start the audio stream and FFT.\n async start(): Promise {\n try {\n this.stream = await navigator.mediaDevices.getUserMedia({\n audio: this.audioTrackConstraints == null ? true :\n this.audioTrackConstraints,\n video: false\n });\n } catch (e) {\n throw new Error(\n `Error thrown while initializing video stream: ${e.message}`);\n }\n\n if (!this.stream) {\n throw new Error('Could not obtain audio from microphone.');\n }\n\n const ctxConstructor =\n // tslint:disable-next-line:no-any\n (window as any).AudioContext || (window as any).webkitAudioContext;\n this.audioContext = new ctxConstructor();\n\n if (!this.sampleRateHz) {\n // If sample rate is not provided, use the available sample rate on\n // device.\n this.sampleRateHz = this.audioContext.sampleRate;\n } else if (this.audioContext.sampleRate !== this.sampleRateHz) {\n throw new Error(\n `Mismatch in sampling rate: ` +\n `Expected: ${this.sampleRateHz}; ` +\n `Actual: ${this.audioContext.sampleRate}`);\n }\n\n const streamSource = this.audioContext.createMediaStreamSource(this.stream);\n this.analyser = this.audioContext.createAnalyser();\n this.analyser.fftSize = this.fftSize * 2;\n this.analyser.smoothingTimeConstant = this.smoothingTimeConstant;\n streamSource.connect(this.analyser);\n this.freqData = new Float32Array(this.fftSize);\n this.timeData = new Float32Array(this.fftSize);\n return;\n }\n\n async next(): Promise> {\n if (this.isClosed) {\n return {value: null, done: true};\n }\n\n let spectrogramTensor: Tensor;\n let waveformTensor: Tensor;\n\n const audioDataQueue = await this.getAudioData();\n if (this.includeSpectrogram) {\n const freqData = this.flattenQueue(audioDataQueue.freqDataQueue);\n spectrogramTensor = this.getTensorFromAudioDataArray(\n freqData, [this.numFrames, this.columnTruncateLength, 1]);\n }\n if (this.includeWaveform) {\n const timeData = this.flattenQueue(audioDataQueue.timeDataQueue);\n waveformTensor = this.getTensorFromAudioDataArray(\n timeData, [this.numFrames * this.fftSize, 1]);\n }\n\n return {\n value: {'spectrogram': spectrogramTensor, 'waveform': waveformTensor},\n done: false\n };\n }\n\n // Capture one result from the audio stream, and extract the value from\n // iterator.next() result.\n async capture(): Promise<{spectrogram: Tensor3D, waveform: Tensor2D}> {\n return (await this.next()).value as\n {spectrogram: Tensor3D, waveform: Tensor2D};\n }\n\n private async getAudioData():\n Promise<{freqDataQueue: Float32Array[], timeDataQueue: Float32Array[]}> {\n const freqDataQueue: Float32Array[] = [];\n const timeDataQueue: Float32Array[] = [];\n let currentFrames = 0;\n return new Promise(resolve => {\n const intervalID = setInterval(() => {\n if (this.includeSpectrogram) {\n this.analyser.getFloatFrequencyData(this.freqData);\n // If the audio stream is initializing, return empty queue.\n if (this.freqData[0] === -Infinity) {\n resolve({freqDataQueue, timeDataQueue});\n }\n freqDataQueue.push(this.freqData.slice(0, this.columnTruncateLength));\n }\n if (this.includeWaveform) {\n this.analyser.getFloatTimeDomainData(this.timeData);\n timeDataQueue.push(this.timeData.slice());\n }\n\n // Clean interval and return when all frames have been collected\n if (++currentFrames === this.numFrames) {\n clearInterval(intervalID);\n resolve({freqDataQueue, timeDataQueue});\n }\n }, this.fftSize / this.sampleRateHz * 1e3);\n });\n }\n\n // Stop the audio stream and pause the iterator.\n stop(): void {\n if (!this.isClosed) {\n this.isClosed = true;\n this.analyser.disconnect();\n this.audioContext.close();\n if (this.stream != null && this.stream.getTracks().length > 0) {\n this.stream.getTracks()[0].stop();\n }\n }\n }\n\n // Override toArray() function to prevent collecting.\n toArray(): Promise {\n throw new Error('Can not convert infinite audio stream to array.');\n }\n\n // Return audio sampling rate in Hz\n getSampleRate(): number {\n return this.sampleRateHz;\n }\n\n private flattenQueue(queue: Float32Array[]): Float32Array {\n const frameSize = queue[0].length;\n const freqData = new Float32Array(queue.length * frameSize);\n queue.forEach((data, i) => freqData.set(data, i * frameSize));\n return freqData;\n }\n\n private getTensorFromAudioDataArray(freqData: Float32Array, shape: number[]):\n Tensor {\n const vals = new Float32Array(util.sizeFromShape(shape));\n // If the data is less than the output shape, the rest is padded with zeros.\n vals.set(freqData, vals.length - freqData.length);\n return tensor(vals, shape);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {browser, cast, env, expandDims, image, reshape, tensor1d, Tensor1D, tensor2d, Tensor2D, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs-core';\nimport {WebcamConfig} from '../types';\nimport {LazyIterator} from './lazy_iterator';\n\n/**\n * Provide a stream of image tensors from webcam video stream. Only works in\n * browser environment.\n */\nexport class WebcamIterator extends LazyIterator {\n private isClosed = true;\n private stream: MediaStream;\n private resize = false;\n private cropSize: [number, number];\n private cropBox: Tensor2D;\n private cropBoxInd: Tensor1D;\n\n private constructor(\n protected readonly webcamVideoElement: HTMLVideoElement,\n protected readonly webcamConfig: WebcamConfig) {\n super();\n if (this.needToResize()) {\n this.resize = true;\n this.cropSize =\n [this.webcamConfig.resizeHeight, this.webcamConfig.resizeWidth];\n this.cropBoxInd = tensor1d([0], 'int32');\n if (this.webcamConfig.centerCrop) {\n // Calculate the box based on resizing shape.\n const widthCroppingRatio =\n this.webcamConfig.resizeWidth * 1.0 / this.webcamVideoElement.width;\n const heightCroppingRatio = this.webcamConfig.resizeHeight * 1.0 /\n this.webcamVideoElement.height;\n const widthCropStart = (1 - widthCroppingRatio) / 2;\n const heightCropStart = (1 - heightCroppingRatio) / 2;\n const widthCropEnd = widthCropStart + widthCroppingRatio;\n const heightCropEnd = heightCroppingRatio + heightCropStart;\n this.cropBox = tensor2d(\n [heightCropStart, widthCropStart, heightCropEnd, widthCropEnd],\n [1, 4]);\n } else {\n this.cropBox = tensor2d([0, 0, 1, 1], [1, 4]);\n }\n }\n }\n\n summary() {\n return `webcam`;\n }\n\n // Construct a WebcamIterator and start it's video stream.\n static async create(\n webcamVideoElement?: HTMLVideoElement, webcamConfig: WebcamConfig = {}) {\n if (env().get('IS_NODE')) {\n throw new Error(\n 'tf.data.webcam is only supported in browser environment.');\n }\n\n if (!webcamVideoElement) {\n // If webcam video element is not provided, create a hidden video element\n // with provided width and height.\n webcamVideoElement = document.createElement('video');\n if (!webcamConfig.resizeWidth || !webcamConfig.resizeHeight) {\n throw new Error(\n 'Please provide webcam video element, or resizeWidth and ' +\n 'resizeHeight to create a hidden video element.');\n }\n webcamVideoElement.width = webcamConfig.resizeWidth;\n webcamVideoElement.height = webcamConfig.resizeHeight;\n }\n const webcamIterator = new WebcamIterator(webcamVideoElement, webcamConfig);\n\n // Call async function to initialize the video stream.\n await webcamIterator.start();\n\n return webcamIterator;\n }\n\n // Async function to start video stream.\n async start(): Promise {\n if (this.webcamConfig.facingMode) {\n util.assert(\n (this.webcamConfig.facingMode === 'user') ||\n (this.webcamConfig.facingMode === 'environment'),\n () =>\n `Invalid webcam facing mode: ${this.webcamConfig.facingMode}. ` +\n `Please provide 'user' or 'environment'`);\n }\n\n try {\n this.stream = await navigator.mediaDevices.getUserMedia({\n video: {\n deviceId: this.webcamConfig.deviceId,\n facingMode: this.webcamConfig.facingMode ?\n this.webcamConfig.facingMode :\n 'user',\n width: this.webcamVideoElement.width,\n height: this.webcamVideoElement.height\n }\n });\n } catch (e) {\n // Modify the error message but leave the stack trace intact\n e.message = `Error thrown while initializing video stream: ${e.message}`;\n throw e;\n }\n\n if (!this.stream) {\n throw new Error('Could not obtain video from webcam.');\n }\n\n // Older browsers may not have srcObject\n try {\n this.webcamVideoElement.srcObject = this.stream;\n } catch (error) {\n console.log(error);\n this.webcamVideoElement.src = window.URL.createObjectURL(this.stream);\n }\n // Start the webcam video stream\n this.webcamVideoElement.play();\n\n this.isClosed = false;\n\n return new Promise(resolve => {\n // Add event listener to make sure the webcam has been fully initialized.\n this.webcamVideoElement.onloadedmetadata = () => {\n resolve();\n };\n });\n }\n\n async next(): Promise> {\n if (this.isClosed) {\n return {value: null, done: true};\n }\n\n let img;\n try {\n img = browser.fromPixels(this.webcamVideoElement);\n } catch (e) {\n throw new Error(\n `Error thrown converting video to pixels: ${JSON.stringify(e)}`);\n }\n if (this.resize) {\n try {\n return {value: this.cropAndResizeFrame(img), done: false};\n } catch (e) {\n throw new Error(`Error thrown cropping the video: ${e.message}`);\n } finally {\n img.dispose();\n }\n } else {\n return {value: img, done: false};\n }\n }\n\n private needToResize() {\n // If resizeWidth and resizeHeight are provided, and different from the\n // width and height of original HTMLVideoElement, then resizing and cropping\n // is required.\n if (this.webcamConfig.resizeWidth && this.webcamConfig.resizeHeight &&\n (this.webcamVideoElement.width !== this.webcamConfig.resizeWidth ||\n this.webcamVideoElement.height !== this.webcamConfig.resizeHeight)) {\n return true;\n }\n return false;\n }\n\n // Cropping and resizing each frame based on config\n cropAndResizeFrame(img: Tensor3D): Tensor3D {\n return tidy(() => {\n const expandedImage: Tensor4D = expandDims(cast(img, 'float32'), (0));\n let resizedImage;\n resizedImage = image.cropAndResize(\n expandedImage, this.cropBox, this.cropBoxInd, this.cropSize,\n 'bilinear');\n // Extract image from batch cropping.\n const shape = resizedImage.shape;\n return reshape(resizedImage, shape.slice(1) as [number, number, number]);\n });\n }\n\n // Capture one frame from the video stream, and extract the value from\n // iterator.next() result.\n async capture(): Promise {\n return (await this.next()).value;\n }\n\n // Stop the video stream and pause webcam iterator.\n stop(): void {\n const tracks = this.stream.getTracks();\n\n tracks.forEach(track => track.stop());\n\n try {\n this.webcamVideoElement.srcObject = null;\n } catch (error) {\n console.log(error);\n this.webcamVideoElement.src = null;\n }\n this.isClosed = true;\n }\n\n // Override toArray() function to prevent collecting.\n toArray(): Promise {\n throw new Error('Can not convert infinite video stream to array.');\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {ByteChunkIterator} from './iterators/byte_chunk_iterator';\n\n/**\n * Represents a data source readable as a stream of binary data chunks.\n *\n * Because `Dataset`s can be read repeatedly (via `Dataset.iterator()`), this\n * provides a means to repeatedly create streams from the underlying data\n * sources.\n */\nexport abstract class DataSource {\n /**\n * Obtain a new stream of binary data chunks.\n *\n * Starts the new stream from the beginning of the data source, even if other\n * streams have been obtained previously.\n */\n abstract async iterator(): Promise;\n\n // TODO(soergel): consider chainable Dataset construction here\n}\n\n// TODO(soergel): consider convenience factory functions here\n// in combination with chainable source->dataset above, e.g.:\n// tf.data.url(...).asCsvDataset().shuffle().batch()\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {LazyIterator, OneToManyIterator} from './lazy_iterator';\n\nexport abstract class StringIterator extends LazyIterator {\n /**\n * Splits a string stream on a given separator.\n *\n * It is assumed that the incoming chunk boundaries have no semantic meaning,\n * so conceptually the incoming stream is treated simply as the concatenation\n * of its elements.\n *\n * The outgoing stream provides chunks corresponding to the results of the\n * standard string split() operation (even if such a chunk spanned incoming\n * chunks). The separators are not included.\n *\n * A typical usage is to split a text file (represented as a stream with\n * arbitrary chunk boundaries) into lines.\n *\n * @param upstream A readable stream of strings that can be treated as\n * concatenated.\n * @param separator A character to split on.\n */\n split(separator: string): StringIterator {\n return new SplitIterator(this, separator);\n }\n}\n\n// ============================================================================\n// The following private classes serve to implement the chainable methods\n// on StringIterator. Unfortunately they can't be placed in separate files, due\n// to resulting trouble with circular imports.\n// ============================================================================\n\n// We wanted multiple inheritance, e.g.\n// class SplitIterator extends QueueIterator, StringIterator\n// but the TypeScript mixin approach is a bit hacky, so we take this adapter\n// approach instead.\n\nclass SplitIterator extends StringIterator {\n private impl: SplitIteratorImpl;\n\n constructor(protected upstream: LazyIterator, separator: string) {\n super();\n this.impl = new SplitIteratorImpl(upstream, separator);\n }\n\n summary() {\n return this.impl.summary();\n }\n\n async next() {\n return this.impl.next();\n }\n}\n\nclass SplitIteratorImpl extends OneToManyIterator {\n // A partial string at the end of an upstream chunk\n carryover = '';\n\n constructor(\n protected upstream: LazyIterator, protected separator: string) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Split('${this.separator}')`;\n }\n\n async pump(): Promise {\n const chunkResult = await this.upstream.next();\n if (chunkResult.done) {\n if (this.carryover === '') {\n return false;\n }\n\n // Pretend that the pump succeeded in order to emit the small last batch.\n // The next pump() call will actually fail.\n this.outputQueue.push(this.carryover);\n this.carryover = '';\n return true;\n }\n const lines = chunkResult.value.split(this.separator);\n // Note the behavior: \" ab \".split(' ') === ['', 'ab', '']\n // Thus the carryover may be '' if the separator falls on a chunk\n // boundary; this produces the correct result.\n\n lines[0] = this.carryover + lines[0];\n for (const line of lines.slice(0, -1)) {\n this.outputQueue.push(line);\n }\n this.carryover = lines[lines.length - 1];\n\n return true;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {env} from '@tensorflow/tfjs-core';\nimport {LazyIterator, OneToManyIterator} from './lazy_iterator';\nimport {StringIterator} from './string_iterator';\n\nexport abstract class ByteChunkIterator extends LazyIterator {\n /**\n * Decode a stream of UTF8-encoded byte arrays to a stream of strings.\n *\n * The byte arrays producetd from the ByteChunkIterator on which this is\n * called will be interpreted as concatenated. No assumptions are made about\n * the boundaries of the incoming chunks, so a multi-byte UTF8 encoding of a\n * character may span the boundary between chunks. This naturally happens,\n * for instance, when reading fixed-size byte arrays from a file.\n */\n decodeUTF8(): StringIterator {\n return new Utf8Iterator(this);\n }\n}\n\n// ============================================================================\n// The following private classes serve to implement the chainable methods\n// on ByteChunkIterator. Unfortunately they can't be placed in separate files,\n// due to resulting trouble with circular imports.\n// ============================================================================\n\n// We wanted multiple inheritance, e.g.\n// class Utf8Iterator extends QueueIterator, StringIterator\n// but the TypeScript mixin approach is a bit hacky, so we take this adapter\n// approach instead.\n\nclass Utf8Iterator extends StringIterator {\n private impl: Utf8IteratorImpl;\n\n constructor(protected upstream: LazyIterator) {\n super();\n this.impl = new Utf8IteratorImpl(upstream);\n }\n\n summary() {\n return this.impl.summary();\n }\n\n async next() {\n return this.impl.next();\n }\n}\n\n/**\n * Decode a stream of UTF8-encoded byte arrays to a stream of strings.\n *\n * This is tricky because the incoming byte array boundaries may disrupt a\n * multi-byte UTF8 character. Thus any incomplete character data at the end of\n * a chunk must be carried over and prepended to the next chunk before\n * decoding. Luckily with native decoder, TextDecoder in browser and\n * string_decoder in node, byte array boundaries are handled automatically.\n *\n * In the context of an input pipeline for machine learning, UTF8 decoding is\n * needed to parse text files containing training examples or prediction\n * requests (e.g., formatted as CSV or JSON). We cannot use the built-in\n * decoding provided by FileReader.readAsText() because here we are in a\n * streaming context, which FileReader does not support.\n *\n * @param upstream A `LazyIterator` of `Uint8Arrays` containing UTF8-encoded\n * text, which should be interpreted as concatenated. No assumptions are\n * made about the boundaries of the incoming chunks, so a multi-byte UTF8\n * encoding of a character may span the boundary between chunks. This\n * naturally happens, for instance, when reading fixed-size byte arrays from a\n * file.\n */\nclass Utf8IteratorImpl extends OneToManyIterator {\n // `decoder` as `any` here to dynamically assign value based on the\n // environment.\n // tslint:disable-next-line:no-any\n decoder: any;\n\n constructor(protected readonly upstream: LazyIterator) {\n super();\n if (env().get('IS_BROWSER')) {\n this.decoder = new TextDecoder('utf-8');\n } else {\n // tslint:disable-next-line:no-require-imports\n const {StringDecoder} = require('string_decoder');\n this.decoder = new StringDecoder('utf8');\n }\n }\n summary() {\n return `${this.upstream.summary()} -> Utf8`;\n }\n\n async pump(): Promise {\n const chunkResult = await this.upstream.next();\n let chunk;\n if (chunkResult.done) {\n return false;\n } else {\n chunk = chunkResult.value;\n }\n\n let text: string;\n if (env().get('IS_BROWSER')) {\n text = this.decoder.decode(chunk, {stream: true});\n } else {\n text = this.decoder.write(Buffer.from(chunk.buffer));\n }\n this.outputQueue.push(text);\n return true;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\n// inspired by https://github.com/maxogden/filereader-stream\nimport {env, util} from '@tensorflow/tfjs-core';\nimport {FileElement} from '../types';\nimport {ByteChunkIterator} from './byte_chunk_iterator';\n\nexport interface FileChunkIteratorOptions {\n /** The byte offset at which to begin reading the File or Blob. Default 0. */\n offset?: number;\n /** The number of bytes to read at a time. Default 1MB. */\n chunkSize?: number;\n}\n\n/**\n * Provide a stream of chunks from a File, Blob, or Uint8Array.\n * @param file The source File, Blob or Uint8Array.\n * @param options Optional settings controlling file reading.\n * @returns a lazy Iterator of Uint8Arrays containing sequential chunks of the\n * input File, Blob or Uint8Array.\n */\nexport class FileChunkIterator extends ByteChunkIterator {\n offset: number;\n chunkSize: number;\n\n constructor(\n protected file: FileElement,\n protected options: FileChunkIteratorOptions = {}) {\n super();\n util.assert(\n (file instanceof Uint8Array) ||\n (env().get('IS_BROWSER') ?\n (file instanceof File || file instanceof Blob) :\n false),\n () => 'FileChunkIterator only supports File, Blob and Uint8Array ' +\n 'right now.');\n this.offset = options.offset || 0;\n // default 1MB chunk has tolerable perf on large files\n this.chunkSize = options.chunkSize || 1024 * 1024;\n }\n\n summary() {\n return `FileChunks ${this.file}`;\n }\n\n async next(): Promise> {\n if (this.offset >= ((this.file instanceof Uint8Array) ?\n this.file.byteLength :\n this.file.size)) {\n return {value: null, done: true};\n }\n const chunk = new Promise((resolve, reject) => {\n const end = this.offset + this.chunkSize;\n if (this.file instanceof Uint8Array) {\n // Note if end > this.uint8Array.byteLength, we just get a small last\n // chunk.\n resolve(new Uint8Array(this.file.slice(this.offset, end)));\n } else {\n // This branch assumes that this.file type is File or Blob, which\n // means it is in the browser environment.\n\n // TODO(soergel): is this a performance issue?\n const fileReader = new FileReader();\n fileReader.onload = (event) => {\n let data: string|ArrayBuffer|Uint8Array = fileReader.result;\n // Not sure we can trust the return type of\n // FileReader.readAsArrayBuffer See e.g.\n // https://github.com/node-file-api/FileReader/issues/2\n if (data instanceof ArrayBuffer) {\n data = new Uint8Array(data);\n }\n if (!(data instanceof Uint8Array)) {\n return reject(new TypeError('FileReader returned unknown type.'));\n }\n resolve(data);\n };\n fileReader.onabort = (event) => {\n return reject(new Error('Aborted'));\n };\n fileReader.onerror = (event) => {\n return reject(new Error(event.type));\n };\n // TODO(soergel): better handle onabort, onerror\n // Note if end > this.file.size, we just get a small last chunk.\n const slice = this.file.slice(this.offset, end);\n // We can't use readAsText here (even if we know the file is text)\n // because the slice boundary may fall within a multi-byte character.\n fileReader.readAsArrayBuffer(slice);\n }\n this.offset = end;\n });\n return {value: (await chunk), done: false};\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {util} from '@tensorflow/tfjs-core';\nimport {FileChunkIterator, FileChunkIteratorOptions} from './file_chunk_iterator';\n\n/**\n * Provide a stream of chunks from a URL.\n *\n * Note this class first downloads the entire file into memory before providing\n * the first element from the stream. This is because the Fetch API does not\n * yet reliably provide a reader stream for the response body.\n */\nexport async function urlChunkIterator(\n url: RequestInfo, options: FileChunkIteratorOptions = {}) {\n let urlString;\n let requestInit;\n if ((typeof url) === 'string') {\n urlString = url as string;\n } else {\n urlString = (url as Request).url;\n requestInit = getRequestInitFromRequest(url as Request);\n }\n const response = await util.fetch(urlString, requestInit);\n if (response.ok) {\n const uint8Array = new Uint8Array(await response.arrayBuffer());\n return new FileChunkIterator(uint8Array, options);\n } else {\n throw new Error(response.statusText);\n }\n}\n\n// Generate RequestInit from Request to match tf.util.fetch signature.\nconst getRequestInitFromRequest = (request: Request) => {\n const init = {\n method: request.method,\n headers: request.headers,\n body: request.body,\n mode: request.mode,\n credentials: request.credentials,\n cache: request.cache,\n redirect: request.redirect,\n referrer: request.referrer,\n integrity: request.integrity,\n };\n return init;\n};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\n// Skip tslint any type check cause this method is aiming to check type of\n// input.\n// tslint:disable-next-line:no-any\nexport function isLocalPath(source: any): boolean {\n return (typeof source === 'string') && source.substr(0, 7) === 'file://';\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {env} from '@tensorflow/tfjs-core';\nimport {DataSource} from '../datasource';\nimport {ByteChunkIterator} from '../iterators/byte_chunk_iterator';\nimport {FileChunkIterator, FileChunkIteratorOptions} from '../iterators/file_chunk_iterator';\nimport {FileElement} from '../types';\nimport {isLocalPath} from '../util/source_util';\n\n/**\n * Represents a file, blob, or Uint8Array readable as a stream of binary data\n * chunks.\n */\nexport class FileDataSource extends DataSource {\n /**\n * Create a `FileDataSource`.\n *\n * @param input Local file path, or `File`/`Blob`/`Uint8Array` object to\n * read. Local file only works in node environment.\n * @param options Options passed to the underlying `FileChunkIterator`s,\n * such as {chunksize: 1024}.\n */\n constructor(\n protected input: FileElement|string,\n protected readonly options: FileChunkIteratorOptions = {}) {\n super();\n }\n\n async iterator(): Promise {\n if (isLocalPath(this.input) && env().get('IS_NODE')) {\n // tslint:disable-next-line:no-require-imports\n const fs = require('fs');\n this.input = fs.readFileSync((this.input as string).substr(7));\n }\n // TODO(kangyizhang): Add LocalFileChunkIterator to split local streaming\n // with file in browser.\n return new FileChunkIterator(this.input as FileElement, this.options);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {DataSource} from '../datasource';\nimport {ByteChunkIterator} from '../iterators/byte_chunk_iterator';\nimport {FileChunkIteratorOptions} from '../iterators/file_chunk_iterator';\nimport {urlChunkIterator} from '../iterators/url_chunk_iterator';\nimport {isLocalPath} from '../util/source_util';\nimport {FileDataSource} from './file_data_source';\n\n/*\n * Represents a URL readable as a stream of binary data chunks.\n */\nexport class URLDataSource extends DataSource {\n /**\n * Create a `URLDataSource`.\n *\n * @param url A source URL string, or a `Request` object.\n * @param options Options passed to the underlying `FileChunkIterator`s,\n * such as {chunksize: 1024}.\n */\n constructor(\n protected readonly url: RequestInfo,\n protected readonly fileOptions: FileChunkIteratorOptions = {}) {\n super();\n }\n\n // TODO(soergel): provide appropriate caching options. Currently this\n // will download the URL anew for each call to iterator(). Since we have\n // to treat the downloaded file as a blob/buffer anyway, we may as well retain\n // it-- but that raises GC issues. Also we may want a persistent disk cache.\n async iterator(): Promise {\n if (isLocalPath(this.url)) {\n return (new FileDataSource(this.url as string, this.fileOptions))\n .iterator();\n } else {\n return urlChunkIterator(this.url, this.fileOptions);\n }\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {TensorContainer} from '@tensorflow/tfjs-core';\nimport {Dataset, datasetFromIteratorFn} from './dataset';\nimport {CSVDataset} from './datasets/csv_dataset';\nimport {iteratorFromFunction} from './iterators/lazy_iterator';\nimport {MicrophoneIterator} from './iterators/microphone_iterator';\nimport {WebcamIterator} from './iterators/webcam_iterator';\nimport {URLDataSource} from './sources/url_data_source';\nimport {CSVConfig, MicrophoneConfig, WebcamConfig} from './types';\n\n/**\n * Create a `CSVDataset` by reading and decoding CSV file(s) from provided URL\n * or local path if it's in Node environment.\n *\n * Note: If isLabel in columnConfigs is `true` for at least one column, the\n * element in returned `CSVDataset` will be an object of\n * `{xs:features, ys:labels}`: xs is a dict of features key/value pairs, ys\n * is a dict of labels key/value pairs. If no column is marked as label,\n * returns a dict of features only.\n *\n * ```js\n * const csvUrl =\n * 'https://storage.googleapis.com/tfjs-examples/multivariate-linear-regression/data/boston-housing-train.csv';\n *\n * async function run() {\n * // We want to predict the column \"medv\", which represents a median value of\n * // a home (in $1000s), so we mark it as a label.\n * const csvDataset = tf.data.csv(\n * csvUrl, {\n * columnConfigs: {\n * medv: {\n * isLabel: true\n * }\n * }\n * });\n *\n * // Number of features is the number of column names minus one for the label\n * // column.\n * const numOfFeatures = (await csvDataset.columnNames()).length - 1;\n *\n * // Prepare the Dataset for training.\n * const flattenedDataset =\n * csvDataset\n * .map(({xs, ys}) =>\n * {\n * // Convert xs(features) and ys(labels) from object form (keyed by\n * // column name) to array form.\n * return {xs:Object.values(xs), ys:Object.values(ys)};\n * })\n * .batch(10);\n *\n * // Define the model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense({\n * inputShape: [numOfFeatures],\n * units: 1\n * }));\n * model.compile({\n * optimizer: tf.train.sgd(0.000001),\n * loss: 'meanSquaredError'\n * });\n *\n * // Fit the model using the prepared Dataset\n * return model.fitDataset(flattenedDataset, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * console.log(epoch + ':' + logs.loss);\n * }\n * }\n * });\n * }\n *\n * await run();\n * ```\n *\n * @param source URL or local path to get CSV file. If it's a local path, it\n * must have prefix `file://` and it only works in node environment.\n * @param csvConfig (Optional) A CSVConfig object that contains configurations\n * of reading and decoding from CSV file(s).\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * configParamIndices: [1]\n * }\n */\nexport function csv(\n source: RequestInfo, csvConfig: CSVConfig = {}): CSVDataset {\n return new CSVDataset(new URLDataSource(source), csvConfig);\n}\n\n/**\n * Create a `Dataset` that produces each element by calling a provided function.\n *\n * Note that repeated iterations over this `Dataset` may produce different\n * results, because the function will be called anew for each element of each\n * iteration.\n *\n * Also, beware that the sequence of calls to this function may be out of order\n * in time with respect to the logical order of the Dataset. This is due to the\n * asynchronous lazy nature of stream processing, and depends on downstream\n * transformations (e.g. .shuffle()). If the provided function is pure, this is\n * no problem, but if it is a closure over a mutable state (e.g., a traversal\n * pointer), then the order of the produced elements may be scrambled.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const ds = tf.data.func(func);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * @param f A function that produces one data element on each call.\n */\nexport function func(\n f: () => IteratorResult| Promise>): Dataset {\n const iter = iteratorFromFunction(f);\n return datasetFromIteratorFn(async () => iter);\n}\n\n/**\n * Create a `Dataset` that produces each element from provided JavaScript\n * generator, which is a function*\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions),\n * or a function that returns an\n * iterator\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions).\n *\n * The returned iterator should have `.next()` function that returns element in\n * format of `{value: TensorContainer, done:boolean}`.\n *\n * Example of creating a dataset from an iterator factory:\n * ```js\n * function makeIterator() {\n * const numElements = 10;\n * let index = 0;\n *\n * const iterator = {\n * next: () => {\n * let result;\n * if (index < numElements) {\n * result = {value: index, done: false};\n * index++;\n * return result;\n * }\n * return {value: index, done: true};\n * }\n * };\n * return iterator;\n * }\n * const ds = tf.data.generator(makeIterator);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * Example of creating a dataset from a generator:\n * ```js\n * function* dataGenerator() {\n * const numElements = 10;\n * let index = 0;\n * while (index < numElements) {\n * const x = index;\n * index++;\n * yield x;\n * }\n * }\n *\n * const ds = tf.data.generator(dataGenerator);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * @param generator A Javascript generator function that returns a JavaScript\n * iterator.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * configParamIndices: [1]\n * }\n */\nexport function generator(\n generator: () => Iterator| Promise>): Dataset {\n return datasetFromIteratorFn(async () => {\n const gen = await generator();\n return iteratorFromFunction(() => gen.next());\n });\n}\n\n/**\n * Create an iterator that generate `Tensor`s from webcam video stream. This API\n * only works in Browser environment when the device has webcam.\n *\n * Note: this code snippet only works when the device has a webcam. It will\n * request permission to open the webcam when running.\n * ```js\n * const videoElement = document.createElement('video');\n * videoElement.width = 100;\n * videoElement.height = 100;\n * const cam = await tf.data.webcam(videoElement);\n * const img = await cam.capture();\n * img.print();\n * cam.stop();\n * ```\n *\n * @param webcamVideoElement A `HTMLVideoElement` used to play video from\n * webcam. If this element is not provided, a hidden `HTMLVideoElement` will\n * be created. In that case, `resizeWidth` and `resizeHeight` must be\n * provided to set the generated tensor shape.\n * @param webcamConfig A `WebcamConfig` object that contains configurations of\n * reading and manipulating data from webcam video stream.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * ignoreCI: true\n * }\n */\nexport async function webcam(\n webcamVideoElement?: HTMLVideoElement,\n webcamConfig?: WebcamConfig): Promise {\n return WebcamIterator.create(webcamVideoElement, webcamConfig);\n}\n\n/**\n * Create an iterator that generate frequency-domain spectrogram `Tensor`s from\n * microphone audio stream with browser's native FFT. This API only works in\n * browser environment when the device has microphone.\n *\n * Note: this code snippet only works when the device has a microphone. It will\n * request permission to open the microphone when running.\n * ```js\n * const mic = await tf.data.microphone({\n * fftSize: 1024,\n * columnTruncateLength: 232,\n * numFramesPerSpectrogram: 43,\n * sampleRateHz:44100,\n * includeSpectrogram: true,\n * includeWaveform: true\n * });\n * const audioData = await mic.capture();\n * const spectrogramTensor = audioData.spectrogram;\n * spectrogramTensor.print();\n * const waveformTensor = audioData.waveform;\n * waveformTensor.print();\n * mic.stop();\n * ```\n *\n * @param microphoneConfig A `MicrophoneConfig` object that contains\n * configurations of reading audio data from microphone.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * ignoreCI: true\n * }\n */\nexport async function microphone(microphoneConfig?: MicrophoneConfig):\n Promise {\n return MicrophoneIterator.create(microphoneConfig);\n}\n","/** @license See the LICENSE file. */\n\n// This code is auto-generated, do not modify this file!\nconst version = '3.6.0';\nexport {version};\n"],"names":["this","define","sr","tf.util","tf.Tensor","tslib_1.__extends","tf.dispose","tf.tensor_util","seedrandom.alea","tf.tidy","tf.stack","tf.tensor","util","env","tensor","tensor1d","tensor2d","browser","tidy","expandDims","cast","image","reshape"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA;IACA;IACA;IACA;AACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA;AACA;AACA;IACA,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;AAClC;IACA,SAAS,IAAI,CAAC,IAAI,EAAE;IACpB,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,CAAC;AAC/B;IACA,EAAE,EAAE,CAAC,IAAI,GAAG,WAAW;IACvB,IAAI,IAAI,CAAC,GA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;;;;;;;;;;;aA8EgB,GAAG,CACf,MAAmB,EAAE,SAAyB;QAAzB,0BAAA,EAAA,cAAyB;QAChD,OAAO,IAAI,UAAU,CAAC,IAAI,aAAa,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;aAwBgB,IAAI,CAChB,CAAsD;QAD1D,iBAIC;QAFC,IAAM,IAAI,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC;QACrC,OAAO,qBAAqB,CAAC;YAAY,sBAAA,IAAI,EAAA;iBAAA,CAAC,CAAC;IACjD,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA4DgB,SAAS,CACrB,SAAkD;QADtD,iBAMC;QAJC,OAAO,qBAAqB,CAAC;;;;4BACf,qBAAM,SAAS,EAAE,EAAA;;wBAAvB,GAAG,GAAG,SAAiB;wBAC7B,sBAAO,oBAAoB,CAAC,cAAM,OAAA,GAAG,CAAC,IAAI,EAAE,GAAA,CAAC,EAAC;;;aAC/C,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aA8BsB,MAAM,CACxB,kBAAqC,EACrC,YAA2B;;;gBAC7B,sBAAO,cAAc,CAAC,MAAM,CAAC,kBAAkB,EAAE,YAAY,CAAC,EAAC;;;KAChE;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAkCsB,UAAU,CAAC,gBAAmC;;;gBAElE,sBAAO,kBAAkB,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAC;;;;;ICxRrD;IAEA;QACM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.min.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.min.js deleted file mode 100644 index 30e16c841..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.min.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tensorflow/tfjs-core")):"function"==typeof define&&define.amd?define(["exports","@tensorflow/tfjs-core"],e):e(((t=t||self).tf=t.tf||{},t.tf.data=t.tf.data||{}),t.tf)}(this,(function(t,e){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function r(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function i(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{a(r.next(t))}catch(t){o(t)}}function u(t){try{a(r.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,u)}a((r=r.apply(t,e||[])).next())}))}function o(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]>>0,e=(r*=e)>>>0,e+=4294967296*(r-=e)}return 2.3283064365386963e-10*(e>>>0)});n.next=function(){var t=2091639*n.s0+2.3283064365386963e-10*n.c;return n.s0=n.s1,n.s1=n.s2,n.s2=t-(n.c=0|t)},n.c=1,n.s0=r(" "),n.s1=r(" "),n.s2=r(" "),n.s0-=r(t),n.s0<0&&(n.s0+=1),n.s1-=r(t),n.s1<0&&(n.s1+=1),n.s2-=r(t),n.s2<0&&(n.s2+=1),r=null}function i(t,e){return e.c=t.c,e.s0=t.s0,e.s1=t.s1,e.s2=t.s2,e}function o(t,e){var n=new r(t),o=e&&e.state,s=n.next;return s.int32=function(){return 4294967296*n.next()|0},s.double=function(){return s()+11102230246251565e-32*(2097152*s()|0)},s.quick=s,o&&("object"==typeof o&&i(o,n),s.state=function(){return i(n,{})}),s}e&&e.exports?e.exports=o:n&&n.amd?n((function(){return o})):this.alea=o}(0,t,!1)})),a=s((function(t){!function(t,e,n){function r(t){var e=this,n="";e.x=0,e.y=0,e.z=0,e.w=0,e.next=function(){var t=e.x^e.x<<11;return e.x=e.y,e.y=e.z,e.z=e.w,e.w^=e.w>>>19^t^t>>>8},t===(0|t)?e.x=t:n+=t;for(var r=0;r>>0)/4294967296};return s.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},s.int32=n.next,s.quick=s,o&&("object"==typeof o&&i(o,n),s.state=function(){return i(n,{})}),s}e&&e.exports?e.exports=o:n&&n.amd?n((function(){return o})):this.xor128=o}(0,t,!1)})),c=s((function(t){!function(t,e,n){function r(t){var e=this,n="";e.next=function(){var t=e.x^e.x>>>2;return e.x=e.y,e.y=e.z,e.z=e.w,e.w=e.v,(e.d=e.d+362437|0)+(e.v=e.v^e.v<<4^t^t<<1)|0},e.x=0,e.y=0,e.z=0,e.w=0,e.v=0,t===(0|t)?e.x=t:n+=t;for(var r=0;r>>4),e.next()}function i(t,e){return e.x=t.x,e.y=t.y,e.z=t.z,e.w=t.w,e.v=t.v,e.d=t.d,e}function o(t,e){var n=new r(t),o=e&&e.state,s=function(){return(n.next()>>>0)/4294967296};return s.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},s.int32=n.next,s.quick=s,o&&("object"==typeof o&&i(o,n),s.state=function(){return i(n,{})}),s}e&&e.exports?e.exports=o:n&&n.amd?n((function(){return o})):this.xorwow=o}(0,t,!1)})),h=s((function(t){!function(t,e,n){function r(t){var e=this;e.next=function(){var t,n,r=e.x,i=e.i;return t=r[i],n=(t^=t>>>7)^t<<24,n^=(t=r[i+1&7])^t>>>10,n^=(t=r[i+3&7])^t>>>3,n^=(t=r[i+4&7])^t<<7,t=r[i+7&7],n^=(t^=t<<13)^t<<9,r[i]=n,e.i=i+1&7,n},function(t,e){var n,r=[];if(e===(0|e))r[0]=e;else for(e=""+e,n=0;n0;--n)t.next()}(e,t)}function i(t,e){return e.x=t.x.slice(),e.i=t.i,e}function o(t,e){null==t&&(t=+new Date);var n=new r(t),o=e&&e.state,s=function(){return(n.next()>>>0)/4294967296};return s.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},s.int32=n.next,s.quick=s,o&&(o.x&&i(o,n),s.state=function(){return i(n,{})}),s}e&&e.exports?e.exports=o:n&&n.amd?n((function(){return o})):this.xorshift7=o}(0,t,!1)})),l=s((function(t){!function(t,e,n){function r(t){var e=this;e.next=function(){var t,n,r=e.w,i=e.X,o=e.i;return e.w=r=r+1640531527|0,n=i[o+34&127],t=i[o=o+1&127],n^=n<<13,t^=t<<17,n^=n>>>15,t^=t>>>12,n=i[o]=n^t,e.i=o,n+(r^r>>>16)|0},function(t,e){var n,r,i,o,s,u=[],a=128;for(e===(0|e)?(r=e,e=null):(e+="\0",r=0,a=Math.max(a,e.length)),i=0,o=-32;o>>15,r^=r<<4,r^=r>>>13,o>=0&&(s=s+1640531527|0,i=0==(n=u[127&o]^=r+s)?i+1:0);for(i>=128&&(u[127&(e&&e.length||0)]=-1),i=127,o=512;o>0;--o)r=u[i+34&127],n=u[i=i+1&127],r^=r<<13,n^=n<<17,r^=r>>>15,n^=n>>>12,u[i]=r^n;t.w=s,t.X=u,t.i=i}(e,t)}function i(t,e){return e.i=t.i,e.w=t.w,e.X=t.X.slice(),e}function o(t,e){null==t&&(t=+new Date);var n=new r(t),o=e&&e.state,s=function(){return(n.next()>>>0)/4294967296};return s.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},s.int32=n.next,s.quick=s,o&&(o.X&&i(o,n),s.state=function(){return i(n,{})}),s}e&&e.exports?e.exports=o:n&&n.amd?n((function(){return o})):this.xor4096=o}(0,t,!1)})),f=s((function(t){!function(t,e,n){function r(t){var e=this,n="";e.next=function(){var t=e.b,n=e.c,r=e.d,i=e.a;return t=t<<25^t>>>7^n,n=n-r|0,r=r<<24^r>>>8^i,i=i-t|0,e.b=t=t<<20^t>>>12^n,e.c=n=n-r|0,e.d=r<<16^n>>>16^i,e.a=i-t|0},e.a=0,e.b=0,e.c=-1640531527,e.d=1367130551,t===Math.floor(t)?(e.a=t/4294967296|0,e.b=0|t):n+=t;for(var r=0;r>>0)/4294967296};return s.double=function(){do{var t=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===t);return t},s.int32=n.next,s.quick=s,o&&("object"==typeof o&&i(o,n),s.state=function(){return i(n,{})}),s}e&&e.exports?e.exports=o:n&&n.amd?n((function(){return o})):this.tychei=o}(0,t,!1)})),d=s((function(t){!function(e,n){var r,i=this,o=256,s=n.pow(o,6),u=n.pow(2,52),a=2*u,c=255;function h(t,c,h){var m=[],y=p(d((c=1==c?{entropy:!0}:c||{}).entropy?[t,v(e)]:null==t?function(){try{var t;return r&&(t=r.randomBytes)?t=t(o):(t=new Uint8Array(o),(i.crypto||i.msCrypto).getRandomValues(t)),v(t)}catch(t){var n=i.navigator,s=n&&n.plugins;return[+new Date,i,s,i.screen,v(e)]}}():t,3),m),w=new l(m),b=function(){for(var t=w.g(6),e=s,n=0;t=a;)t/=2,e/=2,n>>>=1;return(t+n)/e};return b.int32=function(){return 0|w.g(4)},b.quick=function(){return w.g(4)/4294967296},b.double=b,p(v(w.S),e),(c.pass||h||function(t,e,r,i){return i&&(i.S&&f(i,w),t.state=function(){return f(w,{})}),r?(n.random=t,e):t})(b,y,"global"in c?c.global:this==n,c.state)}function l(t){var e,n=t.length,r=this,i=0,s=r.i=r.j=0,u=r.S=[];for(n||(t=[n++]);i=this.items.length?[2,{value:null,done:!0}]:(t=this.items[this.trav],this.trav++,[2,{value:x(t),done:!1}])}))}))},e}(T),F=function(t){function e(e){var n=t.call(this)||this;return n.nextFn=e,n}return r(e,t),e.prototype.summary=function(){return"Function call"},e.prototype.next=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){try{return[2,this.nextFn()]}catch(t){throw t.message="Error thrown while iterating through a dataset: "+t.message,t}return[2]}))}))},e}(T),N=function(t){function e(e){var n=t.call(this)||this;return n.upstream=e,n.lastRead=Promise.resolve({value:null,done:!1}),n}return r(e,t),e.prototype.summary=function(){return this.upstream.summary()+" -> Serial"},e.prototype.next=function(){return i(this,void 0,void 0,(function(){var t=this;return o(this,(function(e){return this.lastRead=this.lastRead.then((function(){return t.serialNext()})),[2,this.lastRead]}))}))},e.prototype.serialNext=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.upstream.next()]}))}))},e}(T),I=function(t){function n(e,n){var r=t.call(this)||this;return r.upstream=e,r.maxCount=n,r.count=0,r.lastRead=Promise.resolve({value:null,done:!1}),r}return r(n,t),n.prototype.summary=function(){return this.upstream.summary()+" -> Skip"},n.prototype.next=function(){return i(this,void 0,void 0,(function(){var t=this;return o(this,(function(e){return this.lastRead=this.lastRead.then((function(){return t.serialNext()})),[2,this.lastRead]}))}))},n.prototype.serialNext=function(){return i(this,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return this.count++ Take"},e.prototype.next=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){return this.count++>=this.maxCount?[2,{value:null,done:!0}]:[2,this.upstream.next()]}))}))},e}(T),O=function(t){function e(e,n,r){void 0===r&&(r=!0);var i=t.call(this)||this;return i.upstream=e,i.batchSize=n,i.enableSmallLastBatch=r,i.lastRead=Promise.resolve({value:null,done:!1}),i}return r(e,t),e.prototype.summary=function(){return this.upstream.summary()+" -> RowMajorBatch"},e.prototype.next=function(){return i(this,void 0,void 0,(function(){var t=this;return o(this,(function(e){return this.lastRead=this.lastRead.then((function(){return t.serialNext()})),[2,this.lastRead]}))}))},e.prototype.serialNext=function(){return i(this,void 0,void 0,(function(){var t,e;return o(this,(function(n){switch(n.label){case 0:t=[],n.label=1;case 1:return t.length0?[2,{value:t,done:!1}]:[2,{value:null,done:!0}]:(t.push(e.value),[3,1]);case 3:return[2,{value:t,done:!1}]}}))}))},e}(T),M=function(t){function n(e,n){var r=t.call(this)||this;return r.upstream=e,r.predicate=n,r.lastRead=Promise.resolve({value:null,done:!1}),r}return r(n,t),n.prototype.summary=function(){return this.upstream.summary()+" -> Filter"},n.prototype.next=function(){return i(this,void 0,void 0,(function(){var t=this;return o(this,(function(e){return this.lastRead=this.lastRead.then((function(){return t.serialNext()})),[2,this.lastRead]}))}))},n.prototype.serialNext=function(){return i(this,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return[4,this.upstream.next()];case 1:return(t=n.sent()).done||this.predicate(t.value)?[2,t]:(e.dispose(t.value),[3,0]);case 2:return[2]}}))}))},n}(T),j=function(t){function n(e,n){var r=t.call(this)||this;return r.upstream=e,r.transform=n,r}return r(n,t),n.prototype.summary=function(){return this.upstream.summary()+" -> Map"},n.prototype.next=function(){return i(this,void 0,void 0,(function(){var t,n,r,i,s,u,a;return o(this,(function(o){switch(o.label){case 0:return[4,this.upstream.next()];case 1:if((t=o.sent()).done)return[2,{value:null,done:!0}];for(n=e.tensor_util.getTensorsInContainer(t.value),r=this.transform(t.value),i=e.tensor_util.getTensorsInContainer(r),s=0,u=n;s handleErrors"},e.prototype.next=function(){return i(this,void 0,void 0,(function(){var t=this;return o(this,(function(e){return this.lastRead=this.lastRead.then((function(){return t.serialNext()})),[2,this.lastRead]}))}))},e.prototype.serialNext=function(){return i(this,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:e.label=1;case 1:return e.trys.push([1,3,,4]),[4,this.upstream.next()];case 2:return[2,e.sent()];case 3:return t=e.sent(),this.handler(t)?[3,4]:[2,{value:null,done:!0}];case 4:return[3,0];case 5:return[2]}}))}))},e}(T),L=function(t){function n(e,n){var r=t.call(this)||this;return r.upstream=e,r.transform=n,r}return r(n,t),n.prototype.summary=function(){return this.upstream.summary()+" -> AsyncMap"},n.prototype.next=function(){return i(this,void 0,void 0,(function(){var t,n,r,i,s,u,a;return o(this,(function(o){switch(o.label){case 0:return[4,this.upstream.next()];case 1:return(t=o.sent()).done?[2,{value:null,done:!0}]:(n=e.tensor_util.getTensorsInContainer(t.value),[4,this.transform(t.value)]);case 2:for(r=o.sent(),i=e.tensor_util.getTensorsInContainer(r),s=0,u=n;s Flatmap"},n.prototype.pump=function(){return i(this,void 0,void 0,(function(){var t,n,r,i,s,u,a;return o(this,(function(o){switch(o.label){case 0:return[4,this.upstream.next()];case 1:if((t=o.sent()).done)return[2,!1];for(n=e.tensor_util.getTensorsInContainer(t.value),r=this.transform(t.value),i=e.tensor_util.getTensorsInContainer(r),this.outputQueue.pushAll(r),s=0,u=n;s Chained"},e.prototype.next=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){return this.lastRead=this.readFromChain(this.lastRead),[2,this.lastRead]}))}))},e.prototype.readFromChain=function(t){return i(this,void 0,void 0,(function(){var e,n;return o(this,(function(r){switch(r.label){case 0:return[4,t];case 1:return r.sent(),null!=this.iterator?[3,3]:[4,this.moreIterators.next()];case 2:if((e=r.sent()).done)return[2,{value:null,done:!0}];this.iterator=e.value,null!=this.baseErrorHandler&&(this.iterator=this.iterator.handleErrors(this.baseErrorHandler)),r.label=3;case 3:return[4,this.iterator.next()];case 4:return(n=r.sent()).done?(this.iterator=null,[2,this.readFromChain(t)]):[2,n]}}))}))},e}(T);!function(t){t[t.FAIL=0]="FAIL",t[t.SHORTEST=1]="SHORTEST",t[t.LONGEST=2]="LONGEST"}(R||(R={}));var P=function(t){function e(e,n){void 0===n&&(n=R.FAIL);var r=t.call(this)||this;return r.iterators=e,r.mismatchMode=n,r.count=0,r.currentPromise=null,r}return r(e,t),e.prototype.summary=function(){return"{TODO: fill in upstream of zip summaries} -> Zip"},e.prototype.nextState=function(t){return i(this,void 0,void 0,(function(){function e(t){return t instanceof T?{value:t.next().then((function(t){return n++,t.done&&r++,t.value})),recurse:!1}:{value:null,recurse:!0}}var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,t];case 1:return o.sent(),n=0,r=0,[4,b(this.iterators,e)];case 2:if(i=o.sent(),n===r)return[2,{value:null,done:!0}];if(r>0)switch(this.mismatchMode){case R.FAIL:throw new Error("Zipped streams should have the same length. Mismatched at element "+this.count+".");case R.SHORTEST:return[2,{value:null,done:!0}];case R.LONGEST:}return this.count++,[2,{value:i,done:!1}]}}))}))},e.prototype.next=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){return this.currentPromise=this.nextState(this.currentPromise),[2,this.currentPromise]}))}))},e}(T),W=function(t){function e(e,n){var r=t.call(this)||this;return r.upstream=e,r.bufferSize=n,r.buffer=new z(n),r}return r(e,t),e.prototype.summary=function(){return this.upstream.summary()+" -> Prefetch"},e.prototype.refill=function(){for(;!this.buffer.isFull();){var t=this.upstream.next();this.buffer.push(t)}},e.prototype.next=function(){return this.refill(),this.buffer.shift()},e}(T),V=function(t){function n(n,r,i){var o=t.call(this,n,r)||this;return o.upstream=n,o.windowSize=r,o.upstreamExhausted=!1,o.random=p(i||e.util.now().toString()),o.lastRead=Promise.resolve({value:null,done:!1}),o}return r(n,t),n.prototype.next=function(){return i(this,void 0,void 0,(function(){var t=this;return o(this,(function(e){return this.lastRead=this.lastRead.then((function(){return t.serialNext()})),[2,this.lastRead]}))}))},n.prototype.randomInt=function(t){return Math.floor(this.random()*t)},n.prototype.chooseIndex=function(){return this.randomInt(this.buffer.length())},n.prototype.serialNext=function(){return i(this,void 0,void 0,(function(){var t,e;return o(this,(function(n){switch(n.label){case 0:this.upstreamExhausted||this.refill(),n.label=1;case 1:return this.buffer.isEmpty()?[3,3]:(t=this.chooseIndex(),[4,this.buffer.shuffleExcise(t)]);case 2:return(e=n.sent()).done?(this.upstreamExhausted=!0,[3,1]):(this.refill(),[2,e]);case 3:return[2,{value:null,done:!0}]}}))}))},n}(W),U=function(){function t(){this.size=null}return t.prototype.batch=function(t,n){var r=this;void 0===n&&(n=!0);var s=this;return e.util.assert(t>0,(function(){return"batchSize needs to be positive, but it is\n "+t})),Q((function(){return i(r,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,s.iterator()];case 1:return[2,e.sent().columnMajorBatch(t,n,X)]}}))}))}),this.size===1/0||null==this.size?this.size:n?Math.ceil(this.size/t):Math.floor(this.size/t))},t.prototype.concatenate=function(t){var e=this,n=this;return Q((function(){return i(e,void 0,void 0,(function(){var e,r;return o(this,(function(i){switch(i.label){case 0:return[4,n.iterator()];case 1:return r=(e=i.sent()).concatenate,[4,t.iterator()];case 2:return[2,r.apply(e,[i.sent()])]}}))}))}),this.size===1/0||t.size===1/0?1/0:null!=this.size&&null!=t.size?this.size+t.size:null)},t.prototype.filter=function(t){var n=this,r=this;return Q((function(){return i(n,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,r.iterator()];case 1:return[2,n.sent().filter((function(n){return e.tidy((function(){return t(n)}))}))]}}))}))}),this.size===1/0?1/0:null)},t.prototype.forEachAsync=function(t){return i(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,this.iterator()];case 1:return[2,e.sent().forEachAsync(t)]}}))}))},t.prototype.map=function(t){var n=this,r=this;return Q((function(){return i(n,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,r.iterator()];case 1:return[2,n.sent().map((function(n){return e.tidy((function(){return t(n)}))}))]}}))}))}),this.size)},t.prototype.mapAsync=function(t){var e=this,n=this;return Q((function(){return i(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,n.iterator()];case 1:return[2,e.sent().mapAsync(t)]}}))}))}),this.size)},t.prototype.prefetch=function(t){var e=this;if(null==t)throw new RangeError("`Dataset.prefetch()` requires bufferSize to be specified.");var n=this;return Q((function(){return i(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,n.iterator()];case 1:return[2,e.sent().prefetch(t)]}}))}))}),this.size)},t.prototype.repeat=function(t){var e=this,n=this;return Q((function(){return i(e,void 0,void 0,(function(){var e,r=this;return o(this,(function(s){return e=A((function(){return i(r,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:return t={},[4,n.iterator()];case 1:return[2,(t.value=e.sent(),t.done=!1,t)]}}))}))})),[2,(u=e.take(t),new B(u,a))];var u,a}))}))}),null!=this.size&&t>0?this.size*t:0===t?0:null!=this.size&&(void 0===t||t<0)?1/0:null)},t.prototype.skip=function(t){var e=this,n=this;return Q((function(){return i(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,n.iterator()];case 1:return[2,e.sent().skip(t)]}}))}))}),null!=this.size&&t>=0&&this.size>=t?this.size-t:null!=this.size&&(this.sizet?t:null!=this.size&&this.size<=t?this.size:null)},t.prototype.toArray=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return[4,this.iterator()];case 1:return[2,t.sent().toArray()]}}))}))},t.prototype.toArrayForTest=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:if(this.size===1/0)throw new Error("Can not convert infinite data stream to array.");return[4,this.iterator()];case 1:return[2,t.sent().toArrayForTest()]}}))}))},t.MAX_BUFFER_SIZE=1e4,t}();function Q(t,e){return void 0===e&&(e=null),new(function(n){function s(){var t=null!==n&&n.apply(this,arguments)||this;return t.size=e,t}return r(s,n),s.prototype.iterator=function(){return i(this,void 0,void 0,(function(){return o(this,(function(e){return[2,t()]}))}))},s}(U))}function X(t){return null===t?null:function(t){return null==t||null===(n=t)||"object"!=typeof n&&"function"!=typeof n||Array.isArray(t)||"object"==typeof t&&t instanceof e.Tensor||e.util.isTypedArray(t);var n}(t[0])?{value:function(t){if(0===t.length)throw new Error("Can't make a batch of zero elements.");return t[0]instanceof e.Tensor?e.stack(t):e.tensor(t)}(t),recurse:!1}:{value:null,recurse:!0}}var G=function(t){function e(e){var n=t.call(this)||this;return n.input=e,n}return r(e,t),e.prototype.iterator=function(){return i(this,void 0,void 0,(function(){var t,e;return o(this,(function(n){switch(n.label){case 0:return[4,this.input.iterator()];case 1:return t=n.sent(),e=t.decodeUTF8(),[2,e.split("\n").map((function(t){return t.endsWith("\r")&&(t=t.slice(0,-1)),t}))]}}))}))},e}(U),Z='"',J=Symbol("out"),Y=Symbol("field"),K=Symbol("quote"),$=Symbol("quoteafterquote"),tt=Symbol("quoteinquote"),et=function(t){function n(n,r){var i=t.call(this)||this;return i.input=n,i.hasHeader=!0,i.fullColumnNames=null,i.columnNamesValidated=!1,i.columnConfigs=null,i.configuredColumnsOnly=!1,i.delimiter=",",i.delimWhitespace=!1,i.base=new G(n),r||(r={}),i.hasHeader=!1!==r.hasHeader,i.fullColumnNames=r.columnNames,i.columnConfigs=r.columnConfigs,i.configuredColumnsOnly=r.configuredColumnsOnly,r.delimWhitespace?(e.util.assert(null==r.delimiter,(function(){return"Delimiter should not be provided when delimWhitespace is true."})),i.delimWhitespace=!0,i.delimiter=" "):i.delimiter=r.delimiter?r.delimiter:",",i}return r(n,t),n.prototype.columnNames=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return this.columnNamesValidated?[3,2]:[4,this.setColumnNames()];case 1:t.sent(),t.label=2;case 2:return[2,this.configuredColumnsOnly?Object.keys(this.columnConfigs):this.fullColumnNames]}}))}))},n.prototype.setColumnNames=function(){return i(this,void 0,void 0,(function(){var t,n,r,i,s,u,a=this;return o(this,(function(o){switch(o.label){case 0:return[4,this.maybeReadHeaderLine()];case 1:if(t=o.sent(),!this.fullColumnNames&&!t)throw new Error("Column names must be provided if there is no header line.");if(this.fullColumnNames&&t&&e.util.assert(t.length===this.fullColumnNames.length,(function(){return"The length of provided columnNames ("+a.fullColumnNames.length.toString()+") does not match the length of the header line read from file ("+t.length.toString()+")."})),this.fullColumnNames||(this.fullColumnNames=t),n=this.fullColumnNames.reduce((function(t,e){return t[e]=t[e]+1||1,t}),{}),r=Object.keys(n).filter((function(t){return n[t]>1})),e.util.assert(0===r.length,(function(){return"Duplicate column names found: "+r.toString()})),this.columnConfigs)for(i=0,s=Object.keys(this.columnConfigs);i14||!Number.isInteger(r))throw new Error("Invalid fftSize: it must be a power of 2 between 2 to 4 and 2 to 14, but got "+n.fftSize);if(n.numFrames=e.numFramesPerSpectrogram||43,n.sampleRateHz=e.sampleRateHz,n.columnTruncateLength=e.columnTruncateLength||n.fftSize,n.audioTrackConstraints=e.audioTrackConstraints,n.smoothingTimeConstant=e.smoothingTimeConstant||0,n.includeSpectrogram=!1!==e.includeSpectrogram,n.includeWaveform=!0===e.includeWaveform,!n.includeSpectrogram&&!n.includeWaveform)throw new Error("Both includeSpectrogram and includeWaveform are false. At least one type of data should be returned.");return n}return r(n,t),n.prototype.summary=function(){return"microphone"},n.create=function(t){return void 0===t&&(t={}),i(this,void 0,void 0,(function(){var r;return o(this,(function(i){switch(i.label){case 0:if(e.env().get("IS_NODE"))throw new Error("microphone API is only supported in browser environment.");return[4,(r=new n(t)).start()];case 1:return i.sent(),[2,r]}}))}))},n.prototype.start=function(){return i(this,void 0,void 0,(function(){var t,e,n,r;return o(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),t=this,[4,navigator.mediaDevices.getUserMedia({audio:null==this.audioTrackConstraints||this.audioTrackConstraints,video:!1})];case 1:return t.stream=i.sent(),[3,3];case 2:throw e=i.sent(),new Error("Error thrown while initializing video stream: "+e.message);case 3:if(!this.stream)throw new Error("Could not obtain audio from microphone.");if(n=window.AudioContext||window.webkitAudioContext,this.audioContext=new n,this.sampleRateHz){if(this.audioContext.sampleRate!==this.sampleRateHz)throw new Error("Mismatch in sampling rate: Expected: "+this.sampleRateHz+"; Actual: "+this.audioContext.sampleRate)}else this.sampleRateHz=this.audioContext.sampleRate;return r=this.audioContext.createMediaStreamSource(this.stream),this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=2*this.fftSize,this.analyser.smoothingTimeConstant=this.smoothingTimeConstant,r.connect(this.analyser),this.freqData=new Float32Array(this.fftSize),this.timeData=new Float32Array(this.fftSize),[2]}}))}))},n.prototype.next=function(){return i(this,void 0,void 0,(function(){var t,e,n,r,i;return o(this,(function(o){switch(o.label){case 0:return this.isClosed?[2,{value:null,done:!0}]:[4,this.getAudioData()];case 1:return n=o.sent(),this.includeSpectrogram&&(r=this.flattenQueue(n.freqDataQueue),t=this.getTensorFromAudioDataArray(r,[this.numFrames,this.columnTruncateLength,1])),this.includeWaveform&&(i=this.flattenQueue(n.timeDataQueue),e=this.getTensorFromAudioDataArray(i,[this.numFrames*this.fftSize,1])),[2,{value:{spectrogram:t,waveform:e},done:!1}]}}))}))},n.prototype.capture=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.next()];case 1:return[2,t.sent().value]}}))}))},n.prototype.getAudioData=function(){return i(this,void 0,void 0,(function(){var t,e,n,r=this;return o(this,(function(i){return t=[],e=[],n=0,[2,new Promise((function(i){var o=setInterval((function(){r.includeSpectrogram&&(r.analyser.getFloatFrequencyData(r.freqData),r.freqData[0]===-1/0&&i({freqDataQueue:t,timeDataQueue:e}),t.push(r.freqData.slice(0,r.columnTruncateLength))),r.includeWaveform&&(r.analyser.getFloatTimeDomainData(r.timeData),e.push(r.timeData.slice())),++n===r.numFrames&&(clearInterval(o),i({freqDataQueue:t,timeDataQueue:e}))}),r.fftSize/r.sampleRateHz*1e3)}))]}))}))},n.prototype.stop=function(){this.isClosed||(this.isClosed=!0,this.analyser.disconnect(),this.audioContext.close(),null!=this.stream&&this.stream.getTracks().length>0&&this.stream.getTracks()[0].stop())},n.prototype.toArray=function(){throw new Error("Can not convert infinite audio stream to array.")},n.prototype.getSampleRate=function(){return this.sampleRateHz},n.prototype.flattenQueue=function(t){var e=t[0].length,n=new Float32Array(t.length*e);return t.forEach((function(t,r){return n.set(t,r*e)})),n},n.prototype.getTensorFromAudioDataArray=function(t,n){var r=new Float32Array(e.util.sizeFromShape(n));return r.set(t,r.length-t.length),e.tensor(r,n)},n}(T),rt=function(t){function n(n,r){var i=t.call(this)||this;if(i.webcamVideoElement=n,i.webcamConfig=r,i.isClosed=!0,i.resize=!1,i.needToResize())if(i.resize=!0,i.cropSize=[i.webcamConfig.resizeHeight,i.webcamConfig.resizeWidth],i.cropBoxInd=e.tensor1d([0],"int32"),i.webcamConfig.centerCrop){var o=1*i.webcamConfig.resizeWidth/i.webcamVideoElement.width,s=1*i.webcamConfig.resizeHeight/i.webcamVideoElement.height,u=(1-o)/2,a=(1-s)/2,c=u+o,h=s+a;i.cropBox=e.tensor2d([a,u,h,c],[1,4])}else i.cropBox=e.tensor2d([0,0,1,1],[1,4]);return i}return r(n,t),n.prototype.summary=function(){return"webcam"},n.create=function(t,r){return void 0===r&&(r={}),i(this,void 0,void 0,(function(){var i;return o(this,(function(o){switch(o.label){case 0:if(e.env().get("IS_NODE"))throw new Error("tf.data.webcam is only supported in browser environment.");if(!t){if(t=document.createElement("video"),!r.resizeWidth||!r.resizeHeight)throw new Error("Please provide webcam video element, or resizeWidth and resizeHeight to create a hidden video element.");t.width=r.resizeWidth,t.height=r.resizeHeight}return[4,(i=new n(t,r)).start()];case 1:return o.sent(),[2,i]}}))}))},n.prototype.start=function(){return i(this,void 0,void 0,(function(){var t,n,r=this;return o(this,(function(i){switch(i.label){case 0:this.webcamConfig.facingMode&&e.util.assert("user"===this.webcamConfig.facingMode||"environment"===this.webcamConfig.facingMode,(function(){return"Invalid webcam facing mode: "+r.webcamConfig.facingMode+". Please provide 'user' or 'environment'"})),i.label=1;case 1:return i.trys.push([1,3,,4]),t=this,[4,navigator.mediaDevices.getUserMedia({video:{deviceId:this.webcamConfig.deviceId,facingMode:this.webcamConfig.facingMode?this.webcamConfig.facingMode:"user",width:this.webcamVideoElement.width,height:this.webcamVideoElement.height}})];case 2:return t.stream=i.sent(),[3,4];case 3:throw(n=i.sent()).message="Error thrown while initializing video stream: "+n.message,n;case 4:if(!this.stream)throw new Error("Could not obtain video from webcam.");try{this.webcamVideoElement.srcObject=this.stream}catch(t){console.log(t),this.webcamVideoElement.src=window.URL.createObjectURL(this.stream)}return this.webcamVideoElement.play(),this.isClosed=!1,[2,new Promise((function(t){r.webcamVideoElement.onloadedmetadata=function(){t()}}))]}}))}))},n.prototype.next=function(){return i(this,void 0,void 0,(function(){var t;return o(this,(function(n){if(this.isClosed)return[2,{value:null,done:!0}];try{t=e.browser.fromPixels(this.webcamVideoElement)}catch(t){throw new Error("Error thrown converting video to pixels: "+JSON.stringify(t))}if(!this.resize)return[2,{value:t,done:!1}];try{return[2,{value:this.cropAndResizeFrame(t),done:!1}]}catch(t){throw new Error("Error thrown cropping the video: "+t.message)}finally{t.dispose()}return[2]}))}))},n.prototype.needToResize=function(){return!(!this.webcamConfig.resizeWidth||!this.webcamConfig.resizeHeight||this.webcamVideoElement.width===this.webcamConfig.resizeWidth&&this.webcamVideoElement.height===this.webcamConfig.resizeHeight)},n.prototype.cropAndResizeFrame=function(t){var n=this;return e.tidy((function(){var r,i=e.expandDims(e.cast(t,"float32"),0),o=(r=e.image.cropAndResize(i,n.cropBox,n.cropBoxInd,n.cropSize,"bilinear")).shape;return e.reshape(r,o.slice(1))}))},n.prototype.capture=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,this.next()];case 1:return[2,t.sent().value]}}))}))},n.prototype.stop=function(){this.stream.getTracks().forEach((function(t){return t.stop()}));try{this.webcamVideoElement.srcObject=null}catch(t){console.log(t),this.webcamVideoElement.src=null}this.isClosed=!0},n.prototype.toArray=function(){throw new Error("Can not convert infinite video stream to array.")},n}(T),it=function(){},ot=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.split=function(t){return new st(this,t)},e}(T),st=function(t){function e(e,n){var r=t.call(this)||this;return r.upstream=e,r.impl=new ut(e,n),r}return r(e,t),e.prototype.summary=function(){return this.impl.summary()},e.prototype.next=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.impl.next()]}))}))},e}(ot),ut=function(t){function e(e,n){var r=t.call(this)||this;return r.upstream=e,r.separator=n,r.carryover="",r}return r(e,t),e.prototype.summary=function(){return this.upstream.summary()+" -> Split('"+this.separator+"')"},e.prototype.pump=function(){return i(this,void 0,void 0,(function(){var t,e,n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,this.upstream.next()];case 1:if((t=o.sent()).done)return""===this.carryover?[2,!1]:(this.outputQueue.push(this.carryover),this.carryover="",[2,!0]);for((e=t.value.split(this.separator))[0]=this.carryover+e[0],n=0,r=e.slice(0,-1);n Utf8"},n.prototype.pump=function(){return i(this,void 0,void 0,(function(){var t,n,r;return o(this,(function(i){switch(i.label){case 0:return[4,this.upstream.next()];case 1:return(t=i.sent()).done?[2,!1]:(n=t.value,r=e.env().get("IS_BROWSER")?this.decoder.decode(n,{stream:!0}):this.decoder.write(Buffer.from(n.buffer)),this.outputQueue.push(r),[2,!0])}}))}))},n}(q),lt=function(t){function n(n,r){void 0===r&&(r={});var i=t.call(this)||this;return i.file=n,i.options=r,e.util.assert(n instanceof Uint8Array||!!e.env().get("IS_BROWSER")&&(n instanceof File||n instanceof Blob),(function(){return"FileChunkIterator only supports File, Blob and Uint8Array right now."})),i.offset=r.offset||0,i.chunkSize=r.chunkSize||1048576,i}return r(n,t),n.prototype.summary=function(){return"FileChunks "+this.file},n.prototype.next=function(){return i(this,void 0,void 0,(function(){var t,e,n=this;return o(this,(function(r){switch(r.label){case 0:return this.offset>=(this.file instanceof Uint8Array?this.file.byteLength:this.file.size)?[2,{value:null,done:!0}]:(t=new Promise((function(t,e){var r=n.offset+n.chunkSize;if(n.file instanceof Uint8Array)t(new Uint8Array(n.file.slice(n.offset,r)));else{var i=new FileReader;i.onload=function(n){var r=i.result;if(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),!(r instanceof Uint8Array))return e(new TypeError("FileReader returned unknown type."));t(r)},i.onabort=function(t){return e(new Error("Aborted"))},i.onerror=function(t){return e(new Error(t.type))};var o=n.file.slice(n.offset,r);i.readAsArrayBuffer(o)}n.offset=r})),e={},[4,t]);case 1:return[2,(e.value=r.sent(),e.done=!1,e)]}}))}))},n}(at);function ft(t,n){return void 0===n&&(n={}),i(this,void 0,void 0,(function(){var r,i,s,u,a;return o(this,(function(o){switch(o.label){case 0:return"string"==typeof t?r=t:(r=t.url,i=dt(t)),[4,e.util.fetch(r,i)];case 1:return(s=o.sent()).ok?(a=Uint8Array.bind,[4,s.arrayBuffer()]):[3,3];case 2:return u=new(a.apply(Uint8Array,[void 0,o.sent()])),[2,new lt(u,n)];case 3:throw new Error(s.statusText)}}))}))}var dt=function(t){return{method:t.method,headers:t.headers,body:t.body,mode:t.mode,credentials:t.credentials,cache:t.cache,redirect:t.redirect,referrer:t.referrer,integrity:t.integrity}};function pt(t){return"string"==typeof t&&"file://"===t.substr(0,7)}var vt=function(t){function n(e,n){void 0===n&&(n={});var r=t.call(this)||this;return r.input=e,r.options=n,r}return r(n,t),n.prototype.iterator=function(){return i(this,void 0,void 0,(function(){var t;return o(this,(function(n){return pt(this.input)&&e.env().get("IS_NODE")&&(t=require("fs"),this.input=t.readFileSync(this.input.substr(7))),[2,new lt(this.input,this.options)]}))}))},n}(it),mt=function(t){function e(e,n){void 0===n&&(n={});var r=t.call(this)||this;return r.url=e,r.fileOptions=n,r}return r(e,t),e.prototype.iterator=function(){return i(this,void 0,void 0,(function(){return o(this,(function(t){return pt(this.url)?[2,new vt(this.url,this.fileOptions).iterator()]:[2,ft(this.url,this.fileOptions)]}))}))},e}(it);t.CSVDataset=et,t.Dataset=U,t.FileDataSource=vt,t.TextLineDataset=G,t.URLDataSource=mt,t.array=function(t){var e=this;return Q((function(){return i(e,void 0,void 0,(function(){return o(this,(function(e){return[2,S(t)]}))}))}),t.length)},t.csv=function(t,e){return void 0===e&&(e={}),new et(new mt(t),e)},t.func=function(t){var e=this,n=A(t);return Q((function(){return i(e,void 0,void 0,(function(){return o(this,(function(t){return[2,n]}))}))}))},t.generator=function(t){var e=this;return Q((function(){return i(e,void 0,void 0,(function(){var e;return o(this,(function(n){switch(n.label){case 0:return[4,t()];case 1:return e=n.sent(),[2,A((function(){return e.next()}))]}}))}))}))},t.microphone=function(t){return i(this,void 0,void 0,(function(){return o(this,(function(e){return[2,nt.create(t)]}))}))},t.version_data="3.6.0",t.webcam=function(t,e){return i(this,void 0,void 0,(function(){return o(this,(function(n){return[2,rt.create(t,e)]}))}))},t.zip=function(t){var e,n=this;if(!g(t))throw new Error("The argument to zip() must be an object or array.");if(Array.isArray(t))for(var r=0;r - - - - - - RollUp Visualizer - - - - -
- - - - diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.min.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.min.js.map deleted file mode 100644 index e5557f7a1..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tf-data.min.js","sources":["../node_modules/seedrandom/lib/alea.js","../node_modules/seedrandom/lib/xor128.js","../node_modules/seedrandom/lib/xorwow.js","../node_modules/seedrandom/lib/xorshift7.js","../node_modules/seedrandom/lib/xor4096.js","../node_modules/seedrandom/lib/tychei.js","../node_modules/seedrandom/seedrandom.js","../node_modules/seedrandom/index.js","../src/util/deep_map.ts","../src/util/deep_clone.ts","../src/util/ring_buffer.ts","../src/util/growing_ring_buffer.ts","../src/iterators/lazy_iterator.ts","../src/dataset.ts","../src/datasets/text_line_dataset.ts","../src/datasets/csv_dataset.ts","../src/iterators/microphone_iterator.ts","../src/iterators/webcam_iterator.ts","../src/datasource.ts","../src/iterators/string_iterator.ts","../src/iterators/byte_chunk_iterator.ts","../src/iterators/file_chunk_iterator.ts","../src/iterators/url_chunk_iterator.ts","../src/util/source_util.ts","../src/sources/file_data_source.ts","../src/sources/url_data_source.ts","../src/readers.ts","../src/version.ts"],"sourcesContent":["// A port of an algorithm by Johannes Baagøe , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baagøe \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xorshift7\" algorithm by\n// François Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n","// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n","// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","/*\nCopyright 2014 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\nvar global = this,\n width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\nmath['seed' + rngname] = seedrandom;\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n}\n\n// End anonymous scope, and pass initial values.\n})(\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n","// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by François Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\n\n// tslint:disable:no-any\n\n/**\n * A return value for a mapping function that can be applied via deepMap.\n *\n * If recurse is true, the value should be empty, and iteration will continue\n * into the object or array.\n */\nexport type DeepMapResult = {\n value: any,\n recurse: boolean\n};\n\n/**\n * Apply a mapping function to a nested structure in a recursive manner.\n *\n * The result of the mapping is an object with the same nested structure (i.e.,\n * of arrays and dicts) as the input, except that some subtrees are replaced,\n * according to the results of the mapping function.\n *\n * Mappings are memoized. Thus, if the nested structure contains the same\n * object in multiple positions, the output will contain the same mapped object\n * in those positions. Cycles are not supported, however.\n *\n * @param input: The object to which to apply the mapping function.\n * @param mapFn: A function that expects a single node of the object tree, and\n * returns a `DeepMapResult`. The `DeepMapResult` either provides a\n * replacement value for that node (i.e., replacing the subtree), or indicates\n * that the node should be processed recursively.\n */\nexport function deepMap(input: any, mapFn: (x: any) => DeepMapResult): any|\n any[] {\n return deepMapInternal(input, mapFn);\n}\n\n/**\n * @param seen: A Map of known object mappings (i.e., memoized results of\n * `mapFn()`)\n * @param containedIn: An set containing objects on the reference path currently\n * being processed (used to detect cycles).\n */\nfunction deepMapInternal(\n input: any, mapFn: (x: any) => DeepMapResult,\n seen: Map = new Map(), containedIn: Set<{}> = new Set()): any|\n any[] {\n if (input == null) {\n return null;\n }\n if (containedIn.has(input)) {\n throw new Error('Circular references are not supported.');\n }\n if (seen.has(input)) {\n return seen.get(input);\n }\n const result = mapFn(input);\n\n if (result.recurse && result.value !== null) {\n throw new Error(\n 'A deep map function may not return both a value and recurse=true.');\n }\n\n if (!result.recurse) {\n seen.set(input, result.value);\n return result.value;\n } else if (isIterable(input)) {\n // tslint:disable-next-line:no-any\n const mappedIterable: any|any[] = Array.isArray(input) ? [] : {};\n containedIn.add(input);\n for (const k in input) {\n const child = input[k];\n const childResult = deepMapInternal(child, mapFn, seen, containedIn);\n mappedIterable[k] = childResult;\n }\n containedIn.delete(input);\n return mappedIterable;\n } else {\n throw new Error(`Can't recurse into non-iterable type: ${input}`);\n }\n}\n\n// TODO(soergel, kangyizhang) Reconsider naming of deepZip() to avoid confusion\n// with zip()\n\n/**\n * Zip nested structures together in a recursive manner.\n *\n * This has the effect of transposing or pivoting data, e.g. converting it from\n * a row-major representation to a column-major representation.\n *\n * For example, `deepZip([{a: 1, b: 2}, {a: 3, b: 4}])` returns\n * `{a: [1, 3], b: [2, 4]}`.\n *\n * The inputs should all have the same nested structure (i.e., of arrays and\n * dicts). The result is a single object with the same nested structure, where\n * the leaves are arrays collecting the values of the inputs at that location\n * (or, optionally, the result of a custom function applied to those arrays).\n *\n * @param inputs: An array of the objects to zip together.\n * @param zipFn: (optional) A function that expects an array of elements at a\n * single node of the object tree, and returns a `DeepMapResult`. The\n * `DeepMapResult` either provides a result value for that node (i.e.,\n * representing the subtree), or indicates that the node should be processed\n * recursively. The default zipFn recurses as far as possible and places\n * arrays at the leaves.\n */\nexport function deepZip(\n inputs: any[], zipFn: (xs: any[]) => DeepMapResult = zipToList): any|any[] {\n return deepZipInternal(inputs, zipFn);\n}\n\n/**\n * @param containedIn: An set containing objects on the reference path currently\n * being processed (used to detect cycles).\n */\nfunction deepZipInternal(\n inputs: any[], zipFn: (xs: any[]) => DeepMapResult,\n containedIn: Set<{}> = new Set()): any|any[] {\n // The recursion follows the structure of input 0; it's assumed that all the\n // other inputs have the same structure.\n const input = inputs[0];\n if (containedIn.has(input)) {\n throw new Error('Circular references are not supported.');\n }\n const result = zipFn(inputs);\n\n if (result.recurse && result.value !== null) {\n throw new Error(\n 'A deep zip function may not return both a value and recurse=true.');\n }\n\n if (!result.recurse) {\n return result.value;\n } else if (isIterable(input)) {\n // tslint:disable-next-line:no-any\n const mappedIterable: any|any[] = Array.isArray(input) ? [] : {};\n containedIn.add(input);\n for (const k in input) {\n const children = inputs.map(x => x[k]);\n const childResult = deepZipInternal(children, zipFn, containedIn);\n mappedIterable[k] = childResult;\n }\n containedIn.delete(input);\n return mappedIterable;\n } else {\n throw new Error(`Can't recurse into non-iterable type: ${input}`);\n }\n}\n\n// tslint:disable-next-line:no-any\nexport function zipToList(x: any[]): DeepMapResult {\n if (x === null) {\n return null;\n }\n // TODO(soergel): validate array type?\n\n if (isIterable(x[0])) {\n return {value: null, recurse: true};\n } else {\n return {value: x, recurse: false};\n }\n}\n\n/**\n * A return value for an async map function for use with deepMapAndAwaitAll.\n *\n * If recurse is true, the value should be empty, and iteration will continue\n * into the object or array.\n */\nexport type DeepMapAsyncResult = {\n value: Promise,\n recurse: boolean\n};\n\n/**\n * Apply an async mapping function to a nested structure in a recursive manner.\n *\n * This first creates a nested structure of Promises, and then awaits all of\n * those, resulting in a single Promise for a resolved nested structure.\n *\n * The result of the mapping is an object with the same nested structure (i.e.,\n * of arrays and dicts) as the input, except that some subtrees are replaced,\n * according to the results of the mapping function.\n *\n * Mappings are memoized. Thus, if the nested structure contains the same\n * object in multiple positions, the output will contain the same mapped object\n * in those positions. Cycles are not supported, however.\n *\n * @param input: The object to which to apply the mapping function.\n * @param mapFn: A function that expects a single node of the object tree, and\n * returns a `DeepMapAsyncResult`. The `DeepMapAsyncResult` either provides\n * a `Promise` for a replacement value for that node (i.e., replacing the\n * subtree), or indicates that the node should be processed recursively. Note\n * that the decision whether or not to recurse must be made immediately; only\n * the mapped value may be promised.\n */\nexport async function deepMapAndAwaitAll(\n input: any, mapFn: (x: any) => DeepMapAsyncResult): Promise {\n const seen: Map> = new Map();\n\n // First do a normal deepMap, collecting Promises in 'seen' as a side effect.\n deepMapInternal(input, mapFn, seen);\n\n // Replace the Promises in 'seen' in place.\n // Note TypeScript provides no async map iteration, and regular map iteration\n // is broken too, so sadly we have to do Array.from() to make it work.\n // (There's no advantage to Promise.all(), and that would be tricky anyway.)\n for (const key of Array.from(seen.keys())) {\n const value = seen.get(key);\n if (tf.util.isPromise(value)) {\n const mappedValue = await value;\n seen.set(key, mappedValue);\n }\n }\n\n // Normal deepMap again, this time filling in the resolved values.\n // It's unfortunate that we have to do two passes.\n // TODO(soergel): test performance and think harder about a fast solution.\n const result = deepMapInternal(input, mapFn, seen);\n return result;\n}\n\n/**\n * Determine whether the argument is iterable.\n *\n * @returns true if the argument is an array or any non-Tensor object.\n */\n// tslint:disable-next-line:no-any\nexport function isIterable(obj: any): boolean {\n return obj != null && (!ArrayBuffer.isView(obj)) &&\n (Array.isArray(obj) ||\n (typeof obj === 'object' && !(obj instanceof tf.Tensor)));\n}\n\n/**\n * Determine whether the argument can be converted to Tensor.\n *\n * Tensors, primitives, arrays, and TypedArrays all qualify; anything else does\n * not.\n *\n * @returns true if the argument can be converted to Tensor.\n */\n// tslint:disable-next-line:no-any\nexport function canTensorify(obj: any): boolean {\n return obj == null || isPrimitive(obj) || Array.isArray(obj) ||\n (typeof obj === 'object' && (obj instanceof tf.Tensor)) ||\n tf.util.isTypedArray(obj);\n}\n\n/**\n * Returns true if the given `value` is a primitive type. Otherwise returns\n * false. This is equivalant to node util.isPrimitive\n */\nfunction isPrimitive(value: any): boolean {\n return (\n value === null ||\n (typeof value !== 'object' && typeof value !== 'function'));\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport {deepMap, DeepMapResult, isIterable} from './deep_map';\n\nexport function deepClone(container: T): T {\n return deepMap(container, cloneIfTensor);\n}\n\n// tslint:disable-next-line: no-any\nfunction cloneIfTensor(item: any): DeepMapResult {\n if (item instanceof tf.Tensor) {\n return ({value: item.clone(), recurse: false});\n } else if (isIterable(item)) {\n return {value: null, recurse: true};\n } else {\n return {value: item, recurse: false};\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\n/**\n * A ring buffer, providing O(1) FIFO, LIFO, and related operations.\n */\nexport class RingBuffer {\n // Note we store the indices in the range 0 <= index < 2*capacity.\n // This allows us to distinguish the full from the empty case.\n // See https://www.snellman.net/blog/archive/2016-12-13-ring-buffers/\n protected begin = 0; // inclusive\n protected end = 0; // exclusive\n protected doubledCapacity: number;\n\n protected data: T[];\n\n /**\n * Constructs a `RingBuffer`.\n * @param capacity The number of items that the buffer can accomodate.\n */\n constructor(public capacity: number) {\n if (capacity == null) {\n throw new RangeError('Can\\'t create a ring buffer of unknown capacity.');\n }\n if (capacity < 1) {\n throw new RangeError('Can\\'t create ring buffer of capacity < 1.');\n }\n this.data = new Array(capacity);\n this.doubledCapacity = 2 * capacity;\n }\n\n /**\n * Map any index into the range 0 <= index < 2*capacity.\n */\n protected wrap(index: number) {\n // don't trust % on negative numbers\n while (index < 0) {\n index += this.doubledCapacity;\n }\n return index % this.doubledCapacity;\n }\n\n protected get(index: number) {\n if (index < 0) {\n throw new RangeError('Can\\'t get item at a negative index.');\n }\n return this.data[index % this.capacity];\n }\n\n protected set(index: number, value: T) {\n if (index < 0) {\n throw new RangeError('Can\\'t set item at a negative index.');\n }\n this.data[index % this.capacity] = value;\n }\n\n /**\n * Returns the current number of items in the buffer.\n */\n length(): number {\n let length = this.end - this.begin;\n if (length < 0) {\n length = this.doubledCapacity + length;\n }\n return length;\n }\n\n /**\n * Reports whether the buffer is full.\n * @returns true if the number of items in the buffer equals its capacity, and\n * false otherwise.\n */\n isFull() {\n return this.length() === this.capacity;\n }\n\n /**\n * Reports whether the buffer is empty.\n * @returns true if the number of items in the buffer equals zero, and\n * false otherwise.\n */\n isEmpty() {\n return this.length() === 0;\n }\n\n /**\n * Adds an item to the end of the buffer.\n */\n push(value: T) {\n if (this.isFull()) {\n throw new RangeError('Ring buffer is full.');\n }\n this.set(this.end, value);\n this.end = this.wrap(this.end + 1);\n }\n\n /**\n * Adds many items to the end of the buffer, in order.\n */\n pushAll(values: T[]) {\n for (const value of values) {\n this.push(value);\n }\n }\n\n /**\n * Removes and returns the last item in the buffer.\n */\n pop(): T {\n if (this.isEmpty()) {\n throw new RangeError('Ring buffer is empty.');\n }\n this.end = this.wrap(this.end - 1);\n const result = this.get(this.end);\n this.set(this.end, undefined);\n return result;\n }\n\n /**\n * Adds an item to the beginning of the buffer.\n */\n unshift(value: T) {\n if (this.isFull()) {\n throw new RangeError('Ring buffer is full.');\n }\n this.begin = this.wrap(this.begin - 1);\n this.set(this.begin, value);\n }\n\n /**\n * Removes and returns the first item in the buffer.\n */\n shift(): T {\n if (this.isEmpty()) {\n throw new RangeError('Ring buffer is empty.');\n }\n const result = this.get(this.begin);\n this.set(this.begin, undefined);\n this.begin = this.wrap(this.begin + 1);\n return result;\n }\n\n /**\n * Removes and returns a specific item in the buffer, and moves the last item\n * to the vacated slot. This is useful for implementing a shuffling stream.\n * Note that this operation necessarily scrambles the original order.\n *\n * @param relativeIndex: the index of the item to remove, relative to the\n * first item in the buffer (e.g., hiding the ring nature of the underlying\n * storage).\n */\n shuffleExcise(relativeIndex: number): T {\n if (this.isEmpty()) {\n throw new RangeError('Ring buffer is empty.');\n }\n const index = this.wrap(this.begin + relativeIndex);\n const result = this.get(index);\n this.set(index, this.pop());\n return result;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {RingBuffer} from './ring_buffer';\n\nexport class GrowingRingBuffer extends RingBuffer {\n private static INITIAL_CAPACITY = 32;\n\n /**\n * Constructs a `GrowingRingBuffer`.\n */\n constructor() {\n super(GrowingRingBuffer.INITIAL_CAPACITY);\n }\n\n isFull() {\n return false;\n }\n\n push(value: T) {\n if (super.isFull()) {\n this.expand();\n }\n super.push(value);\n }\n\n unshift(value: T) {\n if (super.isFull()) {\n this.expand();\n }\n super.unshift(value);\n }\n\n /**\n * Doubles the capacity of the buffer.\n */\n private expand() {\n const newCapacity = this.capacity * 2;\n const newData = new Array(newCapacity);\n const len = this.length();\n\n // Rotate the buffer to start at index 0 again, since we can't just\n // allocate more space at the end.\n for (let i = 0; i < len; i++) {\n newData[i] = this.get(this.wrap(this.begin + i));\n }\n\n this.data = newData;\n this.capacity = newCapacity;\n this.doubledCapacity = 2 * this.capacity;\n this.begin = 0;\n this.end = len;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport * as seedrandom from 'seedrandom';\n\nimport {Container} from '../types';\nimport {deepClone} from '../util/deep_clone';\nimport {deepMapAndAwaitAll, DeepMapAsyncResult, DeepMapResult, deepZip, zipToList} from '../util/deep_map';\nimport {GrowingRingBuffer} from '../util/growing_ring_buffer';\nimport {RingBuffer} from '../util/ring_buffer';\n\n/**\n * A nested structure of LazyIterators, used as the input to zip().\n */\nexport type IteratorContainer = Container>;\n\n// Here we implement a simple asynchronous iterator.\n// This lets us avoid using either third-party stream libraries or\n// recent TypeScript language support requiring polyfills.\n\n/**\n * Create a `LazyIterator` from an array of items.\n */\nexport function iteratorFromItems(items: T[]): LazyIterator {\n return new ArrayIterator(items);\n}\n\n/**\n * Create a `LazyIterator` of incrementing integers.\n */\nexport function iteratorFromIncrementing(start: number): LazyIterator {\n let i = start;\n return iteratorFromFunction(() => ({value: i++, done: false}));\n}\n\n/**\n * Create a `LazyIterator` from a function.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const iter = tf.data.iteratorFromFunction(func);\n * await iter.forEachAsync(e => console.log(e));\n * ```\n *\n * @param func A function that produces data on each call.\n */\nexport function iteratorFromFunction(\n func: () =>\n IteratorResult| Promise>): LazyIterator {\n return new FunctionCallIterator(func);\n}\n\n/**\n * Create a `LazyIterator` by concatenating underlying streams, which are\n * themselves provided as a stream.\n *\n * This can also be thought of as a \"stream flatten\" operation.\n *\n * @param baseIterators A stream of streams to be concatenated.\n * @param baseErrorHandler An optional function that can intercept `Error`s\n * raised during a `next()` call on the base stream. This function can decide\n * whether the error should be propagated, whether the error should be\n * ignored, or whether the base stream should be terminated.\n */\nexport function iteratorFromConcatenated(\n baseIterators: LazyIterator>,\n baseErrorHandler?: (e: Error) => boolean): LazyIterator {\n return new ChainedIterator(baseIterators, baseErrorHandler);\n}\n\n/**\n * Create a `LazyIterator` by concatenating streams produced by calling a\n * stream-generating function a given number of times.\n *\n * Since a `LazyIterator` is read-once, it cannot be repeated, but this\n * function can be used to achieve a similar effect:\n *\n * LazyIterator.ofConcatenatedFunction(() => new MyIterator(), 6);\n *\n * @param iteratorFunc: A function that produces a new stream on each call.\n * @param count: The number of times to call the function.\n * @param baseErrorHandler An optional function that can intercept `Error`s\n * raised during a `next()` call on the base stream. This function can decide\n * whether the error should be propagated, whether the error should be\n * ignored, or whether the base stream should be terminated.\n */\nexport function iteratorFromConcatenatedFunction(\n iteratorFunc: () => IteratorResult>, count: number,\n baseErrorHandler?: (e: Error) => boolean): LazyIterator {\n return iteratorFromConcatenated(\n iteratorFromFunction(iteratorFunc).take(count), baseErrorHandler);\n}\n\n/**\n * Create a `LazyIterator` by zipping together an array, dict, or nested\n * structure of `LazyIterator`s (and perhaps additional constants).\n *\n * The underlying streams must provide elements in a consistent order such\n * that they correspond.\n *\n * Typically, the underlying streams should have the same number of\n * elements. If they do not, the behavior is determined by the\n * `mismatchMode` argument.\n *\n * The nested structure of the `iterators` argument determines the\n * structure of elements in the resulting iterator.\n *\n * @param iterators: An array or object containing LazyIterators at the\n * leaves.\n * @param mismatchMode: Determines what to do when one underlying iterator\n * is exhausted before the others. `ZipMismatchMode.FAIL` (the default)\n * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST`\n * causes the zipped iterator to terminate with the furst underlying\n * streams, so elements remaining on the longer streams are ignored.\n * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling\n * in nulls for the exhausted streams, until all streams are exhausted.\n */\nexport function iteratorFromZipped(\n iterators: IteratorContainer,\n mismatchMode: ZipMismatchMode = ZipMismatchMode.FAIL): LazyIterator {\n return new ZipIterator(iterators, mismatchMode);\n}\n\n/**\n * An asynchronous iterator, providing lazy access to a potentially\n * unbounded stream of elements.\n *\n * Iterator can be obtained from a dataset:\n * `const iter = await dataset.iterator();`\n */\nexport abstract class LazyIterator {\n // This class implements AsyncIterator, but we have not yet set the\n // TypeScript --downlevelIteration flag to enable that.\n\n abstract summary(): string;\n\n /**\n * Returns a `Promise` for the next element in the stream.\n *\n * When an item can be provided successfully, the return value is\n * `{value:T, done:false}`.\n *\n * Calling next() on a closed stream returns `{value:null, done:true}`.\n */\n abstract async next(): Promise>;\n\n /**\n * Collect all remaining elements of a bounded stream into an array.\n * Obviously this will succeed only for small streams that fit in memory.\n * Useful for testing.\n *\n * @returns A Promise for an array of stream elements, which will resolve\n * when the stream is exhausted.\n */\n async toArray(): Promise {\n const result: T[] = [];\n let x = await this.next();\n while (!x.done) {\n result.push(x.value);\n x = await this.next();\n }\n return result;\n }\n\n /**\n * Collect all elements of this dataset into an array with prefetching 100\n * elements. This is useful for testing, because the prefetch changes the\n * order in which the Promises are resolved along the processing pipeline.\n * This may help expose bugs where results are dependent on the order of\n * Promise resolution rather than on the logical order of the stream (i.e.,\n * due to hidden mutable state).\n *\n * @returns A Promise for an array of stream elements, which will resolve\n * when the stream is exhausted.\n */\n async toArrayForTest(): Promise {\n const stream = this.prefetch(100);\n const result: T[] = [];\n let x = await stream.next();\n while (!x.done) {\n result.push(x.value);\n x = await stream.next();\n }\n return result;\n }\n\n /**\n * Draw items from the stream until it is exhausted.\n *\n * This can be useful when the stream has side effects but no output. In\n * that case, calling this function guarantees that the stream will be\n * fully processed.\n */\n async resolveFully(): Promise {\n let x = await this.next();\n while (!x.done) {\n x = await this.next();\n }\n }\n\n /**\n * Draw items from the stream until it is exhausted, or a predicate fails.\n *\n * This can be useful when the stream has side effects but no output. In\n * that case, calling this function guarantees that the stream will be\n * fully processed.\n */\n async resolveWhile(predicate: (r: T) => boolean): Promise {\n let x = await this.next();\n let shouldContinue = predicate(x.value);\n while ((!x.done) && shouldContinue) {\n x = await this.next();\n shouldContinue = predicate(x.value);\n }\n }\n\n /**\n * Handles errors thrown on this stream using a provided handler function.\n *\n * @param handler A function that handles any `Error` thrown during a `next()`\n * call and returns true if the stream should continue (dropping the failed\n * call) or false if the stream should quietly terminate. If the handler\n * itself throws (or rethrows) an `Error`, that will be propagated.\n *\n * @returns A `LazyIterator` of elements passed through from upstream,\n * possibly filtering or terminating on upstream `next()` calls that\n * throw an `Error`.\n */\n handleErrors(handler: (error: Error) => boolean): LazyIterator {\n return new ErrorHandlingLazyIterator(this, handler);\n }\n\n // TODO(soergel): Implement reduce() etc.\n\n /**\n * Filters this stream according to `predicate`.\n *\n * @param predicate A function mapping a stream element to a boolean or a\n * `Promise` for one.\n *\n * @returns A `LazyIterator` of elements for which the predicate was true.\n */\n filter(predicate: (value: T) => boolean): LazyIterator {\n return new FilterIterator(this, predicate);\n }\n\n /**\n * Maps this stream through a 1-to-1 transform.\n *\n * @param transform A function mapping a stream element to a transformed\n * element.\n *\n * @returns A `LazyIterator` of transformed elements.\n */\n map(transform: (value: T) => O): LazyIterator {\n return new MapIterator(this, transform);\n }\n\n /**\n * Maps this stream through an async 1-to-1 transform.\n *\n * @param transform A function mapping a stream element to a `Promise` for a\n * transformed stream element.\n *\n * @returns A `LazyIterator` of transformed elements.\n */\n mapAsync(transform: (value: T) => Promise): LazyIterator {\n return new AsyncMapIterator(this, transform);\n }\n\n /**\n * Maps this stream through a 1-to-1 transform, forcing serial execution.\n *\n * @param transform A function mapping a stream element to a transformed\n * element.\n *\n * @returns A `LazyIterator` of transformed elements.\n */\n serialMapAsync(transform: (value: T) => Promise): LazyIterator {\n return new AsyncMapIterator(this, transform).serial();\n }\n\n /**\n * Maps this stream through a 1-to-many transform.\n *\n * @param transform A function mapping a stream element to an array of\n * transformed elements.\n *\n * @returns A `DataStream` of transformed elements.\n */\n flatmap(transform: (value: T) => O[]): LazyIterator {\n return new FlatmapIterator(this, transform);\n }\n\n /**\n * Apply a function to every element of the stream.\n *\n * @param f A function to apply to each stream element.\n */\n async forEachAsync(f: (value: T) => void): Promise {\n return this.map(f).resolveFully();\n }\n\n /**\n * Apply a function to every element of the stream, forcing serial execution.\n *\n * @param f A function to apply to each stream element. Should return 'true'\n * to indicate that the stream should continue, or 'false' to cause it to\n * terminate.\n */\n async serialForEach(f: (value: T) => Promise): Promise {\n return this.serialMapAsync(f).resolveWhile(x => (x === true));\n }\n\n /**\n * Groups elements into batches, represented as arrays of elements.\n *\n * We can think of the elements of this iterator as 'rows' (even if they are\n * nested structures). By the same token, consecutive values for a given\n * key within the elements form a 'column'. This matches the usual sense of\n * 'row' and 'column' when processing tabular data (e.g., parsing a CSV).\n *\n * Thus, \"Row-major\" means that the resulting batch is simply a collection of\n * rows: `[row1, row2, row3, ...]`. This is contrast to the column-major\n * form, which is needed for vectorized computation.\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @returns A `LazyIterator` of batches of elements, represented as arrays\n * of the original element type.\n */\n rowMajorBatch(batchSize: number, smallLastBatch = true): LazyIterator {\n return new RowMajorBatchIterator(this, batchSize, smallLastBatch);\n }\n\n /**\n * Groups elements into batches, represented in column-major form.\n *\n * We can think of the elements of this iterator as 'rows' (even if they are\n * nested structures). By the same token, consecutive values for a given\n * key within the elements form a 'column'. This matches the usual sense of\n * 'row' and 'column' when processing tabular data (e.g., parsing a CSV).\n *\n * Thus, \"column-major\" means that the resulting batch is a (potentially\n * nested) structure representing the columns. Each column entry, then,\n * contains a collection of the values found in that column for a range of\n * input elements. This representation allows for vectorized computation, in\n * contrast to the row-major form.\n *\n * The inputs should all have the same nested structure (i.e., of arrays and\n * dicts). The result is a single object with the same nested structure,\n * where the leaves are arrays collecting the values of the inputs at that\n * location (or, optionally, the result of a custom function applied to those\n * arrays).\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @param zipFn: (optional) A function that expects an array of elements at a\n * single node of the object tree, and returns a `DeepMapResult`. The\n * `DeepMapResult` either provides a result value for that node (i.e.,\n * representing the subtree), or indicates that the node should be processed\n * recursively. The default zipFn recurses as far as possible and places\n * arrays at the leaves.\n * @returns A `LazyIterator` of batches of elements, represented as an object\n * with collections at the leaves.\n */\n columnMajorBatch(\n batchSize: number, smallLastBatch = true,\n // tslint:disable-next-line:no-any\n zipFn: (xs: any[]) => DeepMapResult = zipToList):\n LazyIterator {\n // First collect the desired number of input elements as a row-major batch.\n const rowBatches = this.rowMajorBatch(batchSize, smallLastBatch);\n // Now 'rotate' or 'pivot' the data, collecting all values from each column\n // in the batch (i.e., for each key within the elements) into an array.\n return rowBatches.map(x => deepZip(x, zipFn));\n }\n\n /**\n * Concatenate this `LazyIterator` with another.\n *\n * @param iterator A `LazyIterator` to be concatenated onto this one.\n * @param baseErrorHandler An optional function that can intercept `Error`s\n * raised during a `next()` call on the base stream. This function can\n * decide whether the error should be propagated, whether the error should\n * be ignored, or whether the base stream should be terminated.\n * @returns A `LazyIterator`.\n */\n concatenate(\n iterator: LazyIterator,\n baseErrorHandler?: (e: Error) => boolean): LazyIterator {\n return new ChainedIterator(\n iteratorFromItems([this, iterator]), baseErrorHandler);\n }\n\n /**\n * Limits this stream to return at most `count` items.\n *\n * @param count The maximum number of items to provide from the stream. If\n * a negative or undefined value is given, the entire stream is returned\n * unaltered.\n */\n take(count: number): LazyIterator {\n if (count < 0 || count == null) {\n return this;\n }\n return new TakeIterator(this, count);\n }\n\n /**\n * Skips the first `count` items in this stream.\n *\n * @param count The number of items to skip. If a negative or undefined\n * value is given, the entire stream is returned unaltered.\n */\n skip(count: number): LazyIterator {\n if (count < 0 || count == null) {\n return this;\n }\n return new SkipIterator(this, count);\n }\n\n /**\n * Prefetch the first `bufferSize` items in this stream.\n *\n * Note this prefetches Promises, but makes no guarantees about when those\n * Promises resolve.\n *\n * @param bufferSize: An integer specifying the number of elements to be\n * prefetched.\n */\n prefetch(bufferSize: number): LazyIterator {\n return new PrefetchIterator(this, bufferSize);\n }\n\n // TODO(soergel): deep sharded shuffle, where supported\n\n /**\n * Randomly shuffles the elements of this stream.\n *\n * @param bufferSize: An integer specifying the number of elements from\n * this stream from which the new stream will sample.\n * @param seed: (Optional.) An integer specifying the random seed that\n * will be used to create the distribution.\n */\n shuffle(windowSize: number, seed?: string): LazyIterator {\n return new ShuffleIterator(this, windowSize, seed);\n }\n\n /**\n * Force an iterator to execute serially: each next() call will await the\n * prior one, so that they cannot execute concurrently.\n */\n serial(): LazyIterator {\n return new SerialIterator(this);\n }\n}\n\n// ============================================================================\n// The following private classes serve to implement the chainable methods\n// on LazyIterator. Unfortunately they can't be placed in separate files,\n// due to resulting trouble with circular imports.\n// ============================================================================\n\n// Iterators that just extend LazyIterator directly\n// ============================================================================\n\nclass ArrayIterator extends LazyIterator {\n private trav = 0;\n constructor(protected items: T[]) {\n super();\n }\n\n summary() {\n return `Array of ${this.items.length} items`;\n }\n\n async next(): Promise> {\n if (this.trav >= this.items.length) {\n return {value: null, done: true};\n }\n const item = this.items[this.trav];\n this.trav++;\n return {value: deepClone(item), done: false};\n }\n}\n\nclass FunctionCallIterator extends LazyIterator {\n constructor(\n protected nextFn: () => IteratorResult| Promise>) {\n super();\n }\n\n summary() {\n return `Function call`;\n }\n\n async next(): Promise> {\n try {\n return this.nextFn();\n } catch (e) {\n // Modify the error message but leave the stack trace intact\n e.message =\n `Error thrown while iterating through a dataset: ${e.message}`;\n throw e;\n }\n }\n}\n\nclass SerialIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n constructor(protected upstream: LazyIterator) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> Serial`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n return this.upstream.next();\n }\n}\n\nclass SkipIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n // Local state that should not be clobbered by out-of-order execution.\n count = 0;\n\n constructor(protected upstream: LazyIterator, protected maxCount: number) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> Skip`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n // TODO(soergel): consider tradeoffs of reading in parallel, eg.\n // collecting next() promises in an Array and then waiting for\n // Promise.all() of those. Benefit: pseudo-parallel execution. Drawback:\n // maybe delayed GC.\n while (this.count++ < this.maxCount) {\n const skipped = await this.upstream.next();\n // short-circuit if upstream is already empty\n if (skipped.done) {\n return skipped;\n }\n tf.dispose(skipped.value as {});\n }\n return this.upstream.next();\n }\n}\n\nclass TakeIterator extends LazyIterator {\n count = 0;\n constructor(protected upstream: LazyIterator, protected maxCount: number) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Take`;\n }\n\n async next(): Promise> {\n if (this.count++ >= this.maxCount) {\n return {value: null, done: true};\n }\n return this.upstream.next();\n }\n}\n\n// Note this batch just groups items into row-wise element arrays.\n// Rotating these to a column-wise representation happens only at the dataset\n// level.\nclass RowMajorBatchIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n constructor(\n protected upstream: LazyIterator, protected batchSize: number,\n protected enableSmallLastBatch = true) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> RowMajorBatch`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n const batch: T[] = [];\n while (batch.length < this.batchSize) {\n const item = await this.upstream.next();\n if (item.done) {\n if (this.enableSmallLastBatch && batch.length > 0) {\n return {value: batch, done: false};\n }\n return {value: null, done: true};\n }\n batch.push(item.value);\n }\n return {value: batch, done: false};\n }\n}\n\nclass FilterIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n constructor(\n protected upstream: LazyIterator,\n protected predicate: (value: T) => boolean) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> Filter`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n while (true) {\n const item = await this.upstream.next();\n if (item.done || this.predicate(item.value)) {\n return item;\n }\n tf.dispose(item.value as {});\n }\n }\n}\n\nclass MapIterator extends LazyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected transform: (value: I) => O) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Map`;\n }\n\n async next(): Promise> {\n const item = await this.upstream.next();\n if (item.done) {\n return {value: null, done: true};\n }\n const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {});\n // Careful: the transform may mutate the item in place.\n // That's why we have to remember the input Tensors above, and then\n // below dispose only those that were not passed through to the output.\n // Note too that the transform function is responsible for tidying\n // any intermediate Tensors. Here we are concerned only about the\n // inputs.\n const mapped = this.transform(item.value);\n const outputTensors = tf.tensor_util.getTensorsInContainer(mapped as {});\n\n // TODO(soergel) faster intersection\n // TODO(soergel) move to tf.disposeExcept(in, out)?\n for (const t of inputTensors) {\n if (!tf.tensor_util.isTensorInList(t, outputTensors)) {\n t.dispose();\n }\n }\n return {value: mapped, done: false};\n }\n}\n\nclass ErrorHandlingLazyIterator extends LazyIterator {\n count = 0;\n constructor(\n protected upstream: LazyIterator,\n protected handler: (error: Error) => boolean) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> handleErrors`;\n }\n\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n async serialNext(): Promise> {\n while (true) {\n try {\n return await this.upstream.next();\n } catch (e) {\n if (!this.handler(e)) {\n return {value: null, done: true};\n }\n // If the handler returns true, loop and fetch the next upstream item.\n\n // If the upstream iterator throws an endless stream of errors, and if\n // the handler says to ignore them, then we loop forever here. That is\n // the correct behavior-- it's up to the handler to decide when to stop.\n }\n }\n }\n}\n\nclass AsyncMapIterator extends LazyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected transform: (value: I) => Promise) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> AsyncMap`;\n }\n\n async next(): Promise> {\n const item = await this.upstream.next();\n if (item.done) {\n return {value: null, done: true};\n }\n const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {});\n // Careful: the transform may mutate the item in place.\n // That's why we have to remember the input Tensors above, and then\n // below dispose only those that were not passed through to the output.\n // Note too that the transform function is responsible for tidying\n // any intermediate Tensors. Here we are concerned only about the\n // inputs.\n const mapped = await this.transform(item.value);\n const outputTensors = tf.tensor_util.getTensorsInContainer(mapped as {});\n\n // TODO(soergel) faster intersection\n // TODO(soergel) move to tf.disposeExcept(in, out)?\n for (const t of inputTensors) {\n if (!tf.tensor_util.isTensorInList(t, outputTensors)) {\n t.dispose();\n }\n }\n return {value: mapped, done: false};\n }\n}\n\n// Iterators that maintain a queue of pending items\n// ============================================================================\n\n/**\n * A base class for transforming streams that operate by maintaining an\n * output queue of elements that are ready to return via next(). This is\n * commonly required when the transformation is 1-to-many: A call to next()\n * may trigger a call to the underlying stream, which will produce many\n * mapped elements of this stream-- of which we need to return only one, so\n * we have to queue the rest.\n */\nexport abstract class OneToManyIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n // Local state that should not be clobbered by out-of-order execution.\n protected outputQueue: RingBuffer;\n\n constructor() {\n super();\n this.outputQueue = new GrowingRingBuffer();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n /**\n * Read one or more chunks from upstream and process them, possibly\n * reading or writing a carryover, and adding processed items to the\n * output queue. Note it's possible that no items are added to the queue\n * on a given pump() call, even if the upstream stream is not closed\n * (e.g., because items are filtered).\n *\n * @return `true` if any action was taken, i.e. fetching items from the\n * upstream source OR adding items to the output queue. `false` if the\n * upstream source is exhausted AND nothing was added to the queue\n * (i.e., any remaining carryover).\n */\n protected abstract async pump(): Promise;\n\n async serialNext(): Promise> {\n // Fetch so that the queue contains at least one item if possible.\n // If the upstream source is exhausted, AND there are no items left in\n // the output queue, then this stream is also exhausted.\n while (this.outputQueue.length() === 0) {\n // TODO(soergel): consider parallel reads.\n if (!await this.pump()) {\n return {value: null, done: true};\n }\n }\n return {value: this.outputQueue.shift(), done: false};\n }\n}\nclass FlatmapIterator extends OneToManyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected transform: (value: I) => O[]) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Flatmap`;\n }\n\n async pump(): Promise {\n const item = await this.upstream.next();\n if (item.done) {\n return false;\n }\n const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {});\n // Careful: the transform may mutate the item in place.\n // that's why we have to remember the input Tensors above, and then\n // below dispose only those that were not passed through to the output.\n // Note too that the transform function is responsible for tidying any\n // intermediate Tensors. Here we are concerned only about the inputs.\n const mappedArray = this.transform(item.value);\n const outputTensors =\n tf.tensor_util.getTensorsInContainer(mappedArray as {});\n this.outputQueue.pushAll(mappedArray);\n\n // TODO(soergel) faster intersection, and deduplicate outputTensors\n // TODO(soergel) move to tf.disposeExcept(in, out)?\n for (const t of inputTensors) {\n if (!tf.tensor_util.isTensorInList(t, outputTensors)) {\n t.dispose();\n }\n }\n\n return true;\n }\n}\n\n/**\n * Provides a `LazyIterator` that concatenates a stream of underlying\n * streams.\n *\n * Doing this in a concurrency-safe way requires some trickery. In\n * particular, we want this stream to return the elements from the\n * underlying streams in the correct order according to when next() was\n * called, even if the resulting Promises resolve in a different order.\n */\nexport class ChainedIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise> = null;\n\n // Local state that should not be clobbered by out-of-order execution.\n private iterator: LazyIterator = null;\n private moreIterators: LazyIterator>;\n\n constructor(\n iterators: LazyIterator>,\n private readonly baseErrorHandler?: (e: Error) => boolean) {\n super();\n this.moreIterators = iterators;\n }\n\n summary() {\n const upstreamSummaries = 'TODO: fill in upstream of chained summaries';\n return `${upstreamSummaries} -> Chained`;\n }\n\n async next(): Promise> {\n this.lastRead = this.readFromChain(this.lastRead);\n return this.lastRead;\n }\n\n private async readFromChain(lastRead: Promise>):\n Promise> {\n // Must await on the previous read since the previous read may have advanced\n // the stream of streams, from which we need to read.\n // This is unfortunate since we can't parallelize reads. Which means\n // prefetching of chained streams is a no-op.\n // One solution is to prefetch immediately upstream of this.\n await lastRead;\n if (this.iterator == null) {\n const iteratorResult = await this.moreIterators.next();\n if (iteratorResult.done) {\n // No more streams to stream from.\n return {value: null, done: true};\n }\n this.iterator = iteratorResult.value;\n if (this.baseErrorHandler != null) {\n this.iterator = this.iterator.handleErrors(this.baseErrorHandler);\n }\n }\n const itemResult = await this.iterator.next();\n if (itemResult.done) {\n this.iterator = null;\n return this.readFromChain(lastRead);\n }\n return itemResult;\n }\n}\n\nexport enum ZipMismatchMode {\n FAIL, // require zipped streams to have the same length\n SHORTEST, // terminate zip when the first stream is exhausted\n LONGEST // use nulls for exhausted streams; use up the longest stream.\n}\n\n/**\n * Provides a `LazyIterator` that zips together an array, dict, or nested\n * structure of `LazyIterator`s (and perhaps additional constants).\n *\n * The underlying streams must provide elements in a consistent order such\n * that they correspond.\n *\n * Typically, the underlying streams should have the same number of\n * elements. If they do not, the behavior is determined by the\n * `mismatchMode` argument.\n *\n * The nested structure of the `iterators` argument determines the\n * structure of elements in the resulting iterator.\n *\n * Doing this in a concurrency-safe way requires some trickery. In\n * particular, we want this stream to return the elements from the\n * underlying streams in the correct order according to when next() was\n * called, even if the resulting Promises resolve in a different order.\n *\n * @param iterators: An array or object containing LazyIterators at the\n * leaves.\n * @param mismatchMode: Determines what to do when one underlying iterator\n * is exhausted before the others. `ZipMismatchMode.FAIL` (the default)\n * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST`\n * causes the zipped iterator to terminate with the furst underlying\n * streams, so elements remaining on the longer streams are ignored.\n * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling\n * in nulls for the exhausted streams, until all streams are exhausted.\n */\nclass ZipIterator extends LazyIterator {\n private count = 0;\n private currentPromise: Promise> = null;\n\n constructor(\n protected readonly iterators: IteratorContainer,\n protected readonly mismatchMode: ZipMismatchMode = ZipMismatchMode.FAIL) {\n super();\n }\n\n summary() {\n const upstreamSummaries = 'TODO: fill in upstream of zip summaries';\n return `{${upstreamSummaries}} -> Zip`;\n }\n\n private async nextState(afterState: Promise>):\n Promise> {\n // This chaining ensures that the underlying next() are not even called\n // before the previous ones have resolved.\n await afterState;\n\n // Collect underlying iterator \"done\" signals as a side effect in\n // getNext()\n let numIterators = 0;\n let iteratorsDone = 0;\n\n function getNext(container: IteratorContainer): DeepMapAsyncResult {\n if (container instanceof LazyIterator) {\n const result = container.next();\n return {\n value: result.then(x => {\n numIterators++;\n if (x.done) {\n iteratorsDone++;\n }\n return x.value;\n }),\n recurse: false\n };\n } else {\n return {value: null, recurse: true};\n }\n }\n\n const mapped: O = await deepMapAndAwaitAll(this.iterators, getNext);\n\n if (numIterators === iteratorsDone) {\n // The streams have all ended.\n return {value: null, done: true};\n }\n if (iteratorsDone > 0) {\n switch (this.mismatchMode) {\n case ZipMismatchMode.FAIL:\n throw new Error(\n 'Zipped streams should have the same length. ' +\n `Mismatched at element ${this.count}.`);\n case ZipMismatchMode.SHORTEST:\n return {value: null, done: true};\n case ZipMismatchMode.LONGEST:\n default:\n // Continue. The exhausted streams already produced value: null.\n }\n }\n\n this.count++;\n return {value: mapped, done: false};\n }\n\n async next(): Promise> {\n this.currentPromise = this.nextState(this.currentPromise);\n return this.currentPromise;\n }\n}\n\n// Iterators that maintain a ring buffer of pending promises\n// ============================================================================\n\n/**\n * A stream that prefetches a given number of items from an upstream source,\n * returning them in FIFO order.\n *\n * Note this prefetches Promises, but makes no guarantees about when those\n * Promises resolve.\n */\nexport class PrefetchIterator extends LazyIterator {\n protected buffer: RingBuffer>>;\n\n constructor(\n protected upstream: LazyIterator, protected bufferSize: number) {\n super();\n this.buffer = new RingBuffer>>(bufferSize);\n }\n\n summary() {\n return `${this.upstream.summary()} -> Prefetch`;\n }\n\n /**\n * Refill the prefetch buffer. Returns only after the buffer is full, or\n * the upstream source is exhausted.\n */\n protected refill() {\n while (!this.buffer.isFull()) {\n const v = this.upstream.next();\n this.buffer.push(v);\n }\n }\n\n next(): Promise> {\n this.refill();\n // This shift will never throw an error because the buffer is always\n // full after a refill. If the stream is exhausted, the buffer will be\n // full of Promises that will resolve to the end-of-stream signal.\n return this.buffer.shift();\n }\n}\n\n/**\n * A stream that performs a sliding-window random shuffle on an upstream\n * source. This is like a `PrefetchIterator` except that the items are\n * returned in randomized order. Mixing naturally improves as the buffer\n * size increases.\n */\nexport class ShuffleIterator extends PrefetchIterator {\n private readonly random: seedrandom.prng;\n\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n // Local state that should not be clobbered by out-of-order execution.\n private upstreamExhausted = false;\n\n constructor(\n protected upstream: LazyIterator, protected windowSize: number,\n seed?: string) {\n super(upstream, windowSize);\n this.random = seedrandom.alea(seed || tf.util.now().toString());\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private randomInt(max: number) {\n return Math.floor(this.random() * max);\n }\n\n protected chooseIndex(): number {\n return this.randomInt(this.buffer.length());\n }\n\n async serialNext(): Promise> {\n // TODO(soergel): consider performance\n if (!this.upstreamExhausted) {\n this.refill();\n }\n while (!this.buffer.isEmpty()) {\n const chosenIndex = this.chooseIndex();\n const result = await this.buffer.shuffleExcise(chosenIndex);\n if (result.done) {\n this.upstreamExhausted = true;\n } else {\n this.refill();\n return result;\n }\n }\n return {value: null, done: true};\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport {TensorContainer, TensorLike} from '@tensorflow/tfjs-core';\nimport * as seedrandom from 'seedrandom';\n\nimport {iteratorFromConcatenated, iteratorFromFunction, iteratorFromItems, iteratorFromZipped, LazyIterator, ZipMismatchMode} from './iterators/lazy_iterator';\nimport {Container} from './types';\nimport {canTensorify, deepMapAndAwaitAll, DeepMapResult, isIterable} from './util/deep_map';\n\n/**\n * A nested structure of Datasets, used as the input to zip().\n */\nexport type DatasetContainer = Container>;\n\n// TODO(soergel): consider vectorized operations within the pipeline.\n\n/**\n * Represents a potentially large list of independent data elements (typically\n * 'samples' or 'examples').\n *\n * A 'data example' may be a primitive, an array, a map from string keys to\n * values, or any nested structure of these.\n *\n * A `Dataset` represents an ordered collection of elements, together with a\n * chain of transformations to be performed on those elements. Each\n * transformation is a method of `Dataset` that returns another `Dataset`, so\n * these may be chained, e.g.\n * `const processedDataset = rawDataset.filter(...).map(...).batch(...)`.\n *\n * Data loading and transformation is done in a lazy, streaming fashion. The\n * dataset may be iterated over multiple times; each iteration starts the data\n * loading anew and recapitulates the transformations.\n *\n * A `Dataset` is typically processed as a stream of unbatched examples --i.e.,\n * its transformations are applied one example at a time. Batching produces a\n * new `Dataset` where each element is a batch. Batching should usually come\n * last in a pipeline, because data transformations are easier to express on a\n * per-example basis than on a per-batch basis.\n *\n * The following code examples are calling `await dataset.forEachAsync(...)` to\n * iterate once over the entire dataset in order to print out the data.\n *\n * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'}\n */\nexport abstract class Dataset {\n /*\n * Provide a new stream of elements. Note this will also start new streams\n * from any underlying `Dataset`s.\n *\n * CAUTION: Any Tensors contained within the elements returned from\n * this stream *must* be manually disposed to avoid a GPU memory leak.\n * The tf.tidy() approach cannot be used in an asynchronous context.\n */\n abstract async iterator(): Promise>;\n\n readonly size: number = null;\n\n // TODO(soergel): Make Datasets report whether repeated iterator() calls\n // produce the same result (e.g., reading from a file) or different results\n // (e.g., from the webcam). Currently we don't make this distinction but it\n // could be important for the user to know.\n // abstract isDeterministic(): boolean;\n\n /**\n * Groups elements into batches.\n *\n * It is assumed that each of the incoming dataset elements has the same\n * structure-- i.e. the same set of keys at each location in an object\n * hierarchy. For each key, the resulting `Dataset` provides a batched\n * element collecting all of the incoming values for that key.\n *\n * * Incoming primitives are grouped into a 1-D Tensor.\n * * Incoming Tensors are grouped into a new Tensor where the 0'th axis is\n * the batch dimension.\n * * Incoming arrays are converted to Tensor and then batched.\n * * A nested array is interpreted as an n-D Tensor, so the batched result\n * has n+1 dimensions.\n * * An array that cannot be converted to Tensor produces an error.\n *\n * If an array should not be batched as a unit, it should first be converted\n * to an object with integer keys.\n *\n * Here are a few examples:\n *\n * Batch a dataset of numbers:\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8]).batch(4);\n * await a.forEachAsync(e => e.print());\n * ```\n *\n * Batch a dataset of arrays:\n * ```js\n * const b = tf.data.array([[1], [2], [3], [4], [5], [6], [7], [8]]).batch(4);\n * await b.forEachAsync(e => e.print());\n * ```\n *\n * Batch a dataset of objects:\n * ```js\n * const c = tf.data.array([{a: 1, b: 11}, {a: 2, b: 12}, {a: 3, b: 13},\n * {a: 4, b: 14}, {a: 5, b: 15}, {a: 6, b: 16}, {a: 7, b: 17},\n * {a: 8, b: 18}]).batch(4);\n * await c.forEachAsync(e => {\n * console.log('{');\n * for(var key in e) {\n * console.log(key+':');\n * e[key].print();\n * }\n * console.log('}');\n * })\n * ```\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @returns A `Dataset`, from which a stream of batches can be obtained.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n batch(batchSize: number, smallLastBatch = true): Dataset {\n const base = this;\n tf.util.assert(\n batchSize > 0, () => `batchSize needs to be positive, but it is\n ${batchSize}`);\n let size;\n if (this.size === Infinity || this.size == null) {\n // If the size of this dataset is infinity or null, the new size keeps the\n // same.\n size = this.size;\n } else if (smallLastBatch) {\n // If the size of this dataset is known and include small last batch, the\n // new size is full batch count plus last batch.\n size = Math.ceil(this.size / batchSize);\n } else {\n // If the size of this dataset is known and not include small last batch,\n // the new size is full batch count.\n size = Math.floor(this.size / batchSize);\n }\n return datasetFromIteratorFn(async () => {\n return (await base.iterator())\n .columnMajorBatch(batchSize, smallLastBatch, deepBatchConcat);\n }, size);\n }\n\n /**\n * Concatenates this `Dataset` with another.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]);\n * const b = tf.data.array([4, 5, 6]);\n * const c = a.concatenate(b);\n * await c.forEachAsync(e => console.log(e));\n * ```\n *\n * @param dataset A `Dataset` to be concatenated onto this one.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n concatenate(dataset: Dataset): Dataset {\n const base = this;\n let size;\n if (this.size === Infinity || dataset.size === Infinity) {\n // If the size of any of these two dataset is infinity, new size is\n // infinity.\n size = Infinity;\n } else if (this.size != null && dataset.size != null) {\n // If the size of both datasets are known and not infinity, new size is\n // sum the size of these two datasets.\n size = this.size + dataset.size;\n } else {\n // If neither of these two datasets has infinite size and any of these two\n // datasets' size is null, the new size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () =>\n (await base.iterator()).concatenate(await dataset.iterator()),\n size);\n }\n\n /**\n * Filters this dataset according to `predicate`.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])\n * .filter(x => x%2 === 0);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param predicate A function mapping a dataset element to a boolean or a\n * `Promise` for one.\n *\n * @returns A `Dataset` of elements for which the predicate was true.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n filter(predicate: (value: T) => boolean): Dataset {\n const base = this;\n let size;\n if (this.size === Infinity) {\n // If the size of this dataset is infinity, new size is infinity\n size = Infinity;\n } else {\n // If this dataset has limited elements, new size is null because it might\n // exhausted randomly.\n size = null;\n }\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).filter(x => tf.tidy(() => predicate(x)));\n }, size);\n }\n\n /**\n * Apply a function to every element of the dataset.\n *\n * After the function is applied to a dataset element, any Tensors contained\n * within that element are disposed.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param f A function to apply to each dataset element.\n * @returns A `Promise` that resolves after all elements have been processed.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async forEachAsync(f: (input: T) => void): Promise {\n return (await this.iterator()).forEachAsync(f);\n }\n\n /**\n * Maps this dataset through a 1-to-1 transform.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]).map(x => x*x);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param transform A function mapping a dataset element to a transformed\n * dataset element.\n *\n * @returns A `Dataset` of transformed elements.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n map(transform: (value: T) => O): Dataset {\n const base = this;\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).map(x => tf.tidy(() => transform(x)));\n }, this.size);\n }\n\n /**\n * Maps this dataset through an async 1-to-1 transform.\n *\n * ```js\n * const a =\n * tf.data.array([1, 2, 3]).mapAsync(x => new Promise(function(resolve){\n * setTimeout(() => {\n * resolve(x * x);\n * }, Math.random()*1000 + 500);\n * }));\n * console.log(await a.toArray());\n * ```\n *\n * @param transform A function mapping a dataset element to a `Promise` for a\n * transformed dataset element. This transform is responsible for disposing\n * any intermediate `Tensor`s, i.e. by wrapping its computation in\n * `tf.tidy()`; that cannot be automated here (as it is in the synchronous\n * `map()` case).\n *\n * @returns A `Dataset` of transformed elements.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n mapAsync(transform: (value: T) => Promise):\n Dataset {\n const base = this;\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).mapAsync(transform);\n }, this.size);\n }\n\n /**\n * Creates a `Dataset` that prefetches elements from this dataset.\n *\n * @param bufferSize: An integer specifying the number of elements to be\n * prefetched.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n prefetch(bufferSize: number): Dataset {\n if (bufferSize == null) {\n throw new RangeError(\n '`Dataset.prefetch()` requires bufferSize to be specified.');\n }\n\n const base = this;\n return datasetFromIteratorFn(\n async () => (await base.iterator()).prefetch(bufferSize), this.size);\n }\n\n /**\n * Repeats this dataset `count` times.\n *\n * NOTE: If this dataset is a function of global state (e.g. a random number\n * generator), then different repetitions may produce different elements.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]).repeat(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: (Optional) An integer, representing the number of times\n * the dataset should be repeated. The default behavior (if `count` is\n * `undefined` or negative) is for the dataset be repeated indefinitely.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n repeat(count?: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && count > 0) {\n // If this dataset has size and count is positive, new size is current\n // size multiply count. This also covers the case that current size is\n // infinity.\n size = this.size * count;\n } else if (count === 0) {\n // If count is 0, new size is 0.\n size = 0;\n } else if (this.size != null && (count === undefined || count < 0)) {\n // If this dataset has size and count is undefined or negative, the\n // dataset will be repeated indefinitely and new size is infinity.\n size = Infinity;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(async () => {\n const iteratorIterator = iteratorFromFunction(\n async () => ({value: await base.iterator(), done: false}));\n return iteratorFromConcatenated(iteratorIterator.take(count));\n }, size);\n }\n\n /**\n * Creates a `Dataset` that skips `count` initial elements from this dataset.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).skip(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: The number of elements of this dataset that should be skipped\n * to form the new dataset. If `count` is greater than the size of this\n * dataset, the new dataset will contain no elements. If `count`\n * is `undefined` or negative, skips the entire dataset.\n *\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n skip(count: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && count >= 0 && this.size >= count) {\n // If the size of this dataset is greater than count, the new dataset's\n // size is current size minus skipped size.This also covers the case that\n // current size is infinity.\n size = this.size - count;\n } else if (\n this.size != null &&\n (this.size < count || count === undefined || count < 0)) {\n // If the size of this dataset is smaller than count, or count is\n // undefined or negative, skips the entire dataset and the new size is 0.\n size = 0;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () => (await base.iterator()).skip(count), size);\n }\n\n // TODO(soergel): deep sharded shuffle, where supported\n\n static readonly MAX_BUFFER_SIZE = 10000;\n\n /**\n * Pseudorandomly shuffles the elements of this dataset. This is done in a\n * streaming manner, by sampling from a given number of prefetched elements.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).shuffle(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param bufferSize: An integer specifying the number of elements from this\n * dataset from which the new dataset will sample.\n * @param seed: (Optional) An integer specifying the random seed that will\n * be used to create the distribution.\n * @param reshuffleEachIteration: (Optional) A boolean, which if true\n * indicates that the dataset should be pseudorandomly reshuffled each time\n * it is iterated over. If false, elements will be returned in the same\n * shuffled order on each iteration. (Defaults to `true`.)\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n shuffle(bufferSize: number, seed?: string, reshuffleEachIteration = true):\n Dataset {\n if (bufferSize == null || bufferSize < 0) {\n if (this.size == null) {\n throw new RangeError(\n '`Dataset.shuffle()` requires bufferSize to be specified.');\n } else {\n throw new RangeError(\n '`Dataset.shuffle()` requires bufferSize to be specified. ' +\n 'If your data fits in main memory (for regular JS objects), ' +\n 'and/or GPU memory (for `tf.Tensor`s), consider setting ' +\n `bufferSize to the dataset size (${this.size} elements)`);\n }\n }\n const base = this;\n const random = seedrandom.alea(seed || tf.util.now().toString());\n return datasetFromIteratorFn(async () => {\n let seed2 = random.int32();\n if (reshuffleEachIteration) {\n seed2 += random.int32();\n }\n return (await base.iterator()).shuffle(bufferSize, seed2.toString());\n }, this.size);\n }\n\n /**\n * Creates a `Dataset` with at most `count` initial elements from this\n * dataset.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).take(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: The number of elements of this dataset that should be taken\n * to form the new dataset. If `count` is `undefined` or negative, or if\n * `count` is greater than the size of this dataset, the new dataset will\n * contain all elements of this dataset.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n take(count: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && this.size > count) {\n // If the size of this dataset is greater than count, the new dataset's\n // size is count.\n size = count;\n } else if (this.size != null && this.size <= count) {\n // If the size of this dataset is equal or smaller than count, the new\n // dataset's size is the size of this dataset.\n size = this.size;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () => (await base.iterator()).take(count), size);\n }\n\n /**\n * Collect all elements of this dataset into an array.\n *\n * Obviously this will succeed only for small datasets that fit in memory.\n * Useful for testing and generally should be avoided if possible.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]);\n * console.log(await a.toArray());\n * ```\n *\n * @returns A Promise for an array of elements, which will resolve\n * when a new stream has been obtained and fully consumed.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async toArray() {\n if (this.size === Infinity) {\n throw new Error('Can not convert infinite data stream to array.');\n }\n return (await this.iterator()).toArray();\n }\n\n /**\n * Collect all elements of this dataset into an array with prefetching 100\n * elements. This is useful for testing, because the prefetch changes the\n * order in which the Promises are resolved along the processing pipeline.\n * This may help expose bugs where results are dependent on the order of\n * Promise resolution rather than on the logical order of the stream (i.e.,\n * due to hidden mutable state).\n *\n * @returns A Promise for an array of elements, which will resolve\n * when a new stream has been obtained and fully consumed.\n */\n async toArrayForTest() {\n if (this.size === Infinity) {\n throw new Error('Can not convert infinite data stream to array.');\n }\n return (await this.iterator()).toArrayForTest();\n }\n}\n\n/**\n * Create a `Dataset` defined by a provided iterator() function.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const iter = tf.data.iteratorFromFunction(func);\n * const ds = tf.data.datasetFromIteratorFn(iter);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n */\nexport function datasetFromIteratorFn(\n iteratorFn: () => Promise>,\n size: number = null): Dataset {\n return new class extends Dataset {\n size = size;\n\n /*\n * Provide a new stream of elements. Note this will also start new streams\n * from any underlying `Dataset`s.\n */\n async iterator(): Promise> {\n return iteratorFn();\n }\n }\n ();\n}\n\n/**\n * Create a `Dataset` from an array of elements.\n *\n * Create a Dataset from an array of objects:\n * ```js\n * const a = tf.data.array([{'item': 1}, {'item': 2}, {'item': 3}]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * Create a Dataset from an array of numbers:\n * ```js\n * const a = tf.data.array([4, 5, 6]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n * @param items An array of elements that will be parsed as items in a dataset.\n *\n * @doc {heading: 'Data', subheading: 'Creation', namespace: 'data'}\n */\nexport function array(items: T[]): Dataset {\n return datasetFromIteratorFn(\n async () => iteratorFromItems(items), items.length);\n}\n\n/**\n * Create a `Dataset` by zipping together an array, dict, or nested\n * structure of `Dataset`s (and perhaps additional constants).\n * The underlying datasets must provide elements in a consistent order such that\n * they correspond.\n *\n * The number of elements in the resulting dataset is the same as the size of\n * the smallest dataset in datasets.\n *\n * The nested structure of the `datasets` argument determines the\n * structure of elements in the resulting iterator.\n *\n * Note this means that, given an array of two datasets that produce dict\n * elements, the result is a dataset that produces elements that are arrays\n * of two dicts:\n *\n * Zip an array of datasets:\n * ```js\n * console.log('Zip two datasets of objects:');\n * const ds1 = tf.data.array([{a: 1}, {a: 2}, {a: 3}]);\n * const ds2 = tf.data.array([{b: 4}, {b: 5}, {b: 6}]);\n * const ds3 = tf.data.zip([ds1, ds2]);\n * await ds3.forEachAsync(e => console.log(JSON.stringify(e)));\n *\n * // If the goal is to merge the dicts in order to produce elements like\n * // {a: ..., b: ...}, this requires a second step such as:\n * console.log('Merge the objects:');\n * const ds4 = ds3.map(x => {return {a: x[0].a, b: x[1].b}});\n * await ds4.forEachAsync(e => console.log(e));\n * ```\n *\n * Zip a dict of datasets:\n * ```js\n * const a = tf.data.array([{a: 1}, {a: 2}, {a: 3}]);\n * const b = tf.data.array([{b: 4}, {b: 5}, {b: 6}]);\n * const c = tf.data.zip({c: a, d: b});\n * await c.forEachAsync(e => console.log(JSON.stringify(e)));\n * ```\n *\n * @doc {heading: 'Data', subheading: 'Operations', namespace: 'data'}\n */\nexport function zip(datasets: DatasetContainer):\n Dataset {\n // manually type-check the argument for JS users\n if (!isIterable(datasets)) {\n throw new Error('The argument to zip() must be an object or array.');\n }\n let size;\n if (Array.isArray(datasets)) {\n for (let i = 0; i < datasets.length; i++) {\n size = size == null ? (datasets[i] as Dataset).size :\n Math.min(size, (datasets[i] as Dataset).size);\n }\n } else if (datasets instanceof Object) {\n for (const ds in datasets) {\n size = size == null ? (datasets[ds] as Dataset).size :\n Math.min(size, (datasets[ds] as Dataset).size);\n }\n }\n return datasetFromIteratorFn(async () => {\n const streams = await deepMapAndAwaitAll(datasets, d => {\n if (d instanceof Dataset) {\n return {value: d.iterator(), recurse: false};\n } else if (isIterable(d)) {\n return {value: null, recurse: true};\n } else {\n throw new Error(\n 'Leaves of the structure passed to zip() must be Datasets, ' +\n 'not primitives.');\n }\n });\n return iteratorFromZipped(streams, ZipMismatchMode.SHORTEST);\n }, size);\n}\n\n/**\n * A zip function for use with deepZip, passed via the columnMajorBatch call.\n *\n * Accepts an array of identically-structured nested elements and either batches\n * them (if they are primitives, numeric arrays, or Tensors) or requests\n * recursion (if not).\n */\n// tslint:disable-next-line:no-any\nfunction deepBatchConcat(rows: any[]): DeepMapResult {\n if (rows === null) {\n return null;\n }\n\n // use the first item to decide whether to recurse or batch here.\n const exampleRow = rows[0];\n\n if (canTensorify(exampleRow)) {\n // rows is an array of primitives, Tensors, or arrays. Batch them.\n const value = batchConcat(rows);\n return {value, recurse: false};\n }\n\n // the example row is an object, so recurse into it.\n return {value: null, recurse: true};\n}\n\n/**\n * Assembles a list of same-shaped numbers, number arrays, or Tensors\n * into a single new Tensor where axis 0 is the batch dimension.\n */\nfunction batchConcat(arrays: T[]):\n tf.Tensor {\n if (arrays.length === 0) {\n // We can't return an empty Tensor because we don't know the element shape.\n throw new Error('Can\\'t make a batch of zero elements.');\n }\n\n if (arrays[0] instanceof tf.Tensor) {\n // Input is an array of Tensors\n return tf.stack(arrays as tf.Tensor[]);\n } else {\n // Input is a possibly-nested array of numbers.\n return tf.tensor(arrays as TensorLike);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {Dataset} from '../dataset';\nimport {DataSource} from '../datasource';\nimport {LazyIterator} from '../iterators/lazy_iterator';\n\n/**\n * Represents a potentially large collection of text lines.\n *\n * The results are not batched.\n */\nexport class TextLineDataset extends Dataset {\n /**\n * Create a `TextLineDataset`.\n *\n * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream.\n */\n constructor(protected readonly input: DataSource) {\n super();\n }\n\n async iterator(): Promise> {\n const inputIterator = await this.input.iterator();\n const utf8Iterator = inputIterator.decodeUTF8();\n const lineIterator = utf8Iterator.split('\\n').map(line => {\n // Windows/DOS format text file has extra line breaker at the end of line.\n if (line.endsWith('\\r')) {\n line = line.slice(0, -1);\n }\n return line;\n });\n return lineIterator;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {TensorContainer, util} from '@tensorflow/tfjs-core';\nimport {Dataset} from '../dataset';\nimport {DataSource} from '../datasource';\nimport {LazyIterator} from '../iterators/lazy_iterator';\nimport {ColumnConfig, CSVConfig} from '../types';\nimport {TextLineDataset} from './text_line_dataset';\n\nconst CODE_QUOTE = '\"';\nconst STATE_OUT = Symbol('out');\nconst STATE_FIELD = Symbol('field');\nconst STATE_QUOTE = Symbol('quote');\nconst STATE_QUOTE_AFTER_QUOTE = Symbol('quoteafterquote');\nconst STATE_WITHIN_QUOTE_IN_QUOTE = Symbol('quoteinquote');\n\n/**\n * Represents a potentially large collection of delimited text records.\n *\n * The produced `TensorContainer`s each contain one key-value pair for\n * every column of the table. When a field is empty in the incoming data, the\n * resulting value is `undefined`, or throw error if it is required. Values\n * that can be parsed as numbers are emitted as type `number`, other values\n * are parsed as `string`.\n *\n * The results are not batched.\n *\n * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'}\n */\nexport class CSVDataset extends Dataset {\n base: TextLineDataset;\n private hasHeader = true;\n private fullColumnNames: string[] = null;\n private columnNamesValidated = false;\n private columnConfigs: {[key: string]: ColumnConfig} = null;\n private configuredColumnsOnly = false;\n private delimiter = ',';\n private delimWhitespace = false;\n\n /**\n * Returns column names of the csv dataset. If `configuredColumnsOnly` is\n * true, return column names in `columnConfigs`. If `configuredColumnsOnly` is\n * false and `columnNames` is provided, `columnNames`. If\n * `configuredColumnsOnly` is false and `columnNames` is not provided, return\n * all column names parsed from the csv file. For example usage please go to\n * `tf.data.csv`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async columnNames() {\n if (!this.columnNamesValidated) {\n await this.setColumnNames();\n }\n return this.configuredColumnsOnly ? Object.keys(this.columnConfigs) :\n this.fullColumnNames;\n }\n\n /* 1) If `columnNames` is provided as string[], use this string[] as output\n * keys in corresponding order. The length must match the number of inferred\n * columns if `hasHeader` is true .\n * 2) If `columnNames` is not provided, parse header line as `columnNames` if\n * hasHeader is true. If `hasHeader` is false, throw an error.\n * 3) If `columnConfigs` is provided, all the keys in `columnConfigs` must\n * exist in parsed `columnNames`.\n */\n private async setColumnNames() {\n const columnNamesFromFile = await this.maybeReadHeaderLine();\n if (!this.fullColumnNames && !columnNamesFromFile) {\n // Throw an error if columnNames is not provided and no header line.\n throw new Error(\n 'Column names must be provided if there is no header line.');\n } else if (this.fullColumnNames && columnNamesFromFile) {\n // Check provided columnNames match header line.\n util.assert(\n columnNamesFromFile.length === this.fullColumnNames.length,\n () => 'The length of provided columnNames (' +\n this.fullColumnNames.length.toString() +\n ') does not match the length of the header line read from ' +\n 'file (' + columnNamesFromFile.length.toString() + ').');\n }\n if (!this.fullColumnNames) {\n this.fullColumnNames = columnNamesFromFile;\n }\n // Check if there are duplicate column names.\n const counts: {[key: string]: number} = this.fullColumnNames.reduce(\n (countAcc: {[key: string]: number}, name) => {\n countAcc[name] = (countAcc[name] + 1) || 1;\n return countAcc;\n },\n {});\n const duplicateNames =\n Object.keys(counts).filter((name) => (counts[name] > 1));\n util.assert(\n duplicateNames.length === 0,\n () => 'Duplicate column names found: ' + duplicateNames.toString());\n // Check if keys in columnConfigs match columnNames.\n if (this.columnConfigs) {\n for (const key of Object.keys(this.columnConfigs)) {\n const index = this.fullColumnNames.indexOf(key);\n if (index === -1) {\n throw new Error(\n 'The key \"' + key +\n '\" provided in columnConfigs does not match any of the column ' +\n 'names (' + this.fullColumnNames.toString() + ').');\n }\n }\n }\n this.columnNamesValidated = true;\n }\n\n private async maybeReadHeaderLine() {\n if (this.hasHeader) {\n const iter = await this.base.iterator();\n const firstElement = await iter.next();\n if (firstElement.done) {\n throw new Error('No data was found for CSV parsing.');\n }\n const firstLine: string = firstElement.value;\n const headers = this.parseRow(firstLine, false);\n return headers;\n } else {\n return null;\n }\n }\n\n /**\n * Create a `CSVDataset`.\n *\n * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream.\n * @param csvConfig (Optional) A CSVConfig object that contains configurations\n * of reading and decoding from CSV file(s).\n *\n * hasHeader: (Optional) A boolean value that indicates whether the first\n * row of provided CSV file is a header line with column names, and should\n * not be included in the data. Defaults to `true`.\n *\n * columnNames: (Optional) A list of strings that corresponds to\n * the CSV column names, in order. If provided, it ignores the column\n * names inferred from the header row. If not provided, infers the column\n * names from the first row of the records. If hasHeader is false and\n * columnNames is not provided, this method throws an error.\n *\n * columnConfigs: (Optional) A dictionary whose key is column names, value\n * is an object stating if this column is required, column's data type,\n * default value, and if this column is label. If provided, keys must\n * correspond to names provided in columnNames or inferred from the file\n * header lines. If isLabel is true any column, returns an array of two\n * items: the first item is a dict of features key/value pairs, the second\n * item is a dict of labels key/value pairs. If no feature is marked as\n * label, returns a dict of features only.\n *\n * configuredColumnsOnly (Optional) If true, only columns provided in\n * columnConfigs will be parsed and provided during iteration.\n *\n * delimiter (Optional) The string used to parse each line of the input\n * file. Defaults to `,`.\n */\n constructor(protected readonly input: DataSource, csvConfig?: CSVConfig) {\n super();\n this.base = new TextLineDataset(input);\n if (!csvConfig) {\n csvConfig = {};\n }\n this.hasHeader = csvConfig.hasHeader === false ? false : true;\n this.fullColumnNames = csvConfig.columnNames;\n this.columnConfigs = csvConfig.columnConfigs;\n this.configuredColumnsOnly = csvConfig.configuredColumnsOnly;\n if (csvConfig.delimWhitespace) {\n util.assert(\n csvConfig.delimiter == null,\n () =>\n 'Delimiter should not be provided when delimWhitespace is true.');\n this.delimWhitespace = true;\n this.delimiter = ' ';\n } else {\n this.delimiter = csvConfig.delimiter ? csvConfig.delimiter : ',';\n }\n }\n\n async iterator(): Promise> {\n if (!this.columnNamesValidated) {\n await this.setColumnNames();\n }\n let lines = await this.base.iterator();\n if (this.hasHeader) {\n // We previously read the first line to get the columnNames.\n // Now that we're providing data, skip it.\n lines = lines.skip(1);\n }\n return lines.map(x => this.makeDataElement(x));\n }\n\n makeDataElement(line: string): TensorContainer {\n const values = this.parseRow(line);\n const features: {[key: string]: TensorContainer} = {};\n const labels: {[key: string]: TensorContainer} = {};\n\n for (let i = 0; i < this.fullColumnNames.length; i++) {\n const key = this.fullColumnNames[i];\n const config = this.columnConfigs ? this.columnConfigs[key] : null;\n if (this.configuredColumnsOnly && !config) {\n // This column is not selected.\n continue;\n } else {\n const value = values[i];\n let parsedValue = null;\n if (value === '') {\n // If default value is provided, use it. If default value is not\n // provided, set as undefined.\n if (config && config.default !== undefined) {\n parsedValue = config.default;\n } else if (config && (config.required || config.isLabel)) {\n throw new Error(\n `Required column ${key} is empty in this line: ${line}`);\n } else {\n parsedValue = undefined;\n }\n } else {\n // A value is present, so parse it based on type\n const valueAsNum = Number(value);\n if (isNaN(valueAsNum)) {\n // The value is a string and this column is declared as boolean\n // in config, parse it as boolean.\n if (config && config.dtype === 'bool') {\n parsedValue = this.getBoolean(value);\n } else {\n // Set value as string\n parsedValue = value;\n }\n } else if (!config || !config.dtype) {\n // If this value is a number and no type config is provided, return\n // it as number.\n parsedValue = valueAsNum;\n } else {\n // If this value is a number and data type is provided, parse it\n // according to provided data type.\n switch (config.dtype) {\n case 'float32':\n parsedValue = valueAsNum;\n break;\n case 'int32':\n parsedValue = Math.floor(valueAsNum);\n break;\n case 'bool':\n parsedValue = this.getBoolean(value);\n break;\n default:\n parsedValue = valueAsNum;\n }\n }\n }\n // Check if this column is label.\n (config && config.isLabel) ? labels[key] = parsedValue :\n features[key] = parsedValue;\n }\n }\n // If label exists, return an object of features and labels as {xs:features,\n // ys:labels}, otherwise return features only.\n if (Object.keys(labels).length === 0) {\n return features;\n\n } else {\n return {xs: features, ys: labels};\n }\n }\n\n private getBoolean(value: string): number {\n if (value === '1' || value.toLowerCase() === 'true') {\n return 1;\n } else {\n return 0;\n }\n }\n\n // adapted from https://beta.observablehq.com/@mbostock/streaming-csv\n private parseRow(line: string, validateElementCount = true): string[] {\n const result: string[] = [];\n let readOffset = 0;\n const readLength = line.length;\n let currentState = STATE_OUT;\n // Goes through the line to parse quote.\n for (let i = 0; i < readLength; i++) {\n switch (currentState) {\n // Before enter a new field\n case STATE_OUT:\n switch (line.charAt(i)) {\n // Enter a quoted field\n case CODE_QUOTE:\n readOffset = i + 1;\n currentState = STATE_QUOTE;\n break;\n // Read an empty field\n case this.delimiter:\n readOffset = i + 1;\n // If delimiter is white space and configured to collapse\n // multiple white spaces, ignore this white space.\n if (this.delimiter === ' ' && this.delimWhitespace) {\n break;\n }\n result.push('');\n currentState = STATE_OUT;\n break;\n // Enter an unquoted field\n default:\n currentState = STATE_FIELD;\n readOffset = i;\n break;\n }\n break;\n // In an unquoted field\n case STATE_FIELD:\n switch (line.charAt(i)) {\n // Exit an unquoted field, add it to result\n case this.delimiter:\n result.push(line.substring(readOffset, i));\n currentState = STATE_OUT;\n readOffset = i + 1;\n break;\n default:\n }\n break;\n // In a quoted field\n case STATE_QUOTE:\n switch (line.charAt(i)) {\n // Read a quote after a quote\n case CODE_QUOTE:\n currentState = STATE_QUOTE_AFTER_QUOTE;\n break;\n default:\n }\n break;\n // This state means it's right after a second quote in a field\n case STATE_QUOTE_AFTER_QUOTE:\n switch (line.charAt(i)) {\n // Finished a quoted field\n case this.delimiter:\n result.push(line.substring(readOffset, i - 1));\n currentState = STATE_OUT;\n readOffset = i + 1;\n break;\n // Finished a quoted part in a quoted field\n case CODE_QUOTE:\n currentState = STATE_QUOTE;\n break;\n // In a quoted part in a quoted field\n default:\n currentState = STATE_WITHIN_QUOTE_IN_QUOTE;\n break;\n }\n break;\n case STATE_WITHIN_QUOTE_IN_QUOTE:\n switch (line.charAt(i)) {\n // Exit a quoted part in a quoted field\n case CODE_QUOTE:\n currentState = STATE_QUOTE;\n break;\n default:\n }\n break;\n default:\n }\n }\n // Adds last item based on if it is quoted.\n if (currentState === STATE_QUOTE_AFTER_QUOTE) {\n result.push(line.substring(readOffset, readLength - 1));\n } else {\n result.push(line.substring(readOffset));\n }\n // Check if each row has the same number of elements as column names.\n if (validateElementCount && result.length !== this.fullColumnNames.length) {\n throw new Error(`Invalid row in csv file. Should have ${\n this.fullColumnNames.length} elements in a row, but got ${result}`);\n }\n return result;\n }\n}\n\n// TODO(soergel): add more basic datasets for parity with tf.data\n// tf.data.FixedLengthRecordDataset()\n// tf.data.TFRecordDataset()\n","/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {env, Tensor, tensor, Tensor2D, Tensor3D, TensorContainer, util} from '@tensorflow/tfjs-core';\nimport {MicrophoneConfig} from '../types';\nimport {LazyIterator} from './lazy_iterator';\n\n/**\n * Provide a stream of tensors from microphone audio stream. The tensors are\n * representing audio data as frequency-domain spectrogram generated with\n * browser's native FFT. Tensors representing time-domain waveform is available\n * based on configuration. Only works in browser environment.\n */\nexport class MicrophoneIterator extends LazyIterator {\n private isClosed = false;\n private stream: MediaStream;\n private readonly fftSize: number;\n private readonly columnTruncateLength: number;\n private freqData: Float32Array;\n private timeData: Float32Array;\n private readonly numFrames: number;\n private analyser: AnalyserNode;\n private audioContext: AudioContext;\n private sampleRateHz: number;\n private readonly audioTrackConstraints: MediaTrackConstraints;\n private readonly smoothingTimeConstant: number;\n private readonly includeSpectrogram: boolean;\n private readonly includeWaveform: boolean;\n\n private constructor(protected readonly microphoneConfig: MicrophoneConfig) {\n super();\n this.fftSize = microphoneConfig.fftSize || 1024;\n const fftSizeLog2 = Math.log2(this.fftSize);\n if (this.fftSize < 0 || fftSizeLog2 < 4 || fftSizeLog2 > 14 ||\n !Number.isInteger(fftSizeLog2)) {\n throw new Error(\n `Invalid fftSize: it must be a power of 2 between ` +\n `2 to 4 and 2 to 14, but got ${this.fftSize}`);\n }\n\n this.numFrames = microphoneConfig.numFramesPerSpectrogram || 43;\n this.sampleRateHz = microphoneConfig.sampleRateHz;\n this.columnTruncateLength =\n microphoneConfig.columnTruncateLength || this.fftSize;\n this.audioTrackConstraints = microphoneConfig.audioTrackConstraints;\n this.smoothingTimeConstant = microphoneConfig.smoothingTimeConstant || 0;\n\n this.includeSpectrogram =\n microphoneConfig.includeSpectrogram === false ? false : true;\n this.includeWaveform =\n microphoneConfig.includeWaveform === true ? true : false;\n if (!this.includeSpectrogram && !this.includeWaveform) {\n throw new Error(\n 'Both includeSpectrogram and includeWaveform are false. ' +\n 'At least one type of data should be returned.');\n }\n }\n\n summary() {\n return `microphone`;\n }\n\n // Construct a MicrophoneIterator and start the audio stream.\n static async create(microphoneConfig: MicrophoneConfig = {}) {\n if (env().get('IS_NODE')) {\n throw new Error(\n 'microphone API is only supported in browser environment.');\n }\n\n const microphoneIterator = new MicrophoneIterator(microphoneConfig);\n\n // Call async function start() to initialize the audio stream.\n await microphoneIterator.start();\n\n return microphoneIterator;\n }\n\n // Start the audio stream and FFT.\n async start(): Promise {\n try {\n this.stream = await navigator.mediaDevices.getUserMedia({\n audio: this.audioTrackConstraints == null ? true :\n this.audioTrackConstraints,\n video: false\n });\n } catch (e) {\n throw new Error(\n `Error thrown while initializing video stream: ${e.message}`);\n }\n\n if (!this.stream) {\n throw new Error('Could not obtain audio from microphone.');\n }\n\n const ctxConstructor =\n // tslint:disable-next-line:no-any\n (window as any).AudioContext || (window as any).webkitAudioContext;\n this.audioContext = new ctxConstructor();\n\n if (!this.sampleRateHz) {\n // If sample rate is not provided, use the available sample rate on\n // device.\n this.sampleRateHz = this.audioContext.sampleRate;\n } else if (this.audioContext.sampleRate !== this.sampleRateHz) {\n throw new Error(\n `Mismatch in sampling rate: ` +\n `Expected: ${this.sampleRateHz}; ` +\n `Actual: ${this.audioContext.sampleRate}`);\n }\n\n const streamSource = this.audioContext.createMediaStreamSource(this.stream);\n this.analyser = this.audioContext.createAnalyser();\n this.analyser.fftSize = this.fftSize * 2;\n this.analyser.smoothingTimeConstant = this.smoothingTimeConstant;\n streamSource.connect(this.analyser);\n this.freqData = new Float32Array(this.fftSize);\n this.timeData = new Float32Array(this.fftSize);\n return;\n }\n\n async next(): Promise> {\n if (this.isClosed) {\n return {value: null, done: true};\n }\n\n let spectrogramTensor: Tensor;\n let waveformTensor: Tensor;\n\n const audioDataQueue = await this.getAudioData();\n if (this.includeSpectrogram) {\n const freqData = this.flattenQueue(audioDataQueue.freqDataQueue);\n spectrogramTensor = this.getTensorFromAudioDataArray(\n freqData, [this.numFrames, this.columnTruncateLength, 1]);\n }\n if (this.includeWaveform) {\n const timeData = this.flattenQueue(audioDataQueue.timeDataQueue);\n waveformTensor = this.getTensorFromAudioDataArray(\n timeData, [this.numFrames * this.fftSize, 1]);\n }\n\n return {\n value: {'spectrogram': spectrogramTensor, 'waveform': waveformTensor},\n done: false\n };\n }\n\n // Capture one result from the audio stream, and extract the value from\n // iterator.next() result.\n async capture(): Promise<{spectrogram: Tensor3D, waveform: Tensor2D}> {\n return (await this.next()).value as\n {spectrogram: Tensor3D, waveform: Tensor2D};\n }\n\n private async getAudioData():\n Promise<{freqDataQueue: Float32Array[], timeDataQueue: Float32Array[]}> {\n const freqDataQueue: Float32Array[] = [];\n const timeDataQueue: Float32Array[] = [];\n let currentFrames = 0;\n return new Promise(resolve => {\n const intervalID = setInterval(() => {\n if (this.includeSpectrogram) {\n this.analyser.getFloatFrequencyData(this.freqData);\n // If the audio stream is initializing, return empty queue.\n if (this.freqData[0] === -Infinity) {\n resolve({freqDataQueue, timeDataQueue});\n }\n freqDataQueue.push(this.freqData.slice(0, this.columnTruncateLength));\n }\n if (this.includeWaveform) {\n this.analyser.getFloatTimeDomainData(this.timeData);\n timeDataQueue.push(this.timeData.slice());\n }\n\n // Clean interval and return when all frames have been collected\n if (++currentFrames === this.numFrames) {\n clearInterval(intervalID);\n resolve({freqDataQueue, timeDataQueue});\n }\n }, this.fftSize / this.sampleRateHz * 1e3);\n });\n }\n\n // Stop the audio stream and pause the iterator.\n stop(): void {\n if (!this.isClosed) {\n this.isClosed = true;\n this.analyser.disconnect();\n this.audioContext.close();\n if (this.stream != null && this.stream.getTracks().length > 0) {\n this.stream.getTracks()[0].stop();\n }\n }\n }\n\n // Override toArray() function to prevent collecting.\n toArray(): Promise {\n throw new Error('Can not convert infinite audio stream to array.');\n }\n\n // Return audio sampling rate in Hz\n getSampleRate(): number {\n return this.sampleRateHz;\n }\n\n private flattenQueue(queue: Float32Array[]): Float32Array {\n const frameSize = queue[0].length;\n const freqData = new Float32Array(queue.length * frameSize);\n queue.forEach((data, i) => freqData.set(data, i * frameSize));\n return freqData;\n }\n\n private getTensorFromAudioDataArray(freqData: Float32Array, shape: number[]):\n Tensor {\n const vals = new Float32Array(util.sizeFromShape(shape));\n // If the data is less than the output shape, the rest is padded with zeros.\n vals.set(freqData, vals.length - freqData.length);\n return tensor(vals, shape);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {browser, cast, env, expandDims, image, reshape, tensor1d, Tensor1D, tensor2d, Tensor2D, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs-core';\nimport {WebcamConfig} from '../types';\nimport {LazyIterator} from './lazy_iterator';\n\n/**\n * Provide a stream of image tensors from webcam video stream. Only works in\n * browser environment.\n */\nexport class WebcamIterator extends LazyIterator {\n private isClosed = true;\n private stream: MediaStream;\n private resize = false;\n private cropSize: [number, number];\n private cropBox: Tensor2D;\n private cropBoxInd: Tensor1D;\n\n private constructor(\n protected readonly webcamVideoElement: HTMLVideoElement,\n protected readonly webcamConfig: WebcamConfig) {\n super();\n if (this.needToResize()) {\n this.resize = true;\n this.cropSize =\n [this.webcamConfig.resizeHeight, this.webcamConfig.resizeWidth];\n this.cropBoxInd = tensor1d([0], 'int32');\n if (this.webcamConfig.centerCrop) {\n // Calculate the box based on resizing shape.\n const widthCroppingRatio =\n this.webcamConfig.resizeWidth * 1.0 / this.webcamVideoElement.width;\n const heightCroppingRatio = this.webcamConfig.resizeHeight * 1.0 /\n this.webcamVideoElement.height;\n const widthCropStart = (1 - widthCroppingRatio) / 2;\n const heightCropStart = (1 - heightCroppingRatio) / 2;\n const widthCropEnd = widthCropStart + widthCroppingRatio;\n const heightCropEnd = heightCroppingRatio + heightCropStart;\n this.cropBox = tensor2d(\n [heightCropStart, widthCropStart, heightCropEnd, widthCropEnd],\n [1, 4]);\n } else {\n this.cropBox = tensor2d([0, 0, 1, 1], [1, 4]);\n }\n }\n }\n\n summary() {\n return `webcam`;\n }\n\n // Construct a WebcamIterator and start it's video stream.\n static async create(\n webcamVideoElement?: HTMLVideoElement, webcamConfig: WebcamConfig = {}) {\n if (env().get('IS_NODE')) {\n throw new Error(\n 'tf.data.webcam is only supported in browser environment.');\n }\n\n if (!webcamVideoElement) {\n // If webcam video element is not provided, create a hidden video element\n // with provided width and height.\n webcamVideoElement = document.createElement('video');\n if (!webcamConfig.resizeWidth || !webcamConfig.resizeHeight) {\n throw new Error(\n 'Please provide webcam video element, or resizeWidth and ' +\n 'resizeHeight to create a hidden video element.');\n }\n webcamVideoElement.width = webcamConfig.resizeWidth;\n webcamVideoElement.height = webcamConfig.resizeHeight;\n }\n const webcamIterator = new WebcamIterator(webcamVideoElement, webcamConfig);\n\n // Call async function to initialize the video stream.\n await webcamIterator.start();\n\n return webcamIterator;\n }\n\n // Async function to start video stream.\n async start(): Promise {\n if (this.webcamConfig.facingMode) {\n util.assert(\n (this.webcamConfig.facingMode === 'user') ||\n (this.webcamConfig.facingMode === 'environment'),\n () =>\n `Invalid webcam facing mode: ${this.webcamConfig.facingMode}. ` +\n `Please provide 'user' or 'environment'`);\n }\n\n try {\n this.stream = await navigator.mediaDevices.getUserMedia({\n video: {\n deviceId: this.webcamConfig.deviceId,\n facingMode: this.webcamConfig.facingMode ?\n this.webcamConfig.facingMode :\n 'user',\n width: this.webcamVideoElement.width,\n height: this.webcamVideoElement.height\n }\n });\n } catch (e) {\n // Modify the error message but leave the stack trace intact\n e.message = `Error thrown while initializing video stream: ${e.message}`;\n throw e;\n }\n\n if (!this.stream) {\n throw new Error('Could not obtain video from webcam.');\n }\n\n // Older browsers may not have srcObject\n try {\n this.webcamVideoElement.srcObject = this.stream;\n } catch (error) {\n console.log(error);\n this.webcamVideoElement.src = window.URL.createObjectURL(this.stream);\n }\n // Start the webcam video stream\n this.webcamVideoElement.play();\n\n this.isClosed = false;\n\n return new Promise(resolve => {\n // Add event listener to make sure the webcam has been fully initialized.\n this.webcamVideoElement.onloadedmetadata = () => {\n resolve();\n };\n });\n }\n\n async next(): Promise> {\n if (this.isClosed) {\n return {value: null, done: true};\n }\n\n let img;\n try {\n img = browser.fromPixels(this.webcamVideoElement);\n } catch (e) {\n throw new Error(\n `Error thrown converting video to pixels: ${JSON.stringify(e)}`);\n }\n if (this.resize) {\n try {\n return {value: this.cropAndResizeFrame(img), done: false};\n } catch (e) {\n throw new Error(`Error thrown cropping the video: ${e.message}`);\n } finally {\n img.dispose();\n }\n } else {\n return {value: img, done: false};\n }\n }\n\n private needToResize() {\n // If resizeWidth and resizeHeight are provided, and different from the\n // width and height of original HTMLVideoElement, then resizing and cropping\n // is required.\n if (this.webcamConfig.resizeWidth && this.webcamConfig.resizeHeight &&\n (this.webcamVideoElement.width !== this.webcamConfig.resizeWidth ||\n this.webcamVideoElement.height !== this.webcamConfig.resizeHeight)) {\n return true;\n }\n return false;\n }\n\n // Cropping and resizing each frame based on config\n cropAndResizeFrame(img: Tensor3D): Tensor3D {\n return tidy(() => {\n const expandedImage: Tensor4D = expandDims(cast(img, 'float32'), (0));\n let resizedImage;\n resizedImage = image.cropAndResize(\n expandedImage, this.cropBox, this.cropBoxInd, this.cropSize,\n 'bilinear');\n // Extract image from batch cropping.\n const shape = resizedImage.shape;\n return reshape(resizedImage, shape.slice(1) as [number, number, number]);\n });\n }\n\n // Capture one frame from the video stream, and extract the value from\n // iterator.next() result.\n async capture(): Promise {\n return (await this.next()).value;\n }\n\n // Stop the video stream and pause webcam iterator.\n stop(): void {\n const tracks = this.stream.getTracks();\n\n tracks.forEach(track => track.stop());\n\n try {\n this.webcamVideoElement.srcObject = null;\n } catch (error) {\n console.log(error);\n this.webcamVideoElement.src = null;\n }\n this.isClosed = true;\n }\n\n // Override toArray() function to prevent collecting.\n toArray(): Promise {\n throw new Error('Can not convert infinite video stream to array.');\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {ByteChunkIterator} from './iterators/byte_chunk_iterator';\n\n/**\n * Represents a data source readable as a stream of binary data chunks.\n *\n * Because `Dataset`s can be read repeatedly (via `Dataset.iterator()`), this\n * provides a means to repeatedly create streams from the underlying data\n * sources.\n */\nexport abstract class DataSource {\n /**\n * Obtain a new stream of binary data chunks.\n *\n * Starts the new stream from the beginning of the data source, even if other\n * streams have been obtained previously.\n */\n abstract async iterator(): Promise;\n\n // TODO(soergel): consider chainable Dataset construction here\n}\n\n// TODO(soergel): consider convenience factory functions here\n// in combination with chainable source->dataset above, e.g.:\n// tf.data.url(...).asCsvDataset().shuffle().batch()\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {LazyIterator, OneToManyIterator} from './lazy_iterator';\n\nexport abstract class StringIterator extends LazyIterator {\n /**\n * Splits a string stream on a given separator.\n *\n * It is assumed that the incoming chunk boundaries have no semantic meaning,\n * so conceptually the incoming stream is treated simply as the concatenation\n * of its elements.\n *\n * The outgoing stream provides chunks corresponding to the results of the\n * standard string split() operation (even if such a chunk spanned incoming\n * chunks). The separators are not included.\n *\n * A typical usage is to split a text file (represented as a stream with\n * arbitrary chunk boundaries) into lines.\n *\n * @param upstream A readable stream of strings that can be treated as\n * concatenated.\n * @param separator A character to split on.\n */\n split(separator: string): StringIterator {\n return new SplitIterator(this, separator);\n }\n}\n\n// ============================================================================\n// The following private classes serve to implement the chainable methods\n// on StringIterator. Unfortunately they can't be placed in separate files, due\n// to resulting trouble with circular imports.\n// ============================================================================\n\n// We wanted multiple inheritance, e.g.\n// class SplitIterator extends QueueIterator, StringIterator\n// but the TypeScript mixin approach is a bit hacky, so we take this adapter\n// approach instead.\n\nclass SplitIterator extends StringIterator {\n private impl: SplitIteratorImpl;\n\n constructor(protected upstream: LazyIterator, separator: string) {\n super();\n this.impl = new SplitIteratorImpl(upstream, separator);\n }\n\n summary() {\n return this.impl.summary();\n }\n\n async next() {\n return this.impl.next();\n }\n}\n\nclass SplitIteratorImpl extends OneToManyIterator {\n // A partial string at the end of an upstream chunk\n carryover = '';\n\n constructor(\n protected upstream: LazyIterator, protected separator: string) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Split('${this.separator}')`;\n }\n\n async pump(): Promise {\n const chunkResult = await this.upstream.next();\n if (chunkResult.done) {\n if (this.carryover === '') {\n return false;\n }\n\n // Pretend that the pump succeeded in order to emit the small last batch.\n // The next pump() call will actually fail.\n this.outputQueue.push(this.carryover);\n this.carryover = '';\n return true;\n }\n const lines = chunkResult.value.split(this.separator);\n // Note the behavior: \" ab \".split(' ') === ['', 'ab', '']\n // Thus the carryover may be '' if the separator falls on a chunk\n // boundary; this produces the correct result.\n\n lines[0] = this.carryover + lines[0];\n for (const line of lines.slice(0, -1)) {\n this.outputQueue.push(line);\n }\n this.carryover = lines[lines.length - 1];\n\n return true;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {env} from '@tensorflow/tfjs-core';\nimport {LazyIterator, OneToManyIterator} from './lazy_iterator';\nimport {StringIterator} from './string_iterator';\n\nexport abstract class ByteChunkIterator extends LazyIterator {\n /**\n * Decode a stream of UTF8-encoded byte arrays to a stream of strings.\n *\n * The byte arrays producetd from the ByteChunkIterator on which this is\n * called will be interpreted as concatenated. No assumptions are made about\n * the boundaries of the incoming chunks, so a multi-byte UTF8 encoding of a\n * character may span the boundary between chunks. This naturally happens,\n * for instance, when reading fixed-size byte arrays from a file.\n */\n decodeUTF8(): StringIterator {\n return new Utf8Iterator(this);\n }\n}\n\n// ============================================================================\n// The following private classes serve to implement the chainable methods\n// on ByteChunkIterator. Unfortunately they can't be placed in separate files,\n// due to resulting trouble with circular imports.\n// ============================================================================\n\n// We wanted multiple inheritance, e.g.\n// class Utf8Iterator extends QueueIterator, StringIterator\n// but the TypeScript mixin approach is a bit hacky, so we take this adapter\n// approach instead.\n\nclass Utf8Iterator extends StringIterator {\n private impl: Utf8IteratorImpl;\n\n constructor(protected upstream: LazyIterator) {\n super();\n this.impl = new Utf8IteratorImpl(upstream);\n }\n\n summary() {\n return this.impl.summary();\n }\n\n async next() {\n return this.impl.next();\n }\n}\n\n/**\n * Decode a stream of UTF8-encoded byte arrays to a stream of strings.\n *\n * This is tricky because the incoming byte array boundaries may disrupt a\n * multi-byte UTF8 character. Thus any incomplete character data at the end of\n * a chunk must be carried over and prepended to the next chunk before\n * decoding. Luckily with native decoder, TextDecoder in browser and\n * string_decoder in node, byte array boundaries are handled automatically.\n *\n * In the context of an input pipeline for machine learning, UTF8 decoding is\n * needed to parse text files containing training examples or prediction\n * requests (e.g., formatted as CSV or JSON). We cannot use the built-in\n * decoding provided by FileReader.readAsText() because here we are in a\n * streaming context, which FileReader does not support.\n *\n * @param upstream A `LazyIterator` of `Uint8Arrays` containing UTF8-encoded\n * text, which should be interpreted as concatenated. No assumptions are\n * made about the boundaries of the incoming chunks, so a multi-byte UTF8\n * encoding of a character may span the boundary between chunks. This\n * naturally happens, for instance, when reading fixed-size byte arrays from a\n * file.\n */\nclass Utf8IteratorImpl extends OneToManyIterator {\n // `decoder` as `any` here to dynamically assign value based on the\n // environment.\n // tslint:disable-next-line:no-any\n decoder: any;\n\n constructor(protected readonly upstream: LazyIterator) {\n super();\n if (env().get('IS_BROWSER')) {\n this.decoder = new TextDecoder('utf-8');\n } else {\n // tslint:disable-next-line:no-require-imports\n const {StringDecoder} = require('string_decoder');\n this.decoder = new StringDecoder('utf8');\n }\n }\n summary() {\n return `${this.upstream.summary()} -> Utf8`;\n }\n\n async pump(): Promise {\n const chunkResult = await this.upstream.next();\n let chunk;\n if (chunkResult.done) {\n return false;\n } else {\n chunk = chunkResult.value;\n }\n\n let text: string;\n if (env().get('IS_BROWSER')) {\n text = this.decoder.decode(chunk, {stream: true});\n } else {\n text = this.decoder.write(Buffer.from(chunk.buffer));\n }\n this.outputQueue.push(text);\n return true;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\n// inspired by https://github.com/maxogden/filereader-stream\nimport {env, util} from '@tensorflow/tfjs-core';\nimport {FileElement} from '../types';\nimport {ByteChunkIterator} from './byte_chunk_iterator';\n\nexport interface FileChunkIteratorOptions {\n /** The byte offset at which to begin reading the File or Blob. Default 0. */\n offset?: number;\n /** The number of bytes to read at a time. Default 1MB. */\n chunkSize?: number;\n}\n\n/**\n * Provide a stream of chunks from a File, Blob, or Uint8Array.\n * @param file The source File, Blob or Uint8Array.\n * @param options Optional settings controlling file reading.\n * @returns a lazy Iterator of Uint8Arrays containing sequential chunks of the\n * input File, Blob or Uint8Array.\n */\nexport class FileChunkIterator extends ByteChunkIterator {\n offset: number;\n chunkSize: number;\n\n constructor(\n protected file: FileElement,\n protected options: FileChunkIteratorOptions = {}) {\n super();\n util.assert(\n (file instanceof Uint8Array) ||\n (env().get('IS_BROWSER') ?\n (file instanceof File || file instanceof Blob) :\n false),\n () => 'FileChunkIterator only supports File, Blob and Uint8Array ' +\n 'right now.');\n this.offset = options.offset || 0;\n // default 1MB chunk has tolerable perf on large files\n this.chunkSize = options.chunkSize || 1024 * 1024;\n }\n\n summary() {\n return `FileChunks ${this.file}`;\n }\n\n async next(): Promise> {\n if (this.offset >= ((this.file instanceof Uint8Array) ?\n this.file.byteLength :\n this.file.size)) {\n return {value: null, done: true};\n }\n const chunk = new Promise((resolve, reject) => {\n const end = this.offset + this.chunkSize;\n if (this.file instanceof Uint8Array) {\n // Note if end > this.uint8Array.byteLength, we just get a small last\n // chunk.\n resolve(new Uint8Array(this.file.slice(this.offset, end)));\n } else {\n // This branch assumes that this.file type is File or Blob, which\n // means it is in the browser environment.\n\n // TODO(soergel): is this a performance issue?\n const fileReader = new FileReader();\n fileReader.onload = (event) => {\n let data: string|ArrayBuffer|Uint8Array = fileReader.result;\n // Not sure we can trust the return type of\n // FileReader.readAsArrayBuffer See e.g.\n // https://github.com/node-file-api/FileReader/issues/2\n if (data instanceof ArrayBuffer) {\n data = new Uint8Array(data);\n }\n if (!(data instanceof Uint8Array)) {\n return reject(new TypeError('FileReader returned unknown type.'));\n }\n resolve(data);\n };\n fileReader.onabort = (event) => {\n return reject(new Error('Aborted'));\n };\n fileReader.onerror = (event) => {\n return reject(new Error(event.type));\n };\n // TODO(soergel): better handle onabort, onerror\n // Note if end > this.file.size, we just get a small last chunk.\n const slice = this.file.slice(this.offset, end);\n // We can't use readAsText here (even if we know the file is text)\n // because the slice boundary may fall within a multi-byte character.\n fileReader.readAsArrayBuffer(slice);\n }\n this.offset = end;\n });\n return {value: (await chunk), done: false};\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {util} from '@tensorflow/tfjs-core';\nimport {FileChunkIterator, FileChunkIteratorOptions} from './file_chunk_iterator';\n\n/**\n * Provide a stream of chunks from a URL.\n *\n * Note this class first downloads the entire file into memory before providing\n * the first element from the stream. This is because the Fetch API does not\n * yet reliably provide a reader stream for the response body.\n */\nexport async function urlChunkIterator(\n url: RequestInfo, options: FileChunkIteratorOptions = {}) {\n let urlString;\n let requestInit;\n if ((typeof url) === 'string') {\n urlString = url as string;\n } else {\n urlString = (url as Request).url;\n requestInit = getRequestInitFromRequest(url as Request);\n }\n const response = await util.fetch(urlString, requestInit);\n if (response.ok) {\n const uint8Array = new Uint8Array(await response.arrayBuffer());\n return new FileChunkIterator(uint8Array, options);\n } else {\n throw new Error(response.statusText);\n }\n}\n\n// Generate RequestInit from Request to match tf.util.fetch signature.\nconst getRequestInitFromRequest = (request: Request) => {\n const init = {\n method: request.method,\n headers: request.headers,\n body: request.body,\n mode: request.mode,\n credentials: request.credentials,\n cache: request.cache,\n redirect: request.redirect,\n referrer: request.referrer,\n integrity: request.integrity,\n };\n return init;\n};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\n// Skip tslint any type check cause this method is aiming to check type of\n// input.\n// tslint:disable-next-line:no-any\nexport function isLocalPath(source: any): boolean {\n return (typeof source === 'string') && source.substr(0, 7) === 'file://';\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {env} from '@tensorflow/tfjs-core';\nimport {DataSource} from '../datasource';\nimport {ByteChunkIterator} from '../iterators/byte_chunk_iterator';\nimport {FileChunkIterator, FileChunkIteratorOptions} from '../iterators/file_chunk_iterator';\nimport {FileElement} from '../types';\nimport {isLocalPath} from '../util/source_util';\n\n/**\n * Represents a file, blob, or Uint8Array readable as a stream of binary data\n * chunks.\n */\nexport class FileDataSource extends DataSource {\n /**\n * Create a `FileDataSource`.\n *\n * @param input Local file path, or `File`/`Blob`/`Uint8Array` object to\n * read. Local file only works in node environment.\n * @param options Options passed to the underlying `FileChunkIterator`s,\n * such as {chunksize: 1024}.\n */\n constructor(\n protected input: FileElement|string,\n protected readonly options: FileChunkIteratorOptions = {}) {\n super();\n }\n\n async iterator(): Promise {\n if (isLocalPath(this.input) && env().get('IS_NODE')) {\n // tslint:disable-next-line:no-require-imports\n const fs = require('fs');\n this.input = fs.readFileSync((this.input as string).substr(7));\n }\n // TODO(kangyizhang): Add LocalFileChunkIterator to split local streaming\n // with file in browser.\n return new FileChunkIterator(this.input as FileElement, this.options);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {DataSource} from '../datasource';\nimport {ByteChunkIterator} from '../iterators/byte_chunk_iterator';\nimport {FileChunkIteratorOptions} from '../iterators/file_chunk_iterator';\nimport {urlChunkIterator} from '../iterators/url_chunk_iterator';\nimport {isLocalPath} from '../util/source_util';\nimport {FileDataSource} from './file_data_source';\n\n/*\n * Represents a URL readable as a stream of binary data chunks.\n */\nexport class URLDataSource extends DataSource {\n /**\n * Create a `URLDataSource`.\n *\n * @param url A source URL string, or a `Request` object.\n * @param options Options passed to the underlying `FileChunkIterator`s,\n * such as {chunksize: 1024}.\n */\n constructor(\n protected readonly url: RequestInfo,\n protected readonly fileOptions: FileChunkIteratorOptions = {}) {\n super();\n }\n\n // TODO(soergel): provide appropriate caching options. Currently this\n // will download the URL anew for each call to iterator(). Since we have\n // to treat the downloaded file as a blob/buffer anyway, we may as well retain\n // it-- but that raises GC issues. Also we may want a persistent disk cache.\n async iterator(): Promise {\n if (isLocalPath(this.url)) {\n return (new FileDataSource(this.url as string, this.fileOptions))\n .iterator();\n } else {\n return urlChunkIterator(this.url, this.fileOptions);\n }\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {TensorContainer} from '@tensorflow/tfjs-core';\nimport {Dataset, datasetFromIteratorFn} from './dataset';\nimport {CSVDataset} from './datasets/csv_dataset';\nimport {iteratorFromFunction} from './iterators/lazy_iterator';\nimport {MicrophoneIterator} from './iterators/microphone_iterator';\nimport {WebcamIterator} from './iterators/webcam_iterator';\nimport {URLDataSource} from './sources/url_data_source';\nimport {CSVConfig, MicrophoneConfig, WebcamConfig} from './types';\n\n/**\n * Create a `CSVDataset` by reading and decoding CSV file(s) from provided URL\n * or local path if it's in Node environment.\n *\n * Note: If isLabel in columnConfigs is `true` for at least one column, the\n * element in returned `CSVDataset` will be an object of\n * `{xs:features, ys:labels}`: xs is a dict of features key/value pairs, ys\n * is a dict of labels key/value pairs. If no column is marked as label,\n * returns a dict of features only.\n *\n * ```js\n * const csvUrl =\n * 'https://storage.googleapis.com/tfjs-examples/multivariate-linear-regression/data/boston-housing-train.csv';\n *\n * async function run() {\n * // We want to predict the column \"medv\", which represents a median value of\n * // a home (in $1000s), so we mark it as a label.\n * const csvDataset = tf.data.csv(\n * csvUrl, {\n * columnConfigs: {\n * medv: {\n * isLabel: true\n * }\n * }\n * });\n *\n * // Number of features is the number of column names minus one for the label\n * // column.\n * const numOfFeatures = (await csvDataset.columnNames()).length - 1;\n *\n * // Prepare the Dataset for training.\n * const flattenedDataset =\n * csvDataset\n * .map(({xs, ys}) =>\n * {\n * // Convert xs(features) and ys(labels) from object form (keyed by\n * // column name) to array form.\n * return {xs:Object.values(xs), ys:Object.values(ys)};\n * })\n * .batch(10);\n *\n * // Define the model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense({\n * inputShape: [numOfFeatures],\n * units: 1\n * }));\n * model.compile({\n * optimizer: tf.train.sgd(0.000001),\n * loss: 'meanSquaredError'\n * });\n *\n * // Fit the model using the prepared Dataset\n * return model.fitDataset(flattenedDataset, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * console.log(epoch + ':' + logs.loss);\n * }\n * }\n * });\n * }\n *\n * await run();\n * ```\n *\n * @param source URL or local path to get CSV file. If it's a local path, it\n * must have prefix `file://` and it only works in node environment.\n * @param csvConfig (Optional) A CSVConfig object that contains configurations\n * of reading and decoding from CSV file(s).\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * configParamIndices: [1]\n * }\n */\nexport function csv(\n source: RequestInfo, csvConfig: CSVConfig = {}): CSVDataset {\n return new CSVDataset(new URLDataSource(source), csvConfig);\n}\n\n/**\n * Create a `Dataset` that produces each element by calling a provided function.\n *\n * Note that repeated iterations over this `Dataset` may produce different\n * results, because the function will be called anew for each element of each\n * iteration.\n *\n * Also, beware that the sequence of calls to this function may be out of order\n * in time with respect to the logical order of the Dataset. This is due to the\n * asynchronous lazy nature of stream processing, and depends on downstream\n * transformations (e.g. .shuffle()). If the provided function is pure, this is\n * no problem, but if it is a closure over a mutable state (e.g., a traversal\n * pointer), then the order of the produced elements may be scrambled.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const ds = tf.data.func(func);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * @param f A function that produces one data element on each call.\n */\nexport function func(\n f: () => IteratorResult| Promise>): Dataset {\n const iter = iteratorFromFunction(f);\n return datasetFromIteratorFn(async () => iter);\n}\n\n/**\n * Create a `Dataset` that produces each element from provided JavaScript\n * generator, which is a function*\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions),\n * or a function that returns an\n * iterator\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions).\n *\n * The returned iterator should have `.next()` function that returns element in\n * format of `{value: TensorContainer, done:boolean}`.\n *\n * Example of creating a dataset from an iterator factory:\n * ```js\n * function makeIterator() {\n * const numElements = 10;\n * let index = 0;\n *\n * const iterator = {\n * next: () => {\n * let result;\n * if (index < numElements) {\n * result = {value: index, done: false};\n * index++;\n * return result;\n * }\n * return {value: index, done: true};\n * }\n * };\n * return iterator;\n * }\n * const ds = tf.data.generator(makeIterator);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * Example of creating a dataset from a generator:\n * ```js\n * function* dataGenerator() {\n * const numElements = 10;\n * let index = 0;\n * while (index < numElements) {\n * const x = index;\n * index++;\n * yield x;\n * }\n * }\n *\n * const ds = tf.data.generator(dataGenerator);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * @param generator A Javascript generator function that returns a JavaScript\n * iterator.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * configParamIndices: [1]\n * }\n */\nexport function generator(\n generator: () => Iterator| Promise>): Dataset {\n return datasetFromIteratorFn(async () => {\n const gen = await generator();\n return iteratorFromFunction(() => gen.next());\n });\n}\n\n/**\n * Create an iterator that generate `Tensor`s from webcam video stream. This API\n * only works in Browser environment when the device has webcam.\n *\n * Note: this code snippet only works when the device has a webcam. It will\n * request permission to open the webcam when running.\n * ```js\n * const videoElement = document.createElement('video');\n * videoElement.width = 100;\n * videoElement.height = 100;\n * const cam = await tf.data.webcam(videoElement);\n * const img = await cam.capture();\n * img.print();\n * cam.stop();\n * ```\n *\n * @param webcamVideoElement A `HTMLVideoElement` used to play video from\n * webcam. If this element is not provided, a hidden `HTMLVideoElement` will\n * be created. In that case, `resizeWidth` and `resizeHeight` must be\n * provided to set the generated tensor shape.\n * @param webcamConfig A `WebcamConfig` object that contains configurations of\n * reading and manipulating data from webcam video stream.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * ignoreCI: true\n * }\n */\nexport async function webcam(\n webcamVideoElement?: HTMLVideoElement,\n webcamConfig?: WebcamConfig): Promise {\n return WebcamIterator.create(webcamVideoElement, webcamConfig);\n}\n\n/**\n * Create an iterator that generate frequency-domain spectrogram `Tensor`s from\n * microphone audio stream with browser's native FFT. This API only works in\n * browser environment when the device has microphone.\n *\n * Note: this code snippet only works when the device has a microphone. It will\n * request permission to open the microphone when running.\n * ```js\n * const mic = await tf.data.microphone({\n * fftSize: 1024,\n * columnTruncateLength: 232,\n * numFramesPerSpectrogram: 43,\n * sampleRateHz:44100,\n * includeSpectrogram: true,\n * includeWaveform: true\n * });\n * const audioData = await mic.capture();\n * const spectrogramTensor = audioData.spectrogram;\n * spectrogramTensor.print();\n * const waveformTensor = audioData.waveform;\n * waveformTensor.print();\n * mic.stop();\n * ```\n *\n * @param microphoneConfig A `MicrophoneConfig` object that contains\n * configurations of reading audio data from microphone.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * ignoreCI: true\n * }\n */\nexport async function microphone(microphoneConfig?: MicrophoneConfig):\n Promise {\n return MicrophoneIterator.create(microphoneConfig);\n}\n","/** @license See the LICENSE file. */\n\n// This code is auto-generated, do not modify this file!\nconst version = '3.6.0';\nexport {version};\n"],"names":["global","module","define","Alea","seed","n","me","this","mash","data","toString","i","length","h","charCodeAt","next","t","s0","c","s1","s2","copy","f","impl","opts","xg","state","prng","int32","double","quick","exports","amd","alea","XorGen","strseed","x","y","z","w","k","result","xor128","v","d","xorwow","X","j","push","init","slice","Date","xorshift7","limit","Math","max","xor4096","b","a","floor","tychei","pool","math","nodecrypto","width","startdenom","pow","significance","overflow","mask","seedrandom","options","callback","key","shortseed","mixkey","flatten","entropy","tostring","out","randomBytes","Uint8Array","crypto","msCrypto","getRandomValues","e","browser","navigator","plugins","screen","autoseed","arc4","ARC4","g","S","pass","is_math_call","keylen","s","count","r","obj","depth","prop","typ","smear","stringseed","String","fromCharCode","apply","random","require","ex","sr","deepMapInternal","input","mapFn","seen","containedIn","Map","Set","has","Error","get","recurse","value","isIterable","mappedIterable","Array","isArray","add","childResult","delete","set","deepZip","inputs","zipFn","deepZipInternal","map","zipToList","deepMapAndAwaitAll","_a","from","keys","_i","tf.util","isPromise","mappedValue","_b","ArrayBuffer","isView","tf.Tensor","deepClone","container","cloneIfTensor","item","clone","capacity","RangeError","doubledCapacity","RingBuffer","index","end","begin","isFull","wrap","values","values_1","isEmpty","undefined","relativeIndex","pop","_super","GrowingRingBuffer","INITIAL_CAPACITY","tslib_1.__extends","expand","unshift","newCapacity","newData","len","iteratorFromItems","items","ArrayIterator","iteratorFromFunction","func","FunctionCallIterator","ZipMismatchMode","LazyIterator","done","stream","prefetch","predicate","shouldContinue","handler","ErrorHandlingLazyIterator","FilterIterator","transform","MapIterator","AsyncMapIterator","serial","FlatmapIterator","resolveFully","serialMapAsync","resolveWhile","batchSize","smallLastBatch","RowMajorBatchIterator","rowMajorBatch","iterator","baseErrorHandler","ChainedIterator","TakeIterator","SkipIterator","bufferSize","PrefetchIterator","windowSize","ShuffleIterator","SerialIterator","_this","trav","nextFn","message","upstream","lastRead","Promise","resolve","summary","then","serialNext","maxCount","skipped","tf.dispose","enableSmallLastBatch","batch","inputTensors","tf.tensor_util","getTensorsInContainer","mapped","outputTensors","inputTensors_1","isTensorInList","dispose","e_1","inputTensors_2","outputQueue","OneToManyIterator","pump","shift","mappedArray","pushAll","inputTensors_3","iterators","moreIterators","upstreamSummaries","readFromChain","iteratorResult","handleErrors","itemResult","mismatchMode","FAIL","ZipIterator","afterState","getNext","numIterators","iteratorsDone","SHORTEST","LONGEST","currentPromise","nextState","buffer","refill","seedrandom.alea","now","randomInt","upstreamExhausted","chosenIndex","chooseIndex","shuffleExcise","Dataset","base","assert","datasetFromIteratorFn","columnMajorBatch","deepBatchConcat","size","Infinity","ceil","dataset","_c","concatenate","filter","tf.tidy","forEachAsync","mapAsync","iteratorIterator","baseIterators","take","skip","reshuffleEachIteration","seed2","shuffle","toArray","toArrayForTest","iteratorFn","class_1","rows","isTypedArray","canTensorify","arrays","tf.stack","tf.tensor","batchConcat","TextLineDataset","inputIterator","utf8Iterator","decodeUTF8","split","line","endsWith","CODE_QUOTE","STATE_OUT","Symbol","STATE_FIELD","STATE_QUOTE","STATE_QUOTE_AFTER_QUOTE","STATE_WITHIN_QUOTE_IN_QUOTE","csvConfig","hasHeader","fullColumnNames","columnNames","columnConfigs","configuredColumnsOnly","delimWhitespace","util","delimiter","CSVDataset","columnNamesValidated","setColumnNames","Object","maybeReadHeaderLine","columnNamesFromFile","counts","reduce","countAcc","name","duplicateNames","indexOf","firstElement","firstLine","parseRow","lines","makeDataElement","features","labels","config","parsedValue","default","required","isLabel","valueAsNum","Number","isNaN","dtype","getBoolean","xs","ys","toLowerCase","validateElementCount","readOffset","readLength","currentState","charAt","substring","microphoneConfig","fftSize","fftSizeLog2","log2","isInteger","numFrames","numFramesPerSpectrogram","sampleRateHz","columnTruncateLength","audioTrackConstraints","smoothingTimeConstant","includeSpectrogram","includeWaveform","MicrophoneIterator","env","microphoneIterator","start","mediaDevices","getUserMedia","audio","video","ctxConstructor","window","AudioContext","webkitAudioContext","audioContext","sampleRate","streamSource","createMediaStreamSource","analyser","createAnalyser","connect","freqData","Float32Array","timeData","isClosed","getAudioData","audioDataQueue","flattenQueue","freqDataQueue","spectrogramTensor","getTensorFromAudioDataArray","timeDataQueue","waveformTensor","spectrogram","waveform","currentFrames","intervalID","setInterval","getFloatFrequencyData","getFloatTimeDomainData","clearInterval","disconnect","close","getTracks","stop","queue","frameSize","forEach","shape","vals","sizeFromShape","tensor","webcamVideoElement","webcamConfig","needToResize","resize","cropSize","resizeHeight","resizeWidth","cropBoxInd","tensor1d","centerCrop","widthCroppingRatio","heightCroppingRatio","height","widthCropStart","heightCropStart","widthCropEnd","heightCropEnd","cropBox","tensor2d","WebcamIterator","document","createElement","webcamIterator","facingMode","deviceId","srcObject","error","console","log","src","URL","createObjectURL","play","onloadedmetadata","img","fromPixels","JSON","stringify","cropAndResizeFrame","tidy","resizedImage","expandedImage","expandDims","cast","image","cropAndResize","reshape","track","StringIterator","separator","SplitIterator","SplitIteratorImpl","chunkResult","carryover","ByteChunkIterator","Utf8Iterator","Utf8IteratorImpl","decoder","TextDecoder","StringDecoder","chunk","text","decode","write","Buffer","file","File","Blob","offset","chunkSize","FileChunkIterator","byteLength","reject","fileReader_1","FileReader","onload","event","TypeError","onabort","onerror","type","readAsArrayBuffer","urlChunkIterator","url","urlString","requestInit","getRequestInitFromRequest","fetch","response","ok","arrayBuffer","uint8Array","statusText","request","method","headers","body","mode","credentials","cache","redirect","referrer","integrity","isLocalPath","source","substr","FileDataSource","fs","readFileSync","DataSource","fileOptions","URLDataSource","iter","generator","gen","create","datasets","min","ds","streams"],"mappings":";;;;;;;;;;;;;;;;goEA2BA,SAAUA,EAAQC,EAAQC,GAE1B,SAASC,EAAKC,GACZ,IAgDIC,EAhDAC,EAAKC,KAAMC,GAgDXH,EAAI,WAEG,SAASI,GAClBA,EAAOA,EAAKC,WACZ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BkR,KAC5BvO,KAAKof,IAAI7Q,EAAO4Q,EAAS9hB,GAAkBkR,WAE9D,GAAI4Q,aAAoBtN,OAC7B,IAAK,IAAMwN,KAAMF,EACf5Q,EAAe,MAARA,EAAgB4Q,EAASE,GAAmB9Q,KAC7BvO,KAAKof,IAAI7Q,EAAO4Q,EAASE,GAAmB9Q,MAGtE,OAAOH,GAAyB,wGACd,SAAM9I,EAAmB6Z,GAAU,SAAA7f,GACjD,GAAIA,aAAa2O,EACf,MAAO,CAAC1J,MAAOjF,EAAEqK,WAAYrF,SAAS,GACjC,GAAIE,EAAWlF,GACpB,MAAO,CAACiF,MAAO,KAAMD,SAAS,GAE9B,MAAM,IAAIF,MACN,wFAIR,OAXMkb,EAAU/Z,aD7fhB+G,ECwgB6BgT,EDvgB7BzS,ECugBsCxE,EAAgB+E,sBDvgBtDP,EAAgCxE,EAAgByE,MAC3C,IAAIC,EAAeT,EAAWO,SAFnCP,EACAO,UCwgBC0B"} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.node.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.node.js deleted file mode 100644 index 5b374fd57..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.node.js +++ /dev/null @@ -1,5411 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============================================================================= - */ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var tf = require('@tensorflow/tfjs-core'); - -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise */ - -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); -}; - -function __extends(d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; - -function createCommonjsModule(fn, module) { - return module = { exports: {} }, fn(module, module.exports), module.exports; -} - -var alea = createCommonjsModule(function (module) { -// A port of an algorithm by Johannes Baagøe , 2010 -// http://baagoe.com/en/RandomMusings/javascript/ -// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror -// Original work is under MIT license - - -// Copyright (C) 2010 by Johannes Baagøe -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - - - -(function(global, module, define) { - -function Alea(seed) { - var me = this, mash = Mash(); - - me.next = function() { - var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32 - me.s0 = me.s1; - me.s1 = me.s2; - return me.s2 = t - (me.c = t | 0); - }; - - // Apply the seeding algorithm from Baagoe. - me.c = 1; - me.s0 = mash(' '); - me.s1 = mash(' '); - me.s2 = mash(' '); - me.s0 -= mash(seed); - if (me.s0 < 0) { me.s0 += 1; } - me.s1 -= mash(seed); - if (me.s1 < 0) { me.s1 += 1; } - me.s2 -= mash(seed); - if (me.s2 < 0) { me.s2 += 1; } - mash = null; -} - -function copy(f, t) { - t.c = f.c; - t.s0 = f.s0; - t.s1 = f.s1; - t.s2 = f.s2; - return t; -} - -function impl(seed, opts) { - var xg = new Alea(seed), - state = opts && opts.state, - prng = xg.next; - prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }; - prng.double = function() { - return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53 - }; - prng.quick = prng; - if (state) { - if (typeof(state) == 'object') copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; -} - -function Mash() { - var n = 0xefc8249d; - - var mash = function(data) { - data = data.toString(); - for (var i = 0; i < data.length; i++) { - n += data.charCodeAt(i); - var h = 0.02519603282416938 * n; - n = h >>> 0; - h -= n; - h *= n; - n = h >>> 0; - h -= n; - n += h * 0x100000000; // 2^32 - } - return (n >>> 0) * 2.3283064365386963e-10; // 2^-32 - }; - - return mash; -} - - -if (module && module.exports) { - module.exports = impl; -} else if (define && define.amd) { - define(function() { return impl; }); -} else { - this.alea = impl; -} - -})( - commonjsGlobal, - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader -); -}); - -var xor128 = createCommonjsModule(function (module) { -// A Javascript implementaion of the "xor128" prng algorithm by -// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper - -(function(global, module, define) { - -function XorGen(seed) { - var me = this, strseed = ''; - - me.x = 0; - me.y = 0; - me.z = 0; - me.w = 0; - - // Set up generator function. - me.next = function() { - var t = me.x ^ (me.x << 11); - me.x = me.y; - me.y = me.z; - me.z = me.w; - return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8); - }; - - if (seed === (seed | 0)) { - // Integer seed. - me.x = seed; - } else { - // String seed. - strseed += seed; - } - - // Mix in string seed, then discard an initial batch of 64 values. - for (var k = 0; k < strseed.length + 64; k++) { - me.x ^= strseed.charCodeAt(k) | 0; - me.next(); - } -} - -function copy(f, t) { - t.x = f.x; - t.y = f.y; - t.z = f.z; - t.w = f.w; - return t; -} - -function impl(seed, opts) { - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (typeof(state) == 'object') copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; -} - -if (module && module.exports) { - module.exports = impl; -} else if (define && define.amd) { - define(function() { return impl; }); -} else { - this.xor128 = impl; -} - -})( - commonjsGlobal, - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader -); -}); - -var xorwow = createCommonjsModule(function (module) { -// A Javascript implementaion of the "xorwow" prng algorithm by -// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper - -(function(global, module, define) { - -function XorGen(seed) { - var me = this, strseed = ''; - - // Set up generator function. - me.next = function() { - var t = (me.x ^ (me.x >>> 2)); - me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v; - return (me.d = (me.d + 362437 | 0)) + - (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0; - }; - - me.x = 0; - me.y = 0; - me.z = 0; - me.w = 0; - me.v = 0; - - if (seed === (seed | 0)) { - // Integer seed. - me.x = seed; - } else { - // String seed. - strseed += seed; - } - - // Mix in string seed, then discard an initial batch of 64 values. - for (var k = 0; k < strseed.length + 64; k++) { - me.x ^= strseed.charCodeAt(k) | 0; - if (k == strseed.length) { - me.d = me.x << 10 ^ me.x >>> 4; - } - me.next(); - } -} - -function copy(f, t) { - t.x = f.x; - t.y = f.y; - t.z = f.z; - t.w = f.w; - t.v = f.v; - t.d = f.d; - return t; -} - -function impl(seed, opts) { - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (typeof(state) == 'object') copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; -} - -if (module && module.exports) { - module.exports = impl; -} else if (define && define.amd) { - define(function() { return impl; }); -} else { - this.xorwow = impl; -} - -})( - commonjsGlobal, - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader -); -}); - -var xorshift7 = createCommonjsModule(function (module) { -// A Javascript implementaion of the "xorshift7" algorithm by -// François Panneton and Pierre L'ecuyer: -// "On the Xorgshift Random Number Generators" -// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf - -(function(global, module, define) { - -function XorGen(seed) { - var me = this; - - // Set up generator function. - me.next = function() { - // Update xor generator. - var X = me.x, i = me.i, t, v; - t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24); - t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10); - t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3); - t = X[(i + 4) & 7]; v ^= t ^ (t << 7); - t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9); - X[i] = v; - me.i = (i + 1) & 7; - return v; - }; - - function init(me, seed) { - var j, w, X = []; - - if (seed === (seed | 0)) { - // Seed state array using a 32-bit integer. - w = X[0] = seed; - } else { - // Seed state using a string. - seed = '' + seed; - for (j = 0; j < seed.length; ++j) { - X[j & 7] = (X[j & 7] << 15) ^ - (seed.charCodeAt(j) + X[(j + 1) & 7] << 13); - } - } - // Enforce an array length of 8, not all zeroes. - while (X.length < 8) X.push(0); - for (j = 0; j < 8 && X[j] === 0; ++j); - if (j == 8) w = X[7] = -1; else w = X[j]; - - me.x = X; - me.i = 0; - - // Discard an initial 256 values. - for (j = 256; j > 0; --j) { - me.next(); - } - } - - init(me, seed); -} - -function copy(f, t) { - t.x = f.x.slice(); - t.i = f.i; - return t; -} - -function impl(seed, opts) { - if (seed == null) seed = +(new Date); - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (state.x) copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; -} - -if (module && module.exports) { - module.exports = impl; -} else if (define && define.amd) { - define(function() { return impl; }); -} else { - this.xorshift7 = impl; -} - -})( - commonjsGlobal, - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader -); -}); - -var xor4096 = createCommonjsModule(function (module) { -// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm. -// -// This fast non-cryptographic random number generator is designed for -// use in Monte-Carlo algorithms. It combines a long-period xorshift -// generator with a Weyl generator, and it passes all common batteries -// of stasticial tests for randomness while consuming only a few nanoseconds -// for each prng generated. For background on the generator, see Brent's -// paper: "Some long-period random number generators using shifts and xors." -// http://arxiv.org/pdf/1004.3115v1.pdf -// -// Usage: -// -// var xor4096 = require('xor4096'); -// random = xor4096(1); // Seed with int32 or string. -// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits. -// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits. -// -// For nonzero numeric keys, this impelementation provides a sequence -// identical to that by Brent's xorgens 3 implementaion in C. This -// implementation also provides for initalizing the generator with -// string seeds, or for saving and restoring the state of the generator. -// -// On Chrome, this prng benchmarks about 2.1 times slower than -// Javascript's built-in Math.random(). - -(function(global, module, define) { - -function XorGen(seed) { - var me = this; - - // Set up generator function. - me.next = function() { - var w = me.w, - X = me.X, i = me.i, t, v; - // Update Weyl generator. - me.w = w = (w + 0x61c88647) | 0; - // Update xor generator. - v = X[(i + 34) & 127]; - t = X[i = ((i + 1) & 127)]; - v ^= v << 13; - t ^= t << 17; - v ^= v >>> 15; - t ^= t >>> 12; - // Update Xor generator array state. - v = X[i] = v ^ t; - me.i = i; - // Result is the combination. - return (v + (w ^ (w >>> 16))) | 0; - }; - - function init(me, seed) { - var t, v, i, j, w, X = [], limit = 128; - if (seed === (seed | 0)) { - // Numeric seeds initialize v, which is used to generates X. - v = seed; - seed = null; - } else { - // String seeds are mixed into v and X one character at a time. - seed = seed + '\0'; - v = 0; - limit = Math.max(limit, seed.length); - } - // Initialize circular array and weyl value. - for (i = 0, j = -32; j < limit; ++j) { - // Put the unicode characters into the array, and shuffle them. - if (seed) v ^= seed.charCodeAt((j + 32) % seed.length); - // After 32 shuffles, take v as the starting w value. - if (j === 0) w = v; - v ^= v << 10; - v ^= v >>> 15; - v ^= v << 4; - v ^= v >>> 13; - if (j >= 0) { - w = (w + 0x61c88647) | 0; // Weyl. - t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array. - i = (0 == t) ? i + 1 : 0; // Count zeroes. - } - } - // We have detected all zeroes; make the key nonzero. - if (i >= 128) { - X[(seed && seed.length || 0) & 127] = -1; - } - // Run the generator 512 times to further mix the state before using it. - // Factoring this as a function slows the main generator, so it is just - // unrolled here. The weyl generator is not advanced while warming up. - i = 127; - for (j = 4 * 128; j > 0; --j) { - v = X[(i + 34) & 127]; - t = X[i = ((i + 1) & 127)]; - v ^= v << 13; - t ^= t << 17; - v ^= v >>> 15; - t ^= t >>> 12; - X[i] = v ^ t; - } - // Storing state as object members is faster than using closure variables. - me.w = w; - me.X = X; - me.i = i; - } - - init(me, seed); -} - -function copy(f, t) { - t.i = f.i; - t.w = f.w; - t.X = f.X.slice(); - return t; -} -function impl(seed, opts) { - if (seed == null) seed = +(new Date); - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (state.X) copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; -} - -if (module && module.exports) { - module.exports = impl; -} else if (define && define.amd) { - define(function() { return impl; }); -} else { - this.xor4096 = impl; -} - -})( - commonjsGlobal, // window object or global - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader -); -}); - -var tychei = createCommonjsModule(function (module) { -// A Javascript implementaion of the "Tyche-i" prng algorithm by -// Samuel Neves and Filipe Araujo. -// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf - -(function(global, module, define) { - -function XorGen(seed) { - var me = this, strseed = ''; - - // Set up generator function. - me.next = function() { - var b = me.b, c = me.c, d = me.d, a = me.a; - b = (b << 25) ^ (b >>> 7) ^ c; - c = (c - d) | 0; - d = (d << 24) ^ (d >>> 8) ^ a; - a = (a - b) | 0; - me.b = b = (b << 20) ^ (b >>> 12) ^ c; - me.c = c = (c - d) | 0; - me.d = (d << 16) ^ (c >>> 16) ^ a; - return me.a = (a - b) | 0; - }; - - /* The following is non-inverted tyche, which has better internal - * bit diffusion, but which is about 25% slower than tyche-i in JS. - me.next = function() { - var a = me.a, b = me.b, c = me.c, d = me.d; - a = (me.a + me.b | 0) >>> 0; - d = me.d ^ a; d = d << 16 ^ d >>> 16; - c = me.c + d | 0; - b = me.b ^ c; b = b << 12 ^ d >>> 20; - me.a = a = a + b | 0; - d = d ^ a; me.d = d = d << 8 ^ d >>> 24; - me.c = c = c + d | 0; - b = b ^ c; - return me.b = (b << 7 ^ b >>> 25); - } - */ - - me.a = 0; - me.b = 0; - me.c = 2654435769 | 0; - me.d = 1367130551; - - if (seed === Math.floor(seed)) { - // Integer seed. - me.a = (seed / 0x100000000) | 0; - me.b = seed | 0; - } else { - // String seed. - strseed += seed; - } - - // Mix in string seed, then discard an initial batch of 64 values. - for (var k = 0; k < strseed.length + 20; k++) { - me.b ^= strseed.charCodeAt(k) | 0; - me.next(); - } -} - -function copy(f, t) { - t.a = f.a; - t.b = f.b; - t.c = f.c; - t.d = f.d; - return t; -} -function impl(seed, opts) { - var xg = new XorGen(seed), - state = opts && opts.state, - prng = function() { return (xg.next() >>> 0) / 0x100000000; }; - prng.double = function() { - do { - var top = xg.next() >>> 11, - bot = (xg.next() >>> 0) / 0x100000000, - result = (top + bot) / (1 << 21); - } while (result === 0); - return result; - }; - prng.int32 = xg.next; - prng.quick = prng; - if (state) { - if (typeof(state) == 'object') copy(state, xg); - prng.state = function() { return copy(xg, {}); }; - } - return prng; -} - -if (module && module.exports) { - module.exports = impl; -} else if (define && define.amd) { - define(function() { return impl; }); -} else { - this.tychei = impl; -} - -})( - commonjsGlobal, - module, // present in node.js - (typeof undefined) == 'function' // present with an AMD loader -); -}); - -var seedrandom = createCommonjsModule(function (module) { -/* -Copyright 2014 David Bau. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -*/ - -(function (pool, math) { -// -// The following constants are related to IEEE 754 limits. -// -var global = this, - width = 256, // each RC4 output is 0 <= x < 256 - chunks = 6, // at least six RC4 outputs for each double - digits = 52, // there are 52 significant digits in a double - rngname = 'random', // rngname: name for Math.random and Math.seedrandom - startdenom = math.pow(width, chunks), - significance = math.pow(2, digits), - overflow = significance * 2, - mask = width - 1, - nodecrypto; // node.js crypto module, initialized at the bottom. - -// -// seedrandom() -// This is the seedrandom function described above. -// -function seedrandom(seed, options, callback) { - var key = []; - options = (options == true) ? { entropy: true } : (options || {}); - - // Flatten the seed string or build one from local entropy if needed. - var shortseed = mixkey(flatten( - options.entropy ? [seed, tostring(pool)] : - (seed == null) ? autoseed() : seed, 3), key); - - // Use the seed to initialize an ARC4 generator. - var arc4 = new ARC4(key); - - // This function returns a random double in [0, 1) that contains - // randomness in every bit of the mantissa of the IEEE 754 value. - var prng = function() { - var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48 - d = startdenom, // and denominator d = 2 ^ 48. - x = 0; // and no 'extra last byte'. - while (n < significance) { // Fill up all significant digits by - n = (n + x) * width; // shifting numerator and - d *= width; // denominator and generating a - x = arc4.g(1); // new least-significant-byte. - } - while (n >= overflow) { // To avoid rounding up, before adding - n /= 2; // last byte, shift everything - d /= 2; // right using integer math until - x >>>= 1; // we have exactly the desired bits. - } - return (n + x) / d; // Form the number within [0, 1). - }; - - prng.int32 = function() { return arc4.g(4) | 0; }; - prng.quick = function() { return arc4.g(4) / 0x100000000; }; - prng.double = prng; - - // Mix the randomness into accumulated entropy. - mixkey(tostring(arc4.S), pool); - - // Calling convention: what to return as a function of prng, seed, is_math. - return (options.pass || callback || - function(prng, seed, is_math_call, state) { - if (state) { - // Load the arc4 state from the given state if it has an S array. - if (state.S) { copy(state, arc4); } - // Only provide the .state method if requested via options.state. - prng.state = function() { return copy(arc4, {}); }; - } - - // If called as a method of Math (Math.seedrandom()), mutate - // Math.random because that is how seedrandom.js has worked since v1.0. - if (is_math_call) { math[rngname] = prng; return seed; } - - // Otherwise, it is a newer calling convention, so return the - // prng directly. - else return prng; - })( - prng, - shortseed, - 'global' in options ? options.global : (this == math), - options.state); -} -math['seed' + rngname] = seedrandom; - -// -// ARC4 -// -// An ARC4 implementation. The constructor takes a key in the form of -// an array of at most (width) integers that should be 0 <= x < (width). -// -// The g(count) method returns a pseudorandom integer that concatenates -// the next (count) outputs from ARC4. Its return value is a number x -// that is in the range 0 <= x < (width ^ count). -// -function ARC4(key) { - var t, keylen = key.length, - me = this, i = 0, j = me.i = me.j = 0, s = me.S = []; - - // The empty key [] is treated as [0]. - if (!keylen) { key = [keylen++]; } - - // Set up S using the standard key scheduling algorithm. - while (i < width) { - s[i] = i++; - } - for (i = 0; i < width; i++) { - s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))]; - s[j] = t; - } - - // The "g" method returns the next (count) outputs as one number. - (me.g = function(count) { - // Using instance members instead of closure state nearly doubles speed. - var t, r = 0, - i = me.i, j = me.j, s = me.S; - while (count--) { - t = s[i = mask & (i + 1)]; - r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))]; - } - me.i = i; me.j = j; - return r; - // For robust unpredictability, the function call below automatically - // discards an initial batch of values. This is called RC4-drop[256]. - // See http://google.com/search?q=rsa+fluhrer+response&btnI - })(width); -} - -// -// copy() -// Copies internal state of ARC4 to or from a plain object. -// -function copy(f, t) { - t.i = f.i; - t.j = f.j; - t.S = f.S.slice(); - return t; -} -// -// flatten() -// Converts an object tree to nested arrays of strings. -// -function flatten(obj, depth) { - var result = [], typ = (typeof obj), prop; - if (depth && typ == 'object') { - for (prop in obj) { - try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {} - } - } - return (result.length ? result : typ == 'string' ? obj : obj + '\0'); -} - -// -// mixkey() -// Mixes a string seed into a key that is an array of integers, and -// returns a shortened string seed that is equivalent to the result key. -// -function mixkey(seed, key) { - var stringseed = seed + '', smear, j = 0; - while (j < stringseed.length) { - key[mask & j] = - mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++)); - } - return tostring(key); -} - -// -// autoseed() -// Returns an object for autoseeding, using window.crypto and Node crypto -// module if available. -// -function autoseed() { - try { - var out; - if (nodecrypto && (out = nodecrypto.randomBytes)) { - // The use of 'out' to remember randomBytes makes tight minified code. - out = out(width); - } else { - out = new Uint8Array(width); - (global.crypto || global.msCrypto).getRandomValues(out); - } - return tostring(out); - } catch (e) { - var browser = global.navigator, - plugins = browser && browser.plugins; - return [+new Date, global, plugins, global.screen, tostring(pool)]; - } -} - -// -// tostring() -// Converts an array of charcodes to a string -// -function tostring(a) { - return String.fromCharCode.apply(0, a); -} - -// -// When seedrandom.js is loaded, we immediately mix a few bits -// from the built-in RNG into the entropy pool. Because we do -// not want to interfere with deterministic PRNG state later, -// seedrandom will not call math.random on its own again after -// initialization. -// -mixkey(math.random(), pool); - -// -// Nodejs and AMD support: export the implementation as a module using -// either convention. -// -if ( module.exports) { - module.exports = seedrandom; - // When in node.js, try using crypto package for autoseeding. - try { - nodecrypto = require('crypto'); - } catch (ex) {} -} - -// End anonymous scope, and pass initial values. -})( - [], // pool: entropy pool starts empty - Math // math: package containing random, pow, and seedrandom -); -}); - -// A library of seedable RNGs implemented in Javascript. -// -// Usage: -// -// var seedrandom = require('seedrandom'); -// var random = seedrandom(1); // or any seed. -// var x = random(); // 0 <= x < 1. Every bit is random. -// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness. - -// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe. -// Period: ~2^116 -// Reported to pass all BigCrush tests. - - -// xor128, a pure xor-shift generator by George Marsaglia. -// Period: 2^128-1. -// Reported to fail: MatrixRank and LinearComp. - - -// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl. -// Period: 2^192-2^32 -// Reported to fail: CollisionOver, SimpPoker, and LinearComp. - - -// xorshift7, by François Panneton and Pierre L'ecuyer, takes -// a different approach: it adds robustness by allowing more shifts -// than Marsaglia's original three. It is a 7-shift generator -// with 256 bits, that passes BigCrush with no systmatic failures. -// Period 2^256-1. -// No systematic BigCrush failures reported. - - -// xor4096, by Richard Brent, is a 4096-bit xor-shift with a -// very long period that also adds a Weyl generator. It also passes -// BigCrush with no systematic failures. Its long period may -// be useful if you have many generators and need to avoid -// collisions. -// Period: 2^4128-2^32. -// No systematic BigCrush failures reported. - - -// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random -// number generator derived from ChaCha, a modern stream cipher. -// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf -// Period: ~2^127 -// No systematic BigCrush failures reported. - - -// The original ARC4-based prng included in this library. -// Period: ~2^1600 - - -seedrandom.alea = alea; -seedrandom.xor128 = xor128; -seedrandom.xorwow = xorwow; -seedrandom.xorshift7 = xorshift7; -seedrandom.xor4096 = xor4096; -seedrandom.tychei = tychei; - -var seedrandom$1 = seedrandom; -var seedrandom_1 = seedrandom$1.alea; - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/** - * Apply a mapping function to a nested structure in a recursive manner. - * - * The result of the mapping is an object with the same nested structure (i.e., - * of arrays and dicts) as the input, except that some subtrees are replaced, - * according to the results of the mapping function. - * - * Mappings are memoized. Thus, if the nested structure contains the same - * object in multiple positions, the output will contain the same mapped object - * in those positions. Cycles are not supported, however. - * - * @param input: The object to which to apply the mapping function. - * @param mapFn: A function that expects a single node of the object tree, and - * returns a `DeepMapResult`. The `DeepMapResult` either provides a - * replacement value for that node (i.e., replacing the subtree), or indicates - * that the node should be processed recursively. - */ -function deepMap(input, mapFn) { - return deepMapInternal(input, mapFn); -} -/** - * @param seen: A Map of known object mappings (i.e., memoized results of - * `mapFn()`) - * @param containedIn: An set containing objects on the reference path currently - * being processed (used to detect cycles). - */ -function deepMapInternal(input, mapFn, seen, containedIn) { - if (seen === void 0) { seen = new Map(); } - if (containedIn === void 0) { containedIn = new Set(); } - if (input == null) { - return null; - } - if (containedIn.has(input)) { - throw new Error('Circular references are not supported.'); - } - if (seen.has(input)) { - return seen.get(input); - } - var result = mapFn(input); - if (result.recurse && result.value !== null) { - throw new Error('A deep map function may not return both a value and recurse=true.'); - } - if (!result.recurse) { - seen.set(input, result.value); - return result.value; - } - else if (isIterable(input)) { - // tslint:disable-next-line:no-any - var mappedIterable = Array.isArray(input) ? [] : {}; - containedIn.add(input); - for (var k in input) { - var child = input[k]; - var childResult = deepMapInternal(child, mapFn, seen, containedIn); - mappedIterable[k] = childResult; - } - containedIn.delete(input); - return mappedIterable; - } - else { - throw new Error("Can't recurse into non-iterable type: " + input); - } -} -// TODO(soergel, kangyizhang) Reconsider naming of deepZip() to avoid confusion -// with zip() -/** - * Zip nested structures together in a recursive manner. - * - * This has the effect of transposing or pivoting data, e.g. converting it from - * a row-major representation to a column-major representation. - * - * For example, `deepZip([{a: 1, b: 2}, {a: 3, b: 4}])` returns - * `{a: [1, 3], b: [2, 4]}`. - * - * The inputs should all have the same nested structure (i.e., of arrays and - * dicts). The result is a single object with the same nested structure, where - * the leaves are arrays collecting the values of the inputs at that location - * (or, optionally, the result of a custom function applied to those arrays). - * - * @param inputs: An array of the objects to zip together. - * @param zipFn: (optional) A function that expects an array of elements at a - * single node of the object tree, and returns a `DeepMapResult`. The - * `DeepMapResult` either provides a result value for that node (i.e., - * representing the subtree), or indicates that the node should be processed - * recursively. The default zipFn recurses as far as possible and places - * arrays at the leaves. - */ -function deepZip(inputs, zipFn) { - if (zipFn === void 0) { zipFn = zipToList; } - return deepZipInternal(inputs, zipFn); -} -/** - * @param containedIn: An set containing objects on the reference path currently - * being processed (used to detect cycles). - */ -function deepZipInternal(inputs, zipFn, containedIn) { - if (containedIn === void 0) { containedIn = new Set(); } - // The recursion follows the structure of input 0; it's assumed that all the - // other inputs have the same structure. - var input = inputs[0]; - if (containedIn.has(input)) { - throw new Error('Circular references are not supported.'); - } - var result = zipFn(inputs); - if (result.recurse && result.value !== null) { - throw new Error('A deep zip function may not return both a value and recurse=true.'); - } - if (!result.recurse) { - return result.value; - } - else if (isIterable(input)) { - // tslint:disable-next-line:no-any - var mappedIterable = Array.isArray(input) ? [] : {}; - containedIn.add(input); - var _loop_1 = function (k) { - var children = inputs.map(function (x) { return x[k]; }); - var childResult = deepZipInternal(children, zipFn, containedIn); - mappedIterable[k] = childResult; - }; - for (var k in input) { - _loop_1(k); - } - containedIn.delete(input); - return mappedIterable; - } - else { - throw new Error("Can't recurse into non-iterable type: " + input); - } -} -// tslint:disable-next-line:no-any -function zipToList(x) { - if (x === null) { - return null; - } - // TODO(soergel): validate array type? - if (isIterable(x[0])) { - return { value: null, recurse: true }; - } - else { - return { value: x, recurse: false }; - } -} -/** - * Apply an async mapping function to a nested structure in a recursive manner. - * - * This first creates a nested structure of Promises, and then awaits all of - * those, resulting in a single Promise for a resolved nested structure. - * - * The result of the mapping is an object with the same nested structure (i.e., - * of arrays and dicts) as the input, except that some subtrees are replaced, - * according to the results of the mapping function. - * - * Mappings are memoized. Thus, if the nested structure contains the same - * object in multiple positions, the output will contain the same mapped object - * in those positions. Cycles are not supported, however. - * - * @param input: The object to which to apply the mapping function. - * @param mapFn: A function that expects a single node of the object tree, and - * returns a `DeepMapAsyncResult`. The `DeepMapAsyncResult` either provides - * a `Promise` for a replacement value for that node (i.e., replacing the - * subtree), or indicates that the node should be processed recursively. Note - * that the decision whether or not to recurse must be made immediately; only - * the mapped value may be promised. - */ -function deepMapAndAwaitAll(input, mapFn) { - return __awaiter(this, void 0, void 0, function () { - var seen, _i, _a, key, value, mappedValue, result; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - seen = new Map(); - // First do a normal deepMap, collecting Promises in 'seen' as a side effect. - deepMapInternal(input, mapFn, seen); - _i = 0, _a = Array.from(seen.keys()); - _b.label = 1; - case 1: - if (!(_i < _a.length)) return [3 /*break*/, 4]; - key = _a[_i]; - value = seen.get(key); - if (!tf.util.isPromise(value)) return [3 /*break*/, 3]; - return [4 /*yield*/, value]; - case 2: - mappedValue = _b.sent(); - seen.set(key, mappedValue); - _b.label = 3; - case 3: - _i++; - return [3 /*break*/, 1]; - case 4: - result = deepMapInternal(input, mapFn, seen); - return [2 /*return*/, result]; - } - }); - }); -} -/** - * Determine whether the argument is iterable. - * - * @returns true if the argument is an array or any non-Tensor object. - */ -// tslint:disable-next-line:no-any -function isIterable(obj) { - return obj != null && (!ArrayBuffer.isView(obj)) && - (Array.isArray(obj) || - (typeof obj === 'object' && !(obj instanceof tf.Tensor))); -} -/** - * Determine whether the argument can be converted to Tensor. - * - * Tensors, primitives, arrays, and TypedArrays all qualify; anything else does - * not. - * - * @returns true if the argument can be converted to Tensor. - */ -// tslint:disable-next-line:no-any -function canTensorify(obj) { - return obj == null || isPrimitive(obj) || Array.isArray(obj) || - (typeof obj === 'object' && (obj instanceof tf.Tensor)) || - tf.util.isTypedArray(obj); -} -/** - * Returns true if the given `value` is a primitive type. Otherwise returns - * false. This is equivalant to node util.isPrimitive - */ -function isPrimitive(value) { - return (value === null || - (typeof value !== 'object' && typeof value !== 'function')); -} - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -function deepClone(container) { - return deepMap(container, cloneIfTensor); -} -// tslint:disable-next-line: no-any -function cloneIfTensor(item) { - if (item instanceof tf.Tensor) { - return ({ value: item.clone(), recurse: false }); - } - else if (isIterable(item)) { - return { value: null, recurse: true }; - } - else { - return { value: item, recurse: false }; - } -} - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/** - * A ring buffer, providing O(1) FIFO, LIFO, and related operations. - */ -var RingBuffer = /** @class */ (function () { - /** - * Constructs a `RingBuffer`. - * @param capacity The number of items that the buffer can accomodate. - */ - function RingBuffer(capacity) { - this.capacity = capacity; - // Note we store the indices in the range 0 <= index < 2*capacity. - // This allows us to distinguish the full from the empty case. - // See https://www.snellman.net/blog/archive/2016-12-13-ring-buffers/ - this.begin = 0; // inclusive - this.end = 0; // exclusive - if (capacity == null) { - throw new RangeError('Can\'t create a ring buffer of unknown capacity.'); - } - if (capacity < 1) { - throw new RangeError('Can\'t create ring buffer of capacity < 1.'); - } - this.data = new Array(capacity); - this.doubledCapacity = 2 * capacity; - } - /** - * Map any index into the range 0 <= index < 2*capacity. - */ - RingBuffer.prototype.wrap = function (index) { - // don't trust % on negative numbers - while (index < 0) { - index += this.doubledCapacity; - } - return index % this.doubledCapacity; - }; - RingBuffer.prototype.get = function (index) { - if (index < 0) { - throw new RangeError('Can\'t get item at a negative index.'); - } - return this.data[index % this.capacity]; - }; - RingBuffer.prototype.set = function (index, value) { - if (index < 0) { - throw new RangeError('Can\'t set item at a negative index.'); - } - this.data[index % this.capacity] = value; - }; - /** - * Returns the current number of items in the buffer. - */ - RingBuffer.prototype.length = function () { - var length = this.end - this.begin; - if (length < 0) { - length = this.doubledCapacity + length; - } - return length; - }; - /** - * Reports whether the buffer is full. - * @returns true if the number of items in the buffer equals its capacity, and - * false otherwise. - */ - RingBuffer.prototype.isFull = function () { - return this.length() === this.capacity; - }; - /** - * Reports whether the buffer is empty. - * @returns true if the number of items in the buffer equals zero, and - * false otherwise. - */ - RingBuffer.prototype.isEmpty = function () { - return this.length() === 0; - }; - /** - * Adds an item to the end of the buffer. - */ - RingBuffer.prototype.push = function (value) { - if (this.isFull()) { - throw new RangeError('Ring buffer is full.'); - } - this.set(this.end, value); - this.end = this.wrap(this.end + 1); - }; - /** - * Adds many items to the end of the buffer, in order. - */ - RingBuffer.prototype.pushAll = function (values) { - for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { - var value = values_1[_i]; - this.push(value); - } - }; - /** - * Removes and returns the last item in the buffer. - */ - RingBuffer.prototype.pop = function () { - if (this.isEmpty()) { - throw new RangeError('Ring buffer is empty.'); - } - this.end = this.wrap(this.end - 1); - var result = this.get(this.end); - this.set(this.end, undefined); - return result; - }; - /** - * Adds an item to the beginning of the buffer. - */ - RingBuffer.prototype.unshift = function (value) { - if (this.isFull()) { - throw new RangeError('Ring buffer is full.'); - } - this.begin = this.wrap(this.begin - 1); - this.set(this.begin, value); - }; - /** - * Removes and returns the first item in the buffer. - */ - RingBuffer.prototype.shift = function () { - if (this.isEmpty()) { - throw new RangeError('Ring buffer is empty.'); - } - var result = this.get(this.begin); - this.set(this.begin, undefined); - this.begin = this.wrap(this.begin + 1); - return result; - }; - /** - * Removes and returns a specific item in the buffer, and moves the last item - * to the vacated slot. This is useful for implementing a shuffling stream. - * Note that this operation necessarily scrambles the original order. - * - * @param relativeIndex: the index of the item to remove, relative to the - * first item in the buffer (e.g., hiding the ring nature of the underlying - * storage). - */ - RingBuffer.prototype.shuffleExcise = function (relativeIndex) { - if (this.isEmpty()) { - throw new RangeError('Ring buffer is empty.'); - } - var index = this.wrap(this.begin + relativeIndex); - var result = this.get(index); - this.set(index, this.pop()); - return result; - }; - return RingBuffer; -}()); - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -var GrowingRingBuffer = /** @class */ (function (_super) { - __extends(GrowingRingBuffer, _super); - /** - * Constructs a `GrowingRingBuffer`. - */ - function GrowingRingBuffer() { - return _super.call(this, GrowingRingBuffer.INITIAL_CAPACITY) || this; - } - GrowingRingBuffer.prototype.isFull = function () { - return false; - }; - GrowingRingBuffer.prototype.push = function (value) { - if (_super.prototype.isFull.call(this)) { - this.expand(); - } - _super.prototype.push.call(this, value); - }; - GrowingRingBuffer.prototype.unshift = function (value) { - if (_super.prototype.isFull.call(this)) { - this.expand(); - } - _super.prototype.unshift.call(this, value); - }; - /** - * Doubles the capacity of the buffer. - */ - GrowingRingBuffer.prototype.expand = function () { - var newCapacity = this.capacity * 2; - var newData = new Array(newCapacity); - var len = this.length(); - // Rotate the buffer to start at index 0 again, since we can't just - // allocate more space at the end. - for (var i = 0; i < len; i++) { - newData[i] = this.get(this.wrap(this.begin + i)); - } - this.data = newData; - this.capacity = newCapacity; - this.doubledCapacity = 2 * this.capacity; - this.begin = 0; - this.end = len; - }; - GrowingRingBuffer.INITIAL_CAPACITY = 32; - return GrowingRingBuffer; -}(RingBuffer)); - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -// Here we implement a simple asynchronous iterator. -// This lets us avoid using either third-party stream libraries or -// recent TypeScript language support requiring polyfills. -/** - * Create a `LazyIterator` from an array of items. - */ -function iteratorFromItems(items) { - return new ArrayIterator(items); -} -/** - * Create a `LazyIterator` from a function. - * - * ```js - * let i = -1; - * const func = () => - * ++i < 5 ? {value: i, done: false} : {value: null, done: true}; - * const iter = tf.data.iteratorFromFunction(func); - * await iter.forEachAsync(e => console.log(e)); - * ``` - * - * @param func A function that produces data on each call. - */ -function iteratorFromFunction(func) { - return new FunctionCallIterator(func); -} -/** - * Create a `LazyIterator` by concatenating underlying streams, which are - * themselves provided as a stream. - * - * This can also be thought of as a "stream flatten" operation. - * - * @param baseIterators A stream of streams to be concatenated. - * @param baseErrorHandler An optional function that can intercept `Error`s - * raised during a `next()` call on the base stream. This function can decide - * whether the error should be propagated, whether the error should be - * ignored, or whether the base stream should be terminated. - */ -function iteratorFromConcatenated(baseIterators, baseErrorHandler) { - return new ChainedIterator(baseIterators, baseErrorHandler); -} -/** - * Create a `LazyIterator` by zipping together an array, dict, or nested - * structure of `LazyIterator`s (and perhaps additional constants). - * - * The underlying streams must provide elements in a consistent order such - * that they correspond. - * - * Typically, the underlying streams should have the same number of - * elements. If they do not, the behavior is determined by the - * `mismatchMode` argument. - * - * The nested structure of the `iterators` argument determines the - * structure of elements in the resulting iterator. - * - * @param iterators: An array or object containing LazyIterators at the - * leaves. - * @param mismatchMode: Determines what to do when one underlying iterator - * is exhausted before the others. `ZipMismatchMode.FAIL` (the default) - * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST` - * causes the zipped iterator to terminate with the furst underlying - * streams, so elements remaining on the longer streams are ignored. - * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling - * in nulls for the exhausted streams, until all streams are exhausted. - */ -function iteratorFromZipped(iterators, mismatchMode) { - if (mismatchMode === void 0) { mismatchMode = ZipMismatchMode.FAIL; } - return new ZipIterator(iterators, mismatchMode); -} -/** - * An asynchronous iterator, providing lazy access to a potentially - * unbounded stream of elements. - * - * Iterator can be obtained from a dataset: - * `const iter = await dataset.iterator();` - */ -var LazyIterator = /** @class */ (function () { - function LazyIterator() { - } - /** - * Collect all remaining elements of a bounded stream into an array. - * Obviously this will succeed only for small streams that fit in memory. - * Useful for testing. - * - * @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). - * - * @returns A Promise for an array of stream elements, which will resolve - * when the stream is exhausted. - */ - LazyIterator.prototype.toArrayForTest = function () { - return __awaiter(this, void 0, void 0, function () { - var stream, result, x; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - stream = this.prefetch(100); - result = []; - return [4 /*yield*/, stream.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*/, stream.next()]; - case 3: - x = _a.sent(); - return [3 /*break*/, 2]; - case 4: return [2 /*return*/, result]; - } - }); - }); - }; - /** - * Draw items from the stream until it is exhausted. - * - * This can be useful when the stream has side effects but no output. In - * that case, calling this function guarantees that the stream will be - * fully processed. - */ - LazyIterator.prototype.resolveFully = function () { - return __awaiter(this, void 0, void 0, function () { - var x; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.next()]; - case 1: - x = _a.sent(); - _a.label = 2; - case 2: - if (!!x.done) return [3 /*break*/, 4]; - return [4 /*yield*/, this.next()]; - case 3: - x = _a.sent(); - return [3 /*break*/, 2]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - /** - * Draw items from the stream until it is exhausted, or a predicate fails. - * - * This can be useful when the stream has side effects but no output. In - * that case, calling this function guarantees that the stream will be - * fully processed. - */ - LazyIterator.prototype.resolveWhile = function (predicate) { - return __awaiter(this, void 0, void 0, function () { - var x, shouldContinue; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.next()]; - case 1: - x = _a.sent(); - shouldContinue = predicate(x.value); - _a.label = 2; - case 2: - if (!((!x.done) && shouldContinue)) return [3 /*break*/, 4]; - return [4 /*yield*/, this.next()]; - case 3: - x = _a.sent(); - shouldContinue = predicate(x.value); - return [3 /*break*/, 2]; - case 4: return [2 /*return*/]; - } - }); - }); - }; - /** - * Handles errors thrown on this stream using a provided handler function. - * - * @param handler A function that handles any `Error` thrown during a `next()` - * call and returns true if the stream should continue (dropping the failed - * call) or false if the stream should quietly terminate. If the handler - * itself throws (or rethrows) an `Error`, that will be propagated. - * - * @returns A `LazyIterator` of elements passed through from upstream, - * possibly filtering or terminating on upstream `next()` calls that - * throw an `Error`. - */ - LazyIterator.prototype.handleErrors = function (handler) { - return new ErrorHandlingLazyIterator(this, handler); - }; - // TODO(soergel): Implement reduce() etc. - /** - * Filters this stream according to `predicate`. - * - * @param predicate A function mapping a stream element to a boolean or a - * `Promise` for one. - * - * @returns A `LazyIterator` of elements for which the predicate was true. - */ - LazyIterator.prototype.filter = function (predicate) { - return new FilterIterator(this, predicate); - }; - /** - * Maps this stream through a 1-to-1 transform. - * - * @param transform A function mapping a stream element to a transformed - * element. - * - * @returns A `LazyIterator` of transformed elements. - */ - LazyIterator.prototype.map = function (transform) { - return new MapIterator(this, transform); - }; - /** - * Maps this stream through an async 1-to-1 transform. - * - * @param transform A function mapping a stream element to a `Promise` for a - * transformed stream element. - * - * @returns A `LazyIterator` of transformed elements. - */ - LazyIterator.prototype.mapAsync = function (transform) { - return new AsyncMapIterator(this, transform); - }; - /** - * Maps this stream through a 1-to-1 transform, forcing serial execution. - * - * @param transform A function mapping a stream element to a transformed - * element. - * - * @returns A `LazyIterator` of transformed elements. - */ - LazyIterator.prototype.serialMapAsync = function (transform) { - return new AsyncMapIterator(this, transform).serial(); - }; - /** - * Maps this stream through a 1-to-many transform. - * - * @param transform A function mapping a stream element to an array of - * transformed elements. - * - * @returns A `DataStream` of transformed elements. - */ - LazyIterator.prototype.flatmap = function (transform) { - return new FlatmapIterator(this, transform); - }; - /** - * Apply a function to every element of the stream. - * - * @param f A function to apply to each stream element. - */ - LazyIterator.prototype.forEachAsync = function (f) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.map(f).resolveFully()]; - }); - }); - }; - /** - * Apply a function to every element of the stream, forcing serial execution. - * - * @param f A function to apply to each stream element. Should return 'true' - * to indicate that the stream should continue, or 'false' to cause it to - * terminate. - */ - LazyIterator.prototype.serialForEach = function (f) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.serialMapAsync(f).resolveWhile(function (x) { return (x === true); })]; - }); - }); - }; - /** - * Groups elements into batches, represented as arrays of elements. - * - * We can think of the elements of this iterator as 'rows' (even if they are - * nested structures). By the same token, consecutive values for a given - * key within the elements form a 'column'. This matches the usual sense of - * 'row' and 'column' when processing tabular data (e.g., parsing a CSV). - * - * Thus, "Row-major" means that the resulting batch is simply a collection of - * rows: `[row1, row2, row3, ...]`. This is contrast to the column-major - * form, which is needed for vectorized computation. - * - * @param batchSize The number of elements desired per batch. - * @param smallLastBatch Whether to emit the final batch when it has fewer - * than batchSize elements. Default true. - * @returns A `LazyIterator` of batches of elements, represented as arrays - * of the original element type. - */ - LazyIterator.prototype.rowMajorBatch = function (batchSize, smallLastBatch) { - if (smallLastBatch === void 0) { smallLastBatch = true; } - return new RowMajorBatchIterator(this, batchSize, smallLastBatch); - }; - /** - * Groups elements into batches, represented in column-major form. - * - * We can think of the elements of this iterator as 'rows' (even if they are - * nested structures). By the same token, consecutive values for a given - * key within the elements form a 'column'. This matches the usual sense of - * 'row' and 'column' when processing tabular data (e.g., parsing a CSV). - * - * Thus, "column-major" means that the resulting batch is a (potentially - * nested) structure representing the columns. Each column entry, then, - * contains a collection of the values found in that column for a range of - * input elements. This representation allows for vectorized computation, in - * contrast to the row-major form. - * - * The inputs should all have the same nested structure (i.e., of arrays and - * dicts). The result is a single object with the same nested structure, - * where the leaves are arrays collecting the values of the inputs at that - * location (or, optionally, the result of a custom function applied to those - * arrays). - * - * @param batchSize The number of elements desired per batch. - * @param smallLastBatch Whether to emit the final batch when it has fewer - * than batchSize elements. Default true. - * @param zipFn: (optional) A function that expects an array of elements at a - * single node of the object tree, and returns a `DeepMapResult`. The - * `DeepMapResult` either provides a result value for that node (i.e., - * representing the subtree), or indicates that the node should be processed - * recursively. The default zipFn recurses as far as possible and places - * arrays at the leaves. - * @returns A `LazyIterator` of batches of elements, represented as an object - * with collections at the leaves. - */ - LazyIterator.prototype.columnMajorBatch = function (batchSize, smallLastBatch, - // tslint:disable-next-line:no-any - zipFn) { - if (smallLastBatch === void 0) { smallLastBatch = true; } - if (zipFn === void 0) { zipFn = zipToList; } - // First collect the desired number of input elements as a row-major batch. - var rowBatches = this.rowMajorBatch(batchSize, smallLastBatch); - // Now 'rotate' or 'pivot' the data, collecting all values from each column - // in the batch (i.e., for each key within the elements) into an array. - return rowBatches.map(function (x) { return deepZip(x, zipFn); }); - }; - /** - * Concatenate this `LazyIterator` with another. - * - * @param iterator A `LazyIterator` to be concatenated onto this one. - * @param baseErrorHandler An optional function that can intercept `Error`s - * raised during a `next()` call on the base stream. This function can - * decide whether the error should be propagated, whether the error should - * be ignored, or whether the base stream should be terminated. - * @returns A `LazyIterator`. - */ - LazyIterator.prototype.concatenate = function (iterator, baseErrorHandler) { - return new ChainedIterator(iteratorFromItems([this, iterator]), baseErrorHandler); - }; - /** - * Limits this stream to return at most `count` items. - * - * @param count The maximum number of items to provide from the stream. If - * a negative or undefined value is given, the entire stream is returned - * unaltered. - */ - LazyIterator.prototype.take = function (count) { - if (count < 0 || count == null) { - return this; - } - return new TakeIterator(this, count); - }; - /** - * Skips the first `count` items in this stream. - * - * @param count The number of items to skip. If a negative or undefined - * value is given, the entire stream is returned unaltered. - */ - LazyIterator.prototype.skip = function (count) { - if (count < 0 || count == null) { - return this; - } - return new SkipIterator(this, count); - }; - /** - * Prefetch the first `bufferSize` items in this stream. - * - * Note this prefetches Promises, but makes no guarantees about when those - * Promises resolve. - * - * @param bufferSize: An integer specifying the number of elements to be - * prefetched. - */ - LazyIterator.prototype.prefetch = function (bufferSize) { - return new PrefetchIterator(this, bufferSize); - }; - // TODO(soergel): deep sharded shuffle, where supported - /** - * Randomly shuffles the elements of this stream. - * - * @param bufferSize: An integer specifying the number of elements from - * this stream from which the new stream will sample. - * @param seed: (Optional.) An integer specifying the random seed that - * will be used to create the distribution. - */ - LazyIterator.prototype.shuffle = function (windowSize, seed) { - return new ShuffleIterator(this, windowSize, seed); - }; - /** - * Force an iterator to execute serially: each next() call will await the - * prior one, so that they cannot execute concurrently. - */ - LazyIterator.prototype.serial = function () { - return new SerialIterator(this); - }; - return LazyIterator; -}()); -// ============================================================================ -// The following private classes serve to implement the chainable methods -// on LazyIterator. Unfortunately they can't be placed in separate files, -// due to resulting trouble with circular imports. -// ============================================================================ -// Iterators that just extend LazyIterator directly -// ============================================================================ -var ArrayIterator = /** @class */ (function (_super) { - __extends(ArrayIterator, _super); - function ArrayIterator(items) { - var _this = _super.call(this) || this; - _this.items = items; - _this.trav = 0; - return _this; - } - ArrayIterator.prototype.summary = function () { - return "Array of " + this.items.length + " items"; - }; - ArrayIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var item; - return __generator(this, function (_a) { - if (this.trav >= this.items.length) { - return [2 /*return*/, { value: null, done: true }]; - } - item = this.items[this.trav]; - this.trav++; - return [2 /*return*/, { value: deepClone(item), done: false }]; - }); - }); - }; - return ArrayIterator; -}(LazyIterator)); -var FunctionCallIterator = /** @class */ (function (_super) { - __extends(FunctionCallIterator, _super); - function FunctionCallIterator(nextFn) { - var _this = _super.call(this) || this; - _this.nextFn = nextFn; - return _this; - } - FunctionCallIterator.prototype.summary = function () { - return "Function call"; - }; - FunctionCallIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - try { - return [2 /*return*/, this.nextFn()]; - } - catch (e) { - // Modify the error message but leave the stack trace intact - e.message = - "Error thrown while iterating through a dataset: " + e.message; - throw e; - } - return [2 /*return*/]; - }); - }); - }; - return FunctionCallIterator; -}(LazyIterator)); -var SerialIterator = /** @class */ (function (_super) { - __extends(SerialIterator, _super); - function SerialIterator(upstream) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.lastRead = Promise.resolve({ value: null, done: false }); - return _this; - } - SerialIterator.prototype.summary = function () { - return this.upstream.summary() + " -> Serial"; - }; - SerialIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var _this = this; - return __generator(this, function (_a) { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(function () { return _this.serialNext(); }); - return [2 /*return*/, this.lastRead]; - }); - }); - }; - SerialIterator.prototype.serialNext = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.upstream.next()]; - }); - }); - }; - return SerialIterator; -}(LazyIterator)); -var SkipIterator = /** @class */ (function (_super) { - __extends(SkipIterator, _super); - function SkipIterator(upstream, maxCount) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.maxCount = maxCount; - // Local state that should not be clobbered by out-of-order execution. - _this.count = 0; - _this.lastRead = Promise.resolve({ value: null, done: false }); - return _this; - } - SkipIterator.prototype.summary = function () { - return this.upstream.summary() + " -> Skip"; - }; - SkipIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var _this = this; - return __generator(this, function (_a) { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(function () { return _this.serialNext(); }); - return [2 /*return*/, this.lastRead]; - }); - }); - }; - SkipIterator.prototype.serialNext = function () { - return __awaiter(this, void 0, void 0, function () { - var skipped; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(this.count++ < this.maxCount)) return [3 /*break*/, 2]; - return [4 /*yield*/, this.upstream.next()]; - case 1: - skipped = _a.sent(); - // short-circuit if upstream is already empty - if (skipped.done) { - return [2 /*return*/, skipped]; - } - tf.dispose(skipped.value); - return [3 /*break*/, 0]; - case 2: return [2 /*return*/, this.upstream.next()]; - } - }); - }); - }; - return SkipIterator; -}(LazyIterator)); -var TakeIterator = /** @class */ (function (_super) { - __extends(TakeIterator, _super); - function TakeIterator(upstream, maxCount) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.maxCount = maxCount; - _this.count = 0; - return _this; - } - TakeIterator.prototype.summary = function () { - return this.upstream.summary() + " -> Take"; - }; - TakeIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (this.count++ >= this.maxCount) { - return [2 /*return*/, { value: null, done: true }]; - } - return [2 /*return*/, this.upstream.next()]; - }); - }); - }; - return TakeIterator; -}(LazyIterator)); -// Note this batch just groups items into row-wise element arrays. -// Rotating these to a column-wise representation happens only at the dataset -// level. -var RowMajorBatchIterator = /** @class */ (function (_super) { - __extends(RowMajorBatchIterator, _super); - function RowMajorBatchIterator(upstream, batchSize, enableSmallLastBatch) { - if (enableSmallLastBatch === void 0) { enableSmallLastBatch = true; } - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.batchSize = batchSize; - _this.enableSmallLastBatch = enableSmallLastBatch; - _this.lastRead = Promise.resolve({ value: null, done: false }); - return _this; - } - RowMajorBatchIterator.prototype.summary = function () { - return this.upstream.summary() + " -> RowMajorBatch"; - }; - RowMajorBatchIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var _this = this; - return __generator(this, function (_a) { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(function () { return _this.serialNext(); }); - return [2 /*return*/, this.lastRead]; - }); - }); - }; - RowMajorBatchIterator.prototype.serialNext = function () { - return __awaiter(this, void 0, void 0, function () { - var batch, item; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - batch = []; - _a.label = 1; - case 1: - if (!(batch.length < this.batchSize)) return [3 /*break*/, 3]; - return [4 /*yield*/, this.upstream.next()]; - case 2: - item = _a.sent(); - if (item.done) { - if (this.enableSmallLastBatch && batch.length > 0) { - return [2 /*return*/, { value: batch, done: false }]; - } - return [2 /*return*/, { value: null, done: true }]; - } - batch.push(item.value); - return [3 /*break*/, 1]; - case 3: return [2 /*return*/, { value: batch, done: false }]; - } - }); - }); - }; - return RowMajorBatchIterator; -}(LazyIterator)); -var FilterIterator = /** @class */ (function (_super) { - __extends(FilterIterator, _super); - function FilterIterator(upstream, predicate) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.predicate = predicate; - _this.lastRead = Promise.resolve({ value: null, done: false }); - return _this; - } - FilterIterator.prototype.summary = function () { - return this.upstream.summary() + " -> Filter"; - }; - FilterIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var _this = this; - return __generator(this, function (_a) { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(function () { return _this.serialNext(); }); - return [2 /*return*/, this.lastRead]; - }); - }); - }; - FilterIterator.prototype.serialNext = function () { - return __awaiter(this, void 0, void 0, function () { - var item; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - return [4 /*yield*/, this.upstream.next()]; - case 1: - item = _a.sent(); - if (item.done || this.predicate(item.value)) { - return [2 /*return*/, item]; - } - tf.dispose(item.value); - return [3 /*break*/, 0]; - case 2: return [2 /*return*/]; - } - }); - }); - }; - return FilterIterator; -}(LazyIterator)); -var MapIterator = /** @class */ (function (_super) { - __extends(MapIterator, _super); - function MapIterator(upstream, transform) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.transform = transform; - return _this; - } - MapIterator.prototype.summary = function () { - return this.upstream.summary() + " -> Map"; - }; - MapIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var item, inputTensors, mapped, outputTensors, _i, inputTensors_1, t; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.upstream.next()]; - case 1: - item = _a.sent(); - if (item.done) { - return [2 /*return*/, { value: null, done: true }]; - } - inputTensors = tf.tensor_util.getTensorsInContainer(item.value); - mapped = this.transform(item.value); - outputTensors = tf.tensor_util.getTensorsInContainer(mapped); - // TODO(soergel) faster intersection - // TODO(soergel) move to tf.disposeExcept(in, out)? - for (_i = 0, inputTensors_1 = inputTensors; _i < inputTensors_1.length; _i++) { - t = inputTensors_1[_i]; - if (!tf.tensor_util.isTensorInList(t, outputTensors)) { - t.dispose(); - } - } - return [2 /*return*/, { value: mapped, done: false }]; - } - }); - }); - }; - return MapIterator; -}(LazyIterator)); -var ErrorHandlingLazyIterator = /** @class */ (function (_super) { - __extends(ErrorHandlingLazyIterator, _super); - function ErrorHandlingLazyIterator(upstream, handler) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.handler = handler; - _this.count = 0; - _this.lastRead = Promise.resolve({ value: null, done: false }); - return _this; - } - ErrorHandlingLazyIterator.prototype.summary = function () { - return this.upstream.summary() + " -> handleErrors"; - }; - ErrorHandlingLazyIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var _this = this; - return __generator(this, function (_a) { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(function () { return _this.serialNext(); }); - return [2 /*return*/, this.lastRead]; - }); - }); - }; - ErrorHandlingLazyIterator.prototype.serialNext = function () { - return __awaiter(this, void 0, void 0, function () { - var e_1; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - _a.label = 1; - case 1: - _a.trys.push([1, 3, , 4]); - return [4 /*yield*/, this.upstream.next()]; - case 2: return [2 /*return*/, _a.sent()]; - case 3: - e_1 = _a.sent(); - if (!this.handler(e_1)) { - return [2 /*return*/, { value: null, done: true }]; - } - return [3 /*break*/, 4]; - case 4: return [3 /*break*/, 0]; - case 5: return [2 /*return*/]; - } - }); - }); - }; - return ErrorHandlingLazyIterator; -}(LazyIterator)); -var AsyncMapIterator = /** @class */ (function (_super) { - __extends(AsyncMapIterator, _super); - function AsyncMapIterator(upstream, transform) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.transform = transform; - return _this; - } - AsyncMapIterator.prototype.summary = function () { - return this.upstream.summary() + " -> AsyncMap"; - }; - AsyncMapIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var item, inputTensors, mapped, outputTensors, _i, inputTensors_2, t; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.upstream.next()]; - case 1: - item = _a.sent(); - if (item.done) { - return [2 /*return*/, { value: null, done: true }]; - } - inputTensors = tf.tensor_util.getTensorsInContainer(item.value); - return [4 /*yield*/, this.transform(item.value)]; - case 2: - mapped = _a.sent(); - outputTensors = tf.tensor_util.getTensorsInContainer(mapped); - // TODO(soergel) faster intersection - // TODO(soergel) move to tf.disposeExcept(in, out)? - for (_i = 0, inputTensors_2 = inputTensors; _i < inputTensors_2.length; _i++) { - t = inputTensors_2[_i]; - if (!tf.tensor_util.isTensorInList(t, outputTensors)) { - t.dispose(); - } - } - return [2 /*return*/, { value: mapped, done: false }]; - } - }); - }); - }; - return AsyncMapIterator; -}(LazyIterator)); -// Iterators that maintain a queue of pending items -// ============================================================================ -/** - * A base class for transforming streams that operate by maintaining an - * output queue of elements that are ready to return via next(). This is - * commonly required when the transformation is 1-to-many: A call to next() - * may trigger a call to the underlying stream, which will produce many - * mapped elements of this stream-- of which we need to return only one, so - * we have to queue the rest. - */ -var OneToManyIterator = /** @class */ (function (_super) { - __extends(OneToManyIterator, _super); - function OneToManyIterator() { - var _this = _super.call(this) || this; - _this.outputQueue = new GrowingRingBuffer(); - _this.lastRead = Promise.resolve({ value: null, done: false }); - return _this; - } - OneToManyIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var _this = this; - return __generator(this, function (_a) { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(function () { return _this.serialNext(); }); - return [2 /*return*/, this.lastRead]; - }); - }); - }; - OneToManyIterator.prototype.serialNext = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!(this.outputQueue.length() === 0)) return [3 /*break*/, 2]; - return [4 /*yield*/, this.pump()]; - case 1: - // TODO(soergel): consider parallel reads. - if (!(_a.sent())) { - return [2 /*return*/, { value: null, done: true }]; - } - return [3 /*break*/, 0]; - case 2: return [2 /*return*/, { value: this.outputQueue.shift(), done: false }]; - } - }); - }); - }; - return OneToManyIterator; -}(LazyIterator)); -var FlatmapIterator = /** @class */ (function (_super) { - __extends(FlatmapIterator, _super); - function FlatmapIterator(upstream, transform) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.transform = transform; - return _this; - } - FlatmapIterator.prototype.summary = function () { - return this.upstream.summary() + " -> Flatmap"; - }; - FlatmapIterator.prototype.pump = function () { - return __awaiter(this, void 0, void 0, function () { - var item, inputTensors, mappedArray, outputTensors, _i, inputTensors_3, t; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.upstream.next()]; - case 1: - item = _a.sent(); - if (item.done) { - return [2 /*return*/, false]; - } - inputTensors = tf.tensor_util.getTensorsInContainer(item.value); - mappedArray = this.transform(item.value); - outputTensors = tf.tensor_util.getTensorsInContainer(mappedArray); - this.outputQueue.pushAll(mappedArray); - // TODO(soergel) faster intersection, and deduplicate outputTensors - // TODO(soergel) move to tf.disposeExcept(in, out)? - for (_i = 0, inputTensors_3 = inputTensors; _i < inputTensors_3.length; _i++) { - t = inputTensors_3[_i]; - if (!tf.tensor_util.isTensorInList(t, outputTensors)) { - t.dispose(); - } - } - return [2 /*return*/, true]; - } - }); - }); - }; - return FlatmapIterator; -}(OneToManyIterator)); -/** - * Provides a `LazyIterator` that concatenates a stream of underlying - * streams. - * - * Doing this in a concurrency-safe way requires some trickery. In - * particular, we want this stream to return the elements from the - * underlying streams in the correct order according to when next() was - * called, even if the resulting Promises resolve in a different order. - */ -var ChainedIterator = /** @class */ (function (_super) { - __extends(ChainedIterator, _super); - function ChainedIterator(iterators, baseErrorHandler) { - var _this = _super.call(this) || this; - _this.baseErrorHandler = baseErrorHandler; - // Strict Promise execution order: - // a next() call may not even begin until the previous one completes. - _this.lastRead = null; - // Local state that should not be clobbered by out-of-order execution. - _this.iterator = null; - _this.moreIterators = iterators; - return _this; - } - ChainedIterator.prototype.summary = function () { - var upstreamSummaries = 'TODO: fill in upstream of chained summaries'; - return upstreamSummaries + " -> Chained"; - }; - ChainedIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - this.lastRead = this.readFromChain(this.lastRead); - return [2 /*return*/, this.lastRead]; - }); - }); - }; - ChainedIterator.prototype.readFromChain = function (lastRead) { - return __awaiter(this, void 0, void 0, function () { - var iteratorResult, itemResult; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - // Must await on the previous read since the previous read may have advanced - // the stream of streams, from which we need to read. - // This is unfortunate since we can't parallelize reads. Which means - // prefetching of chained streams is a no-op. - // One solution is to prefetch immediately upstream of this. - return [4 /*yield*/, lastRead]; - case 1: - // Must await on the previous read since the previous read may have advanced - // the stream of streams, from which we need to read. - // This is unfortunate since we can't parallelize reads. Which means - // prefetching of chained streams is a no-op. - // One solution is to prefetch immediately upstream of this. - _a.sent(); - if (!(this.iterator == null)) return [3 /*break*/, 3]; - return [4 /*yield*/, this.moreIterators.next()]; - case 2: - iteratorResult = _a.sent(); - if (iteratorResult.done) { - // No more streams to stream from. - return [2 /*return*/, { value: null, done: true }]; - } - this.iterator = iteratorResult.value; - if (this.baseErrorHandler != null) { - this.iterator = this.iterator.handleErrors(this.baseErrorHandler); - } - _a.label = 3; - case 3: return [4 /*yield*/, this.iterator.next()]; - case 4: - itemResult = _a.sent(); - if (itemResult.done) { - this.iterator = null; - return [2 /*return*/, this.readFromChain(lastRead)]; - } - return [2 /*return*/, itemResult]; - } - }); - }); - }; - return ChainedIterator; -}(LazyIterator)); -var ZipMismatchMode; -(function (ZipMismatchMode) { - ZipMismatchMode[ZipMismatchMode["FAIL"] = 0] = "FAIL"; - ZipMismatchMode[ZipMismatchMode["SHORTEST"] = 1] = "SHORTEST"; - ZipMismatchMode[ZipMismatchMode["LONGEST"] = 2] = "LONGEST"; // use nulls for exhausted streams; use up the longest stream. -})(ZipMismatchMode || (ZipMismatchMode = {})); -/** - * Provides a `LazyIterator` that zips together an array, dict, or nested - * structure of `LazyIterator`s (and perhaps additional constants). - * - * The underlying streams must provide elements in a consistent order such - * that they correspond. - * - * Typically, the underlying streams should have the same number of - * elements. If they do not, the behavior is determined by the - * `mismatchMode` argument. - * - * The nested structure of the `iterators` argument determines the - * structure of elements in the resulting iterator. - * - * Doing this in a concurrency-safe way requires some trickery. In - * particular, we want this stream to return the elements from the - * underlying streams in the correct order according to when next() was - * called, even if the resulting Promises resolve in a different order. - * - * @param iterators: An array or object containing LazyIterators at the - * leaves. - * @param mismatchMode: Determines what to do when one underlying iterator - * is exhausted before the others. `ZipMismatchMode.FAIL` (the default) - * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST` - * causes the zipped iterator to terminate with the furst underlying - * streams, so elements remaining on the longer streams are ignored. - * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling - * in nulls for the exhausted streams, until all streams are exhausted. - */ -var ZipIterator = /** @class */ (function (_super) { - __extends(ZipIterator, _super); - function ZipIterator(iterators, mismatchMode) { - if (mismatchMode === void 0) { mismatchMode = ZipMismatchMode.FAIL; } - var _this = _super.call(this) || this; - _this.iterators = iterators; - _this.mismatchMode = mismatchMode; - _this.count = 0; - _this.currentPromise = null; - return _this; - } - ZipIterator.prototype.summary = function () { - var upstreamSummaries = 'TODO: fill in upstream of zip summaries'; - return "{" + upstreamSummaries + "} -> Zip"; - }; - ZipIterator.prototype.nextState = function (afterState) { - return __awaiter(this, void 0, void 0, function () { - function getNext(container) { - if (container instanceof LazyIterator) { - var result = container.next(); - return { - value: result.then(function (x) { - numIterators++; - if (x.done) { - iteratorsDone++; - } - return x.value; - }), - recurse: false - }; - } - else { - return { value: null, recurse: true }; - } - } - var numIterators, iteratorsDone, mapped; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - // This chaining ensures that the underlying next() are not even called - // before the previous ones have resolved. - return [4 /*yield*/, afterState]; - case 1: - // This chaining ensures that the underlying next() are not even called - // before the previous ones have resolved. - _a.sent(); - numIterators = 0; - iteratorsDone = 0; - return [4 /*yield*/, deepMapAndAwaitAll(this.iterators, getNext)]; - case 2: - mapped = _a.sent(); - if (numIterators === iteratorsDone) { - // The streams have all ended. - return [2 /*return*/, { value: null, done: true }]; - } - if (iteratorsDone > 0) { - switch (this.mismatchMode) { - case ZipMismatchMode.FAIL: - throw new Error('Zipped streams should have the same length. ' + - ("Mismatched at element " + this.count + ".")); - case ZipMismatchMode.SHORTEST: - return [2 /*return*/, { value: null, done: true }]; - case ZipMismatchMode.LONGEST: - // Continue. The exhausted streams already produced value: null. - } - } - this.count++; - return [2 /*return*/, { value: mapped, done: false }]; - } - }); - }); - }; - ZipIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - this.currentPromise = this.nextState(this.currentPromise); - return [2 /*return*/, this.currentPromise]; - }); - }); - }; - return ZipIterator; -}(LazyIterator)); -// Iterators that maintain a ring buffer of pending promises -// ============================================================================ -/** - * A stream that prefetches a given number of items from an upstream source, - * returning them in FIFO order. - * - * Note this prefetches Promises, but makes no guarantees about when those - * Promises resolve. - */ -var PrefetchIterator = /** @class */ (function (_super) { - __extends(PrefetchIterator, _super); - function PrefetchIterator(upstream, bufferSize) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.bufferSize = bufferSize; - _this.buffer = new RingBuffer(bufferSize); - return _this; - } - PrefetchIterator.prototype.summary = function () { - return this.upstream.summary() + " -> Prefetch"; - }; - /** - * Refill the prefetch buffer. Returns only after the buffer is full, or - * the upstream source is exhausted. - */ - PrefetchIterator.prototype.refill = function () { - while (!this.buffer.isFull()) { - var v = this.upstream.next(); - this.buffer.push(v); - } - }; - PrefetchIterator.prototype.next = function () { - this.refill(); - // This shift will never throw an error because the buffer is always - // full after a refill. If the stream is exhausted, the buffer will be - // full of Promises that will resolve to the end-of-stream signal. - return this.buffer.shift(); - }; - return PrefetchIterator; -}(LazyIterator)); -/** - * A stream that performs a sliding-window random shuffle on an upstream - * source. This is like a `PrefetchIterator` except that the items are - * returned in randomized order. Mixing naturally improves as the buffer - * size increases. - */ -var ShuffleIterator = /** @class */ (function (_super) { - __extends(ShuffleIterator, _super); - function ShuffleIterator(upstream, windowSize, seed) { - var _this = _super.call(this, upstream, windowSize) || this; - _this.upstream = upstream; - _this.windowSize = windowSize; - // Local state that should not be clobbered by out-of-order execution. - _this.upstreamExhausted = false; - _this.random = seedrandom_1(seed || tf.util.now().toString()); - _this.lastRead = Promise.resolve({ value: null, done: false }); - return _this; - } - ShuffleIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var _this = this; - return __generator(this, function (_a) { - // This sets this.lastRead to a new Promise right away, as opposed to - // saying `await this.lastRead; this.lastRead = this.serialNext();` which - // would not work because this.nextRead would be updated only after the - // promise resolves. - this.lastRead = this.lastRead.then(function () { return _this.serialNext(); }); - return [2 /*return*/, this.lastRead]; - }); - }); - }; - ShuffleIterator.prototype.randomInt = function (max) { - return Math.floor(this.random() * max); - }; - ShuffleIterator.prototype.chooseIndex = function () { - return this.randomInt(this.buffer.length()); - }; - ShuffleIterator.prototype.serialNext = function () { - return __awaiter(this, void 0, void 0, function () { - var chosenIndex, result; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - // TODO(soergel): consider performance - if (!this.upstreamExhausted) { - this.refill(); - } - _a.label = 1; - case 1: - if (!!this.buffer.isEmpty()) return [3 /*break*/, 3]; - chosenIndex = this.chooseIndex(); - return [4 /*yield*/, this.buffer.shuffleExcise(chosenIndex)]; - case 2: - result = _a.sent(); - if (result.done) { - this.upstreamExhausted = true; - } - else { - this.refill(); - return [2 /*return*/, result]; - } - return [3 /*break*/, 1]; - case 3: return [2 /*return*/, { value: null, done: true }]; - } - }); - }); - }; - return ShuffleIterator; -}(PrefetchIterator)); - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -// TODO(soergel): consider vectorized operations within the pipeline. -/** - * Represents a potentially large list of independent data elements (typically - * 'samples' or 'examples'). - * - * A 'data example' may be a primitive, an array, a map from string keys to - * values, or any nested structure of these. - * - * A `Dataset` represents an ordered collection of elements, together with a - * chain of transformations to be performed on those elements. Each - * transformation is a method of `Dataset` that returns another `Dataset`, so - * these may be chained, e.g. - * `const processedDataset = rawDataset.filter(...).map(...).batch(...)`. - * - * Data loading and transformation is done in a lazy, streaming fashion. The - * dataset may be iterated over multiple times; each iteration starts the data - * loading anew and recapitulates the transformations. - * - * A `Dataset` is typically processed as a stream of unbatched examples --i.e., - * its transformations are applied one example at a time. Batching produces a - * new `Dataset` where each element is a batch. Batching should usually come - * last in a pipeline, because data transformations are easier to express on a - * per-example basis than on a per-batch basis. - * - * The following code examples are calling `await dataset.forEachAsync(...)` to - * iterate once over the entire dataset in order to print out the data. - * - * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'} - */ -var Dataset = /** @class */ (function () { - function Dataset() { - this.size = null; - } - // TODO(soergel): Make Datasets report whether repeated iterator() calls - // produce the same result (e.g., reading from a file) or different results - // (e.g., from the webcam). Currently we don't make this distinction but it - // could be important for the user to know. - // abstract isDeterministic(): boolean; - /** - * Groups elements into batches. - * - * It is assumed that each of the incoming dataset elements has the same - * structure-- i.e. the same set of keys at each location in an object - * hierarchy. For each key, the resulting `Dataset` provides a batched - * element collecting all of the incoming values for that key. - * - * * Incoming primitives are grouped into a 1-D Tensor. - * * Incoming Tensors are grouped into a new Tensor where the 0'th axis is - * the batch dimension. - * * Incoming arrays are converted to Tensor and then batched. - * * A nested array is interpreted as an n-D Tensor, so the batched result - * has n+1 dimensions. - * * An array that cannot be converted to Tensor produces an error. - * - * If an array should not be batched as a unit, it should first be converted - * to an object with integer keys. - * - * Here are a few examples: - * - * Batch a dataset of numbers: - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8]).batch(4); - * await a.forEachAsync(e => e.print()); - * ``` - * - * Batch a dataset of arrays: - * ```js - * const b = tf.data.array([[1], [2], [3], [4], [5], [6], [7], [8]]).batch(4); - * await b.forEachAsync(e => e.print()); - * ``` - * - * Batch a dataset of objects: - * ```js - * const c = tf.data.array([{a: 1, b: 11}, {a: 2, b: 12}, {a: 3, b: 13}, - * {a: 4, b: 14}, {a: 5, b: 15}, {a: 6, b: 16}, {a: 7, b: 17}, - * {a: 8, b: 18}]).batch(4); - * await c.forEachAsync(e => { - * console.log('{'); - * for(var key in e) { - * console.log(key+':'); - * e[key].print(); - * } - * console.log('}'); - * }) - * ``` - * - * @param batchSize The number of elements desired per batch. - * @param smallLastBatch Whether to emit the final batch when it has fewer - * than batchSize elements. Default true. - * @returns A `Dataset`, from which a stream of batches can be obtained. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.batch = function (batchSize, smallLastBatch) { - var _this = this; - if (smallLastBatch === void 0) { smallLastBatch = true; } - var base = this; - tf.util.assert(batchSize > 0, function () { return "batchSize needs to be positive, but it is\n " + batchSize; }); - var size; - if (this.size === Infinity || this.size == null) { - // If the size of this dataset is infinity or null, the new size keeps the - // same. - size = this.size; - } - else if (smallLastBatch) { - // If the size of this dataset is known and include small last batch, the - // new size is full batch count plus last batch. - size = Math.ceil(this.size / batchSize); - } - else { - // If the size of this dataset is known and not include small last batch, - // the new size is full batch count. - size = Math.floor(this.size / batchSize); - } - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, base.iterator()]; - case 1: return [2 /*return*/, (_a.sent()) - .columnMajorBatch(batchSize, smallLastBatch, deepBatchConcat)]; - } - }); - }); }, size); - }; - /** - * Concatenates this `Dataset` with another. - * - * ```js - * const a = tf.data.array([1, 2, 3]); - * const b = tf.data.array([4, 5, 6]); - * const c = a.concatenate(b); - * await c.forEachAsync(e => console.log(e)); - * ``` - * - * @param dataset A `Dataset` to be concatenated onto this one. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.concatenate = function (dataset) { - var _this = this; - var base = this; - var size; - if (this.size === Infinity || dataset.size === Infinity) { - // If the size of any of these two dataset is infinity, new size is - // infinity. - size = Infinity; - } - else if (this.size != null && dataset.size != null) { - // If the size of both datasets are known and not infinity, new size is - // sum the size of these two datasets. - size = this.size + dataset.size; - } - else { - // If neither of these two datasets has infinite size and any of these two - // datasets' size is null, the new size is null. - size = null; - } - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { var _a, _b; return __generator(this, function (_c) { - switch (_c.label) { - case 0: return [4 /*yield*/, base.iterator()]; - case 1: - _b = (_a = (_c.sent())).concatenate; - return [4 /*yield*/, dataset.iterator()]; - case 2: return [2 /*return*/, _b.apply(_a, [_c.sent()])]; - } - }); }); }, size); - }; - /** - * Filters this dataset according to `predicate`. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) - * .filter(x => x%2 === 0); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param predicate A function mapping a dataset element to a boolean or a - * `Promise` for one. - * - * @returns A `Dataset` of elements for which the predicate was true. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.filter = function (predicate) { - var _this = this; - var base = this; - var size; - if (this.size === Infinity) { - // If the size of this dataset is infinity, new size is infinity - size = Infinity; - } - else { - // If this dataset has limited elements, new size is null because it might - // exhausted randomly. - size = null; - } - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, base.iterator()]; - case 1: return [2 /*return*/, (_a.sent()).filter(function (x) { return tf.tidy(function () { return predicate(x); }); })]; - } - }); - }); }, size); - }; - /** - * Apply a function to every element of the dataset. - * - * After the function is applied to a dataset element, any Tensors contained - * within that element are disposed. - * - * ```js - * const a = tf.data.array([1, 2, 3]); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param f A function to apply to each dataset element. - * @returns A `Promise` that resolves after all elements have been processed. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.forEachAsync = function (f) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.iterator()]; - case 1: return [2 /*return*/, (_a.sent()).forEachAsync(f)]; - } - }); - }); - }; - /** - * Maps this dataset through a 1-to-1 transform. - * - * ```js - * const a = tf.data.array([1, 2, 3]).map(x => x*x); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param transform A function mapping a dataset element to a transformed - * dataset element. - * - * @returns A `Dataset` of transformed elements. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.map = function (transform) { - var _this = this; - var base = this; - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, base.iterator()]; - case 1: return [2 /*return*/, (_a.sent()).map(function (x) { return tf.tidy(function () { return transform(x); }); })]; - } - }); - }); }, this.size); - }; - /** - * Maps this dataset through an async 1-to-1 transform. - * - * ```js - * const a = - * tf.data.array([1, 2, 3]).mapAsync(x => new Promise(function(resolve){ - * setTimeout(() => { - * resolve(x * x); - * }, Math.random()*1000 + 500); - * })); - * console.log(await a.toArray()); - * ``` - * - * @param transform A function mapping a dataset element to a `Promise` for a - * transformed dataset element. This transform is responsible for disposing - * any intermediate `Tensor`s, i.e. by wrapping its computation in - * `tf.tidy()`; that cannot be automated here (as it is in the synchronous - * `map()` case). - * - * @returns A `Dataset` of transformed elements. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.mapAsync = function (transform) { - var _this = this; - var base = this; - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, base.iterator()]; - case 1: return [2 /*return*/, (_a.sent()).mapAsync(transform)]; - } - }); - }); }, this.size); - }; - /** - * Creates a `Dataset` that prefetches elements from this dataset. - * - * @param bufferSize: An integer specifying the number of elements to be - * prefetched. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.prefetch = function (bufferSize) { - var _this = this; - if (bufferSize == null) { - throw new RangeError('`Dataset.prefetch()` requires bufferSize to be specified.'); - } - var base = this; - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, base.iterator()]; - case 1: return [2 /*return*/, (_a.sent()).prefetch(bufferSize)]; - } - }); }); }, this.size); - }; - /** - * Repeats this dataset `count` times. - * - * NOTE: If this dataset is a function of global state (e.g. a random number - * generator), then different repetitions may produce different elements. - * - * ```js - * const a = tf.data.array([1, 2, 3]).repeat(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param count: (Optional) An integer, representing the number of times - * the dataset should be repeated. The default behavior (if `count` is - * `undefined` or negative) is for the dataset be repeated indefinitely. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.repeat = function (count) { - var _this = this; - var base = this; - var size; - if (this.size != null && count > 0) { - // If this dataset has size and count is positive, new size is current - // size multiply count. This also covers the case that current size is - // infinity. - size = this.size * count; - } - else if (count === 0) { - // If count is 0, new size is 0. - size = 0; - } - else if (this.size != null && (count === undefined || count < 0)) { - // If this dataset has size and count is undefined or negative, the - // dataset will be repeated indefinitely and new size is infinity. - size = Infinity; - } - else { - // If the size of this dataset is null, the new dataset's size is null. - size = null; - } - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { - var iteratorIterator; - var _this = this; - return __generator(this, function (_a) { - iteratorIterator = iteratorFromFunction(function () { return __awaiter(_this, void 0, void 0, function () { var _a; return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _a = {}; - return [4 /*yield*/, base.iterator()]; - case 1: return [2 /*return*/, (_a.value = _b.sent(), _a.done = false, _a)]; - } - }); }); }); - return [2 /*return*/, iteratorFromConcatenated(iteratorIterator.take(count))]; - }); - }); }, size); - }; - /** - * Creates a `Dataset` that skips `count` initial elements from this dataset. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]).skip(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param count: The number of elements of this dataset that should be skipped - * to form the new dataset. If `count` is greater than the size of this - * dataset, the new dataset will contain no elements. If `count` - * is `undefined` or negative, skips the entire dataset. - * - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.skip = function (count) { - var _this = this; - var base = this; - var size; - if (this.size != null && count >= 0 && this.size >= count) { - // If the size of this dataset is greater than count, the new dataset's - // size is current size minus skipped size.This also covers the case that - // current size is infinity. - size = this.size - count; - } - else if (this.size != null && - (this.size < count || count === undefined || count < 0)) { - // If the size of this dataset is smaller than count, or count is - // undefined or negative, skips the entire dataset and the new size is 0. - size = 0; - } - else { - // If the size of this dataset is null, the new dataset's size is null. - size = null; - } - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, base.iterator()]; - case 1: return [2 /*return*/, (_a.sent()).skip(count)]; - } - }); }); }, size); - }; - /** - * Pseudorandomly shuffles the elements of this dataset. This is done in a - * streaming manner, by sampling from a given number of prefetched elements. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]).shuffle(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param bufferSize: An integer specifying the number of elements from this - * dataset from which the new dataset will sample. - * @param seed: (Optional) An integer specifying the random seed that will - * be used to create the distribution. - * @param reshuffleEachIteration: (Optional) A boolean, which if true - * indicates that the dataset should be pseudorandomly reshuffled each time - * it is iterated over. If false, elements will be returned in the same - * shuffled order on each iteration. (Defaults to `true`.) - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.shuffle = function (bufferSize, seed, reshuffleEachIteration) { - var _this = this; - if (reshuffleEachIteration === void 0) { reshuffleEachIteration = true; } - if (bufferSize == null || bufferSize < 0) { - if (this.size == null) { - throw new RangeError('`Dataset.shuffle()` requires bufferSize to be specified.'); - } - else { - throw new RangeError('`Dataset.shuffle()` requires bufferSize to be specified. ' + - 'If your data fits in main memory (for regular JS objects), ' + - 'and/or GPU memory (for `tf.Tensor`s), consider setting ' + - ("bufferSize to the dataset size (" + this.size + " elements)")); - } - } - var base = this; - var random = seedrandom_1(seed || tf.util.now().toString()); - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { - var seed2; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - seed2 = random.int32(); - if (reshuffleEachIteration) { - seed2 += random.int32(); - } - return [4 /*yield*/, base.iterator()]; - case 1: return [2 /*return*/, (_a.sent()).shuffle(bufferSize, seed2.toString())]; - } - }); - }); }, this.size); - }; - /** - * Creates a `Dataset` with at most `count` initial elements from this - * dataset. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]).take(3); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * @param count: The number of elements of this dataset that should be taken - * to form the new dataset. If `count` is `undefined` or negative, or if - * `count` is greater than the size of this dataset, the new dataset will - * contain all elements of this dataset. - * @returns A `Dataset`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.take = function (count) { - var _this = this; - var base = this; - var size; - if (this.size != null && this.size > count) { - // If the size of this dataset is greater than count, the new dataset's - // size is count. - size = count; - } - else if (this.size != null && this.size <= count) { - // If the size of this dataset is equal or smaller than count, the new - // dataset's size is the size of this dataset. - size = this.size; - } - else { - // If the size of this dataset is null, the new dataset's size is null. - size = null; - } - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, base.iterator()]; - case 1: return [2 /*return*/, (_a.sent()).take(count)]; - } - }); }); }, size); - }; - /** - * Collect all elements of this dataset into an array. - * - * Obviously this will succeed only for small datasets that fit in memory. - * Useful for testing and generally should be avoided if possible. - * - * ```js - * const a = tf.data.array([1, 2, 3, 4, 5, 6]); - * console.log(await a.toArray()); - * ``` - * - * @returns A Promise for an array of elements, which will resolve - * when a new stream has been obtained and fully consumed. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - Dataset.prototype.toArray = 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()).toArray()]; - } - }); - }); - }; - /** - * 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 - Dataset.MAX_BUFFER_SIZE = 10000; - return Dataset; -}()); -/** - * Create a `Dataset` defined by a provided iterator() function. - * - * ```js - * let i = -1; - * const func = () => - * ++i < 5 ? {value: i, done: false} : {value: null, done: true}; - * const iter = tf.data.iteratorFromFunction(func); - * const ds = tf.data.datasetFromIteratorFn(iter); - * await ds.forEachAsync(e => console.log(e)); - * ``` - */ -function datasetFromIteratorFn(iteratorFn, size) { - if (size === void 0) { size = null; } - return new /** @class */ (function (_super) { - __extends(class_1, _super); - function class_1() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.size = size; - return _this; - } - /* - * Provide a new stream of elements. Note this will also start new streams - * from any underlying `Dataset`s. - */ - class_1.prototype.iterator = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, iteratorFn()]; - }); - }); - }; - return class_1; - }(Dataset))(); -} -/** - * Create a `Dataset` from an array of elements. - * - * Create a Dataset from an array of objects: - * ```js - * const a = tf.data.array([{'item': 1}, {'item': 2}, {'item': 3}]); - * await a.forEachAsync(e => console.log(e)); - * ``` - * - * Create a Dataset from an array of numbers: - * ```js - * const a = tf.data.array([4, 5, 6]); - * await a.forEachAsync(e => console.log(e)); - * ``` - * @param items An array of elements that will be parsed as items in a dataset. - * - * @doc {heading: 'Data', subheading: 'Creation', namespace: 'data'} - */ -function array(items) { - var _this = this; - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/, iteratorFromItems(items)]; - }); }); }, items.length); -} -/** - * Create a `Dataset` by zipping together an array, dict, or nested - * structure of `Dataset`s (and perhaps additional constants). - * The underlying datasets must provide elements in a consistent order such that - * they correspond. - * - * The number of elements in the resulting dataset is the same as the size of - * the smallest dataset in datasets. - * - * The nested structure of the `datasets` argument determines the - * structure of elements in the resulting iterator. - * - * Note this means that, given an array of two datasets that produce dict - * elements, the result is a dataset that produces elements that are arrays - * of two dicts: - * - * Zip an array of datasets: - * ```js - * console.log('Zip two datasets of objects:'); - * const ds1 = tf.data.array([{a: 1}, {a: 2}, {a: 3}]); - * const ds2 = tf.data.array([{b: 4}, {b: 5}, {b: 6}]); - * const ds3 = tf.data.zip([ds1, ds2]); - * await ds3.forEachAsync(e => console.log(JSON.stringify(e))); - * - * // If the goal is to merge the dicts in order to produce elements like - * // {a: ..., b: ...}, this requires a second step such as: - * console.log('Merge the objects:'); - * const ds4 = ds3.map(x => {return {a: x[0].a, b: x[1].b}}); - * await ds4.forEachAsync(e => console.log(e)); - * ``` - * - * Zip a dict of datasets: - * ```js - * const a = tf.data.array([{a: 1}, {a: 2}, {a: 3}]); - * const b = tf.data.array([{b: 4}, {b: 5}, {b: 6}]); - * const c = tf.data.zip({c: a, d: b}); - * await c.forEachAsync(e => console.log(JSON.stringify(e))); - * ``` - * - * @doc {heading: 'Data', subheading: 'Operations', namespace: 'data'} - */ -function zip(datasets) { - var _this = this; - // manually type-check the argument for JS users - if (!isIterable(datasets)) { - throw new Error('The argument to zip() must be an object or array.'); - } - var size; - if (Array.isArray(datasets)) { - for (var i = 0; i < datasets.length; i++) { - size = size == null ? datasets[i].size : - Math.min(size, datasets[i].size); - } - } - else if (datasets instanceof Object) { - for (var ds in datasets) { - size = size == null ? datasets[ds].size : - Math.min(size, datasets[ds].size); - } - } - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { - var streams; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, deepMapAndAwaitAll(datasets, function (d) { - if (d instanceof Dataset) { - return { value: d.iterator(), recurse: false }; - } - else if (isIterable(d)) { - return { value: null, recurse: true }; - } - else { - throw new Error('Leaves of the structure passed to zip() must be Datasets, ' + - 'not primitives.'); - } - })]; - case 1: - streams = _a.sent(); - return [2 /*return*/, iteratorFromZipped(streams, ZipMismatchMode.SHORTEST)]; - } - }); - }); }, size); -} -/** - * A zip function for use with deepZip, passed via the columnMajorBatch call. - * - * Accepts an array of identically-structured nested elements and either batches - * them (if they are primitives, numeric arrays, or Tensors) or requests - * recursion (if not). - */ -// tslint:disable-next-line:no-any -function deepBatchConcat(rows) { - if (rows === null) { - return null; - } - // use the first item to decide whether to recurse or batch here. - var exampleRow = rows[0]; - if (canTensorify(exampleRow)) { - // rows is an array of primitives, Tensors, or arrays. Batch them. - var value = batchConcat(rows); - return { value: value, recurse: false }; - } - // the example row is an object, so recurse into it. - return { value: null, recurse: true }; -} -/** - * Assembles a list of same-shaped numbers, number arrays, or Tensors - * into a single new Tensor where axis 0 is the batch dimension. - */ -function batchConcat(arrays) { - if (arrays.length === 0) { - // We can't return an empty Tensor because we don't know the element shape. - throw new Error('Can\'t make a batch of zero elements.'); - } - if (arrays[0] instanceof tf.Tensor) { - // Input is an array of Tensors - return tf.stack(arrays); - } - else { - // Input is a possibly-nested array of numbers. - return tf.tensor(arrays); - } -} - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/** - * Represents a potentially large collection of text lines. - * - * The results are not batched. - */ -var TextLineDataset = /** @class */ (function (_super) { - __extends(TextLineDataset, _super); - /** - * Create a `TextLineDataset`. - * - * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream. - */ - function TextLineDataset(input) { - var _this = _super.call(this) || this; - _this.input = input; - return _this; - } - TextLineDataset.prototype.iterator = function () { - return __awaiter(this, void 0, void 0, function () { - var inputIterator, utf8Iterator, lineIterator; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.input.iterator()]; - case 1: - inputIterator = _a.sent(); - utf8Iterator = inputIterator.decodeUTF8(); - lineIterator = utf8Iterator.split('\n').map(function (line) { - // Windows/DOS format text file has extra line breaker at the end of line. - if (line.endsWith('\r')) { - line = line.slice(0, -1); - } - return line; - }); - return [2 /*return*/, lineIterator]; - } - }); - }); - }; - return TextLineDataset; -}(Dataset)); - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -var CODE_QUOTE = '"'; -var STATE_OUT = Symbol('out'); -var STATE_FIELD = Symbol('field'); -var STATE_QUOTE = Symbol('quote'); -var STATE_QUOTE_AFTER_QUOTE = Symbol('quoteafterquote'); -var STATE_WITHIN_QUOTE_IN_QUOTE = Symbol('quoteinquote'); -/** - * Represents a potentially large collection of delimited text records. - * - * The produced `TensorContainer`s each contain one key-value pair for - * every column of the table. When a field is empty in the incoming data, the - * resulting value is `undefined`, or throw error if it is required. Values - * that can be parsed as numbers are emitted as type `number`, other values - * are parsed as `string`. - * - * The results are not batched. - * - * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'} - */ -var CSVDataset = /** @class */ (function (_super) { - __extends(CSVDataset, _super); - /** - * Create a `CSVDataset`. - * - * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream. - * @param csvConfig (Optional) A CSVConfig object that contains configurations - * of reading and decoding from CSV file(s). - * - * hasHeader: (Optional) A boolean value that indicates whether the first - * row of provided CSV file is a header line with column names, and should - * not be included in the data. Defaults to `true`. - * - * columnNames: (Optional) A list of strings that corresponds to - * the CSV column names, in order. If provided, it ignores the column - * names inferred from the header row. If not provided, infers the column - * names from the first row of the records. If hasHeader is false and - * columnNames is not provided, this method throws an error. - * - * columnConfigs: (Optional) A dictionary whose key is column names, value - * is an object stating if this column is required, column's data type, - * default value, and if this column is label. If provided, keys must - * correspond to names provided in columnNames or inferred from the file - * header lines. If isLabel is true any column, returns an array of two - * items: the first item is a dict of features key/value pairs, the second - * item is a dict of labels key/value pairs. If no feature is marked as - * label, returns a dict of features only. - * - * configuredColumnsOnly (Optional) If true, only columns provided in - * columnConfigs will be parsed and provided during iteration. - * - * delimiter (Optional) The string used to parse each line of the input - * file. Defaults to `,`. - */ - function CSVDataset(input, csvConfig) { - var _this = _super.call(this) || this; - _this.input = input; - _this.hasHeader = true; - _this.fullColumnNames = null; - _this.columnNamesValidated = false; - _this.columnConfigs = null; - _this.configuredColumnsOnly = false; - _this.delimiter = ','; - _this.delimWhitespace = false; - _this.base = new TextLineDataset(input); - if (!csvConfig) { - csvConfig = {}; - } - _this.hasHeader = csvConfig.hasHeader === false ? false : true; - _this.fullColumnNames = csvConfig.columnNames; - _this.columnConfigs = csvConfig.columnConfigs; - _this.configuredColumnsOnly = csvConfig.configuredColumnsOnly; - if (csvConfig.delimWhitespace) { - tf.util.assert(csvConfig.delimiter == null, function () { - return 'Delimiter should not be provided when delimWhitespace is true.'; - }); - _this.delimWhitespace = true; - _this.delimiter = ' '; - } - else { - _this.delimiter = csvConfig.delimiter ? csvConfig.delimiter : ','; - } - return _this; - } - /** - * Returns column names of the csv dataset. If `configuredColumnsOnly` is - * true, return column names in `columnConfigs`. If `configuredColumnsOnly` is - * false and `columnNames` is provided, `columnNames`. If - * `configuredColumnsOnly` is false and `columnNames` is not provided, return - * all column names parsed from the csv file. For example usage please go to - * `tf.data.csv`. - * - * @doc {heading: 'Data', subheading: 'Classes'} - */ - CSVDataset.prototype.columnNames = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!!this.columnNamesValidated) return [3 /*break*/, 2]; - return [4 /*yield*/, this.setColumnNames()]; - case 1: - _a.sent(); - _a.label = 2; - case 2: return [2 /*return*/, this.configuredColumnsOnly ? Object.keys(this.columnConfigs) : - this.fullColumnNames]; - } - }); - }); - }; - /* 1) If `columnNames` is provided as string[], use this string[] as output - * keys in corresponding order. The length must match the number of inferred - * columns if `hasHeader` is true . - * 2) If `columnNames` is not provided, parse header line as `columnNames` if - * hasHeader is true. If `hasHeader` is false, throw an error. - * 3) If `columnConfigs` is provided, all the keys in `columnConfigs` must - * exist in parsed `columnNames`. - */ - CSVDataset.prototype.setColumnNames = function () { - return __awaiter(this, void 0, void 0, function () { - var columnNamesFromFile, counts, duplicateNames, _i, _a, key, index; - var _this = this; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: return [4 /*yield*/, this.maybeReadHeaderLine()]; - case 1: - columnNamesFromFile = _b.sent(); - if (!this.fullColumnNames && !columnNamesFromFile) { - // Throw an error if columnNames is not provided and no header line. - throw new Error('Column names must be provided if there is no header line.'); - } - else if (this.fullColumnNames && columnNamesFromFile) { - // Check provided columnNames match header line. - tf.util.assert(columnNamesFromFile.length === this.fullColumnNames.length, function () { return 'The length of provided columnNames (' + - _this.fullColumnNames.length.toString() + - ') does not match the length of the header line read from ' + - 'file (' + columnNamesFromFile.length.toString() + ').'; }); - } - if (!this.fullColumnNames) { - this.fullColumnNames = columnNamesFromFile; - } - counts = this.fullColumnNames.reduce(function (countAcc, name) { - countAcc[name] = (countAcc[name] + 1) || 1; - return countAcc; - }, {}); - duplicateNames = Object.keys(counts).filter(function (name) { return (counts[name] > 1); }); - tf.util.assert(duplicateNames.length === 0, function () { return 'Duplicate column names found: ' + duplicateNames.toString(); }); - // Check if keys in columnConfigs match columnNames. - if (this.columnConfigs) { - for (_i = 0, _a = Object.keys(this.columnConfigs); _i < _a.length; _i++) { - key = _a[_i]; - index = this.fullColumnNames.indexOf(key); - if (index === -1) { - throw new Error('The key "' + key + - '" provided in columnConfigs does not match any of the column ' + - 'names (' + this.fullColumnNames.toString() + ').'); - } - } - } - this.columnNamesValidated = true; - return [2 /*return*/]; - } - }); - }); - }; - CSVDataset.prototype.maybeReadHeaderLine = function () { - return __awaiter(this, void 0, void 0, function () { - var iter, firstElement, firstLine, headers; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!this.hasHeader) return [3 /*break*/, 3]; - return [4 /*yield*/, this.base.iterator()]; - case 1: - iter = _a.sent(); - return [4 /*yield*/, iter.next()]; - case 2: - firstElement = _a.sent(); - if (firstElement.done) { - throw new Error('No data was found for CSV parsing.'); - } - firstLine = firstElement.value; - headers = this.parseRow(firstLine, false); - return [2 /*return*/, headers]; - case 3: return [2 /*return*/, null]; - } - }); - }); - }; - CSVDataset.prototype.iterator = function () { - return __awaiter(this, void 0, void 0, function () { - var lines; - var _this = this; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (!!this.columnNamesValidated) return [3 /*break*/, 2]; - return [4 /*yield*/, this.setColumnNames()]; - case 1: - _a.sent(); - _a.label = 2; - case 2: return [4 /*yield*/, this.base.iterator()]; - case 3: - lines = _a.sent(); - if (this.hasHeader) { - // We previously read the first line to get the columnNames. - // Now that we're providing data, skip it. - lines = lines.skip(1); - } - return [2 /*return*/, lines.map(function (x) { return _this.makeDataElement(x); })]; - } - }); - }); - }; - CSVDataset.prototype.makeDataElement = function (line) { - var values = this.parseRow(line); - var features = {}; - var labels = {}; - for (var i = 0; i < this.fullColumnNames.length; i++) { - var key = this.fullColumnNames[i]; - var config = this.columnConfigs ? this.columnConfigs[key] : null; - if (this.configuredColumnsOnly && !config) { - // This column is not selected. - continue; - } - else { - var value = values[i]; - var parsedValue = null; - if (value === '') { - // If default value is provided, use it. If default value is not - // provided, set as undefined. - if (config && config.default !== undefined) { - parsedValue = config.default; - } - else if (config && (config.required || config.isLabel)) { - throw new Error("Required column " + key + " is empty in this line: " + line); - } - else { - parsedValue = undefined; - } - } - else { - // A value is present, so parse it based on type - var valueAsNum = Number(value); - if (isNaN(valueAsNum)) { - // The value is a string and this column is declared as boolean - // in config, parse it as boolean. - if (config && config.dtype === 'bool') { - parsedValue = this.getBoolean(value); - } - else { - // Set value as string - parsedValue = value; - } - } - else if (!config || !config.dtype) { - // If this value is a number and no type config is provided, return - // it as number. - parsedValue = valueAsNum; - } - else { - // If this value is a number and data type is provided, parse it - // according to provided data type. - switch (config.dtype) { - case 'float32': - parsedValue = valueAsNum; - break; - case 'int32': - parsedValue = Math.floor(valueAsNum); - break; - case 'bool': - parsedValue = this.getBoolean(value); - break; - default: - parsedValue = valueAsNum; - } - } - } - // Check if this column is label. - (config && config.isLabel) ? labels[key] = parsedValue : - features[key] = parsedValue; - } - } - // If label exists, return an object of features and labels as {xs:features, - // ys:labels}, otherwise return features only. - if (Object.keys(labels).length === 0) { - return features; - } - else { - return { xs: features, ys: labels }; - } - }; - CSVDataset.prototype.getBoolean = function (value) { - if (value === '1' || value.toLowerCase() === 'true') { - return 1; - } - else { - return 0; - } - }; - // adapted from https://beta.observablehq.com/@mbostock/streaming-csv - CSVDataset.prototype.parseRow = function (line, validateElementCount) { - if (validateElementCount === void 0) { validateElementCount = true; } - var result = []; - var readOffset = 0; - var readLength = line.length; - var currentState = STATE_OUT; - // Goes through the line to parse quote. - for (var i = 0; i < readLength; i++) { - switch (currentState) { - // Before enter a new field - case STATE_OUT: - switch (line.charAt(i)) { - // Enter a quoted field - case CODE_QUOTE: - readOffset = i + 1; - currentState = STATE_QUOTE; - break; - // Read an empty field - case this.delimiter: - readOffset = i + 1; - // If delimiter is white space and configured to collapse - // multiple white spaces, ignore this white space. - if (this.delimiter === ' ' && this.delimWhitespace) { - break; - } - result.push(''); - currentState = STATE_OUT; - break; - // Enter an unquoted field - default: - currentState = STATE_FIELD; - readOffset = i; - break; - } - break; - // In an unquoted field - case STATE_FIELD: - switch (line.charAt(i)) { - // Exit an unquoted field, add it to result - case this.delimiter: - result.push(line.substring(readOffset, i)); - currentState = STATE_OUT; - readOffset = i + 1; - break; - } - break; - // In a quoted field - case STATE_QUOTE: - switch (line.charAt(i)) { - // Read a quote after a quote - case CODE_QUOTE: - currentState = STATE_QUOTE_AFTER_QUOTE; - break; - } - break; - // This state means it's right after a second quote in a field - case STATE_QUOTE_AFTER_QUOTE: - switch (line.charAt(i)) { - // Finished a quoted field - case this.delimiter: - result.push(line.substring(readOffset, i - 1)); - currentState = STATE_OUT; - readOffset = i + 1; - break; - // Finished a quoted part in a quoted field - case CODE_QUOTE: - currentState = STATE_QUOTE; - break; - // In a quoted part in a quoted field - default: - currentState = STATE_WITHIN_QUOTE_IN_QUOTE; - break; - } - break; - case STATE_WITHIN_QUOTE_IN_QUOTE: - switch (line.charAt(i)) { - // Exit a quoted part in a quoted field - case CODE_QUOTE: - currentState = STATE_QUOTE; - break; - } - break; - } - } - // Adds last item based on if it is quoted. - if (currentState === STATE_QUOTE_AFTER_QUOTE) { - result.push(line.substring(readOffset, readLength - 1)); - } - else { - result.push(line.substring(readOffset)); - } - // Check if each row has the same number of elements as column names. - if (validateElementCount && result.length !== this.fullColumnNames.length) { - throw new Error("Invalid row in csv file. Should have " + this.fullColumnNames.length + " elements in a row, but got " + result); - } - return result; - }; - return CSVDataset; -}(Dataset)); -// TODO(soergel): add more basic datasets for parity with tf.data -// tf.data.FixedLengthRecordDataset() -// tf.data.TFRecordDataset() - -/** - * @license - * Copyright 2019 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/** - * Provide a stream of tensors from microphone audio stream. The tensors are - * representing audio data as frequency-domain spectrogram generated with - * browser's native FFT. Tensors representing time-domain waveform is available - * based on configuration. Only works in browser environment. - */ -var MicrophoneIterator = /** @class */ (function (_super) { - __extends(MicrophoneIterator, _super); - function MicrophoneIterator(microphoneConfig) { - var _this = _super.call(this) || this; - _this.microphoneConfig = microphoneConfig; - _this.isClosed = false; - _this.fftSize = microphoneConfig.fftSize || 1024; - var fftSizeLog2 = Math.log2(_this.fftSize); - if (_this.fftSize < 0 || fftSizeLog2 < 4 || fftSizeLog2 > 14 || - !Number.isInteger(fftSizeLog2)) { - throw new Error("Invalid fftSize: it must be a power of 2 between " + - ("2 to 4 and 2 to 14, but got " + _this.fftSize)); - } - _this.numFrames = microphoneConfig.numFramesPerSpectrogram || 43; - _this.sampleRateHz = microphoneConfig.sampleRateHz; - _this.columnTruncateLength = - microphoneConfig.columnTruncateLength || _this.fftSize; - _this.audioTrackConstraints = microphoneConfig.audioTrackConstraints; - _this.smoothingTimeConstant = microphoneConfig.smoothingTimeConstant || 0; - _this.includeSpectrogram = - microphoneConfig.includeSpectrogram === false ? false : true; - _this.includeWaveform = - microphoneConfig.includeWaveform === true ? true : false; - if (!_this.includeSpectrogram && !_this.includeWaveform) { - throw new Error('Both includeSpectrogram and includeWaveform are false. ' + - 'At least one type of data should be returned.'); - } - return _this; - } - MicrophoneIterator.prototype.summary = function () { - return "microphone"; - }; - // Construct a MicrophoneIterator and start the audio stream. - MicrophoneIterator.create = function (microphoneConfig) { - if (microphoneConfig === void 0) { microphoneConfig = {}; } - return __awaiter(this, void 0, void 0, function () { - var microphoneIterator; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (tf.env().get('IS_NODE')) { - throw new Error('microphone API is only supported in browser environment.'); - } - microphoneIterator = new MicrophoneIterator(microphoneConfig); - // Call async function start() to initialize the audio stream. - return [4 /*yield*/, microphoneIterator.start()]; - case 1: - // Call async function start() to initialize the audio stream. - _a.sent(); - return [2 /*return*/, microphoneIterator]; - } - }); - }); - }; - // Start the audio stream and FFT. - MicrophoneIterator.prototype.start = function () { - return __awaiter(this, void 0, void 0, function () { - var _a, e_1, ctxConstructor, streamSource; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - _b.trys.push([0, 2, , 3]); - _a = this; - return [4 /*yield*/, navigator.mediaDevices.getUserMedia({ - audio: this.audioTrackConstraints == null ? true : - this.audioTrackConstraints, - video: false - })]; - case 1: - _a.stream = _b.sent(); - return [3 /*break*/, 3]; - case 2: - e_1 = _b.sent(); - throw new Error("Error thrown while initializing video stream: " + e_1.message); - case 3: - if (!this.stream) { - throw new Error('Could not obtain audio from microphone.'); - } - ctxConstructor = - // tslint:disable-next-line:no-any - window.AudioContext || window.webkitAudioContext; - this.audioContext = new ctxConstructor(); - if (!this.sampleRateHz) { - // If sample rate is not provided, use the available sample rate on - // device. - this.sampleRateHz = this.audioContext.sampleRate; - } - else if (this.audioContext.sampleRate !== this.sampleRateHz) { - throw new Error("Mismatch in sampling rate: " + - ("Expected: " + this.sampleRateHz + "; ") + - ("Actual: " + this.audioContext.sampleRate)); - } - streamSource = this.audioContext.createMediaStreamSource(this.stream); - this.analyser = this.audioContext.createAnalyser(); - this.analyser.fftSize = this.fftSize * 2; - this.analyser.smoothingTimeConstant = this.smoothingTimeConstant; - streamSource.connect(this.analyser); - this.freqData = new Float32Array(this.fftSize); - this.timeData = new Float32Array(this.fftSize); - return [2 /*return*/]; - } - }); - }); - }; - MicrophoneIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var spectrogramTensor, waveformTensor, audioDataQueue, freqData, timeData; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (this.isClosed) { - return [2 /*return*/, { value: null, done: true }]; - } - return [4 /*yield*/, this.getAudioData()]; - case 1: - audioDataQueue = _a.sent(); - if (this.includeSpectrogram) { - freqData = this.flattenQueue(audioDataQueue.freqDataQueue); - spectrogramTensor = this.getTensorFromAudioDataArray(freqData, [this.numFrames, this.columnTruncateLength, 1]); - } - if (this.includeWaveform) { - timeData = this.flattenQueue(audioDataQueue.timeDataQueue); - waveformTensor = this.getTensorFromAudioDataArray(timeData, [this.numFrames * this.fftSize, 1]); - } - return [2 /*return*/, { - value: { 'spectrogram': spectrogramTensor, 'waveform': waveformTensor }, - done: false - }]; - } - }); - }); - }; - // Capture one result from the audio stream, and extract the value from - // iterator.next() result. - MicrophoneIterator.prototype.capture = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.next()]; - case 1: return [2 /*return*/, (_a.sent()).value]; - } - }); - }); - }; - MicrophoneIterator.prototype.getAudioData = function () { - return __awaiter(this, void 0, void 0, function () { - var freqDataQueue, timeDataQueue, currentFrames; - var _this = this; - return __generator(this, function (_a) { - freqDataQueue = []; - timeDataQueue = []; - currentFrames = 0; - return [2 /*return*/, new Promise(function (resolve) { - var intervalID = setInterval(function () { - if (_this.includeSpectrogram) { - _this.analyser.getFloatFrequencyData(_this.freqData); - // If the audio stream is initializing, return empty queue. - if (_this.freqData[0] === -Infinity) { - resolve({ freqDataQueue: freqDataQueue, timeDataQueue: timeDataQueue }); - } - freqDataQueue.push(_this.freqData.slice(0, _this.columnTruncateLength)); - } - if (_this.includeWaveform) { - _this.analyser.getFloatTimeDomainData(_this.timeData); - timeDataQueue.push(_this.timeData.slice()); - } - // Clean interval and return when all frames have been collected - if (++currentFrames === _this.numFrames) { - clearInterval(intervalID); - resolve({ freqDataQueue: freqDataQueue, timeDataQueue: timeDataQueue }); - } - }, _this.fftSize / _this.sampleRateHz * 1e3); - })]; - }); - }); - }; - // Stop the audio stream and pause the iterator. - MicrophoneIterator.prototype.stop = function () { - if (!this.isClosed) { - this.isClosed = true; - this.analyser.disconnect(); - this.audioContext.close(); - if (this.stream != null && this.stream.getTracks().length > 0) { - this.stream.getTracks()[0].stop(); - } - } - }; - // Override toArray() function to prevent collecting. - MicrophoneIterator.prototype.toArray = function () { - throw new Error('Can not convert infinite audio stream to array.'); - }; - // Return audio sampling rate in Hz - MicrophoneIterator.prototype.getSampleRate = function () { - return this.sampleRateHz; - }; - MicrophoneIterator.prototype.flattenQueue = function (queue) { - var frameSize = queue[0].length; - var freqData = new Float32Array(queue.length * frameSize); - queue.forEach(function (data, i) { return freqData.set(data, i * frameSize); }); - return freqData; - }; - MicrophoneIterator.prototype.getTensorFromAudioDataArray = function (freqData, shape) { - var vals = new Float32Array(tf.util.sizeFromShape(shape)); - // If the data is less than the output shape, the rest is padded with zeros. - vals.set(freqData, vals.length - freqData.length); - return tf.tensor(vals, shape); - }; - return MicrophoneIterator; -}(LazyIterator)); - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/** - * Provide a stream of image tensors from webcam video stream. Only works in - * browser environment. - */ -var WebcamIterator = /** @class */ (function (_super) { - __extends(WebcamIterator, _super); - function WebcamIterator(webcamVideoElement, webcamConfig) { - var _this = _super.call(this) || this; - _this.webcamVideoElement = webcamVideoElement; - _this.webcamConfig = webcamConfig; - _this.isClosed = true; - _this.resize = false; - if (_this.needToResize()) { - _this.resize = true; - _this.cropSize = - [_this.webcamConfig.resizeHeight, _this.webcamConfig.resizeWidth]; - _this.cropBoxInd = tf.tensor1d([0], 'int32'); - if (_this.webcamConfig.centerCrop) { - // Calculate the box based on resizing shape. - var widthCroppingRatio = _this.webcamConfig.resizeWidth * 1.0 / _this.webcamVideoElement.width; - var heightCroppingRatio = _this.webcamConfig.resizeHeight * 1.0 / - _this.webcamVideoElement.height; - var widthCropStart = (1 - widthCroppingRatio) / 2; - var heightCropStart = (1 - heightCroppingRatio) / 2; - var widthCropEnd = widthCropStart + widthCroppingRatio; - var heightCropEnd = heightCroppingRatio + heightCropStart; - _this.cropBox = tf.tensor2d([heightCropStart, widthCropStart, heightCropEnd, widthCropEnd], [1, 4]); - } - else { - _this.cropBox = tf.tensor2d([0, 0, 1, 1], [1, 4]); - } - } - return _this; - } - WebcamIterator.prototype.summary = function () { - return "webcam"; - }; - // Construct a WebcamIterator and start it's video stream. - WebcamIterator.create = function (webcamVideoElement, webcamConfig) { - if (webcamConfig === void 0) { webcamConfig = {}; } - return __awaiter(this, void 0, void 0, function () { - var webcamIterator; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: - if (tf.env().get('IS_NODE')) { - throw new Error('tf.data.webcam is only supported in browser environment.'); - } - if (!webcamVideoElement) { - // If webcam video element is not provided, create a hidden video element - // with provided width and height. - webcamVideoElement = document.createElement('video'); - if (!webcamConfig.resizeWidth || !webcamConfig.resizeHeight) { - throw new Error('Please provide webcam video element, or resizeWidth and ' + - 'resizeHeight to create a hidden video element.'); - } - webcamVideoElement.width = webcamConfig.resizeWidth; - webcamVideoElement.height = webcamConfig.resizeHeight; - } - webcamIterator = new WebcamIterator(webcamVideoElement, webcamConfig); - // Call async function to initialize the video stream. - return [4 /*yield*/, webcamIterator.start()]; - case 1: - // Call async function to initialize the video stream. - _a.sent(); - return [2 /*return*/, webcamIterator]; - } - }); - }); - }; - // Async function to start video stream. - WebcamIterator.prototype.start = function () { - return __awaiter(this, void 0, void 0, function () { - var _a, e_1; - var _this = this; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (this.webcamConfig.facingMode) { - tf.util.assert((this.webcamConfig.facingMode === 'user') || - (this.webcamConfig.facingMode === 'environment'), function () { - return "Invalid webcam facing mode: " + _this.webcamConfig.facingMode + ". " + - "Please provide 'user' or 'environment'"; - }); - } - _b.label = 1; - case 1: - _b.trys.push([1, 3, , 4]); - _a = this; - return [4 /*yield*/, navigator.mediaDevices.getUserMedia({ - video: { - deviceId: this.webcamConfig.deviceId, - facingMode: this.webcamConfig.facingMode ? - this.webcamConfig.facingMode : - 'user', - width: this.webcamVideoElement.width, - height: this.webcamVideoElement.height - } - })]; - case 2: - _a.stream = _b.sent(); - return [3 /*break*/, 4]; - case 3: - e_1 = _b.sent(); - // Modify the error message but leave the stack trace intact - e_1.message = "Error thrown while initializing video stream: " + e_1.message; - throw e_1; - case 4: - if (!this.stream) { - throw new Error('Could not obtain video from webcam.'); - } - // Older browsers may not have srcObject - try { - this.webcamVideoElement.srcObject = this.stream; - } - catch (error) { - console.log(error); - this.webcamVideoElement.src = window.URL.createObjectURL(this.stream); - } - // Start the webcam video stream - this.webcamVideoElement.play(); - this.isClosed = false; - return [2 /*return*/, new Promise(function (resolve) { - // Add event listener to make sure the webcam has been fully initialized. - _this.webcamVideoElement.onloadedmetadata = function () { - resolve(); - }; - })]; - } - }); - }); - }; - WebcamIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var img; - return __generator(this, function (_a) { - if (this.isClosed) { - return [2 /*return*/, { value: null, done: true }]; - } - try { - img = tf.browser.fromPixels(this.webcamVideoElement); - } - catch (e) { - throw new Error("Error thrown converting video to pixels: " + JSON.stringify(e)); - } - if (this.resize) { - try { - return [2 /*return*/, { value: this.cropAndResizeFrame(img), done: false }]; - } - catch (e) { - throw new Error("Error thrown cropping the video: " + e.message); - } - finally { - img.dispose(); - } - } - else { - return [2 /*return*/, { value: img, done: false }]; - } - return [2 /*return*/]; - }); - }); - }; - WebcamIterator.prototype.needToResize = function () { - // If resizeWidth and resizeHeight are provided, and different from the - // width and height of original HTMLVideoElement, then resizing and cropping - // is required. - if (this.webcamConfig.resizeWidth && this.webcamConfig.resizeHeight && - (this.webcamVideoElement.width !== this.webcamConfig.resizeWidth || - this.webcamVideoElement.height !== this.webcamConfig.resizeHeight)) { - return true; - } - return false; - }; - // Cropping and resizing each frame based on config - WebcamIterator.prototype.cropAndResizeFrame = function (img) { - var _this = this; - return tf.tidy(function () { - var expandedImage = tf.expandDims(tf.cast(img, 'float32'), (0)); - var resizedImage; - resizedImage = tf.image.cropAndResize(expandedImage, _this.cropBox, _this.cropBoxInd, _this.cropSize, 'bilinear'); - // Extract image from batch cropping. - var shape = resizedImage.shape; - return tf.reshape(resizedImage, shape.slice(1)); - }); - }; - // Capture one frame from the video stream, and extract the value from - // iterator.next() result. - WebcamIterator.prototype.capture = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.next()]; - case 1: return [2 /*return*/, (_a.sent()).value]; - } - }); - }); - }; - // Stop the video stream and pause webcam iterator. - WebcamIterator.prototype.stop = function () { - var tracks = this.stream.getTracks(); - tracks.forEach(function (track) { return track.stop(); }); - try { - this.webcamVideoElement.srcObject = null; - } - catch (error) { - console.log(error); - this.webcamVideoElement.src = null; - } - this.isClosed = true; - }; - // Override toArray() function to prevent collecting. - WebcamIterator.prototype.toArray = function () { - throw new Error('Can not convert infinite video stream to array.'); - }; - return WebcamIterator; -}(LazyIterator)); - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/** - * Represents a data source readable as a stream of binary data chunks. - * - * Because `Dataset`s can be read repeatedly (via `Dataset.iterator()`), this - * provides a means to repeatedly create streams from the underlying data - * sources. - */ -var DataSource = /** @class */ (function () { - function DataSource() { - } - return DataSource; -}()); -// TODO(soergel): consider convenience factory functions here -// in combination with chainable source->dataset above, e.g.: -// tf.data.url(...).asCsvDataset().shuffle().batch() - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -var StringIterator = /** @class */ (function (_super) { - __extends(StringIterator, _super); - function StringIterator() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Splits a string stream on a given separator. - * - * It is assumed that the incoming chunk boundaries have no semantic meaning, - * so conceptually the incoming stream is treated simply as the concatenation - * of its elements. - * - * The outgoing stream provides chunks corresponding to the results of the - * standard string split() operation (even if such a chunk spanned incoming - * chunks). The separators are not included. - * - * A typical usage is to split a text file (represented as a stream with - * arbitrary chunk boundaries) into lines. - * - * @param upstream A readable stream of strings that can be treated as - * concatenated. - * @param separator A character to split on. - */ - StringIterator.prototype.split = function (separator) { - return new SplitIterator(this, separator); - }; - return StringIterator; -}(LazyIterator)); -// ============================================================================ -// The following private classes serve to implement the chainable methods -// on StringIterator. Unfortunately they can't be placed in separate files, due -// to resulting trouble with circular imports. -// ============================================================================ -// We wanted multiple inheritance, e.g. -// class SplitIterator extends QueueIterator, StringIterator -// but the TypeScript mixin approach is a bit hacky, so we take this adapter -// approach instead. -var SplitIterator = /** @class */ (function (_super) { - __extends(SplitIterator, _super); - function SplitIterator(upstream, separator) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.impl = new SplitIteratorImpl(upstream, separator); - return _this; - } - SplitIterator.prototype.summary = function () { - return this.impl.summary(); - }; - SplitIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.impl.next()]; - }); - }); - }; - return SplitIterator; -}(StringIterator)); -var SplitIteratorImpl = /** @class */ (function (_super) { - __extends(SplitIteratorImpl, _super); - function SplitIteratorImpl(upstream, separator) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.separator = separator; - // A partial string at the end of an upstream chunk - _this.carryover = ''; - return _this; - } - SplitIteratorImpl.prototype.summary = function () { - return this.upstream.summary() + " -> Split('" + this.separator + "')"; - }; - SplitIteratorImpl.prototype.pump = function () { - return __awaiter(this, void 0, void 0, function () { - var chunkResult, lines, _i, _a, line; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: return [4 /*yield*/, this.upstream.next()]; - case 1: - chunkResult = _b.sent(); - if (chunkResult.done) { - if (this.carryover === '') { - return [2 /*return*/, false]; - } - // Pretend that the pump succeeded in order to emit the small last batch. - // The next pump() call will actually fail. - this.outputQueue.push(this.carryover); - this.carryover = ''; - return [2 /*return*/, true]; - } - lines = chunkResult.value.split(this.separator); - // Note the behavior: " ab ".split(' ') === ['', 'ab', ''] - // Thus the carryover may be '' if the separator falls on a chunk - // boundary; this produces the correct result. - lines[0] = this.carryover + lines[0]; - for (_i = 0, _a = lines.slice(0, -1); _i < _a.length; _i++) { - line = _a[_i]; - this.outputQueue.push(line); - } - this.carryover = lines[lines.length - 1]; - return [2 /*return*/, true]; - } - }); - }); - }; - return SplitIteratorImpl; -}(OneToManyIterator)); - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -var ByteChunkIterator = /** @class */ (function (_super) { - __extends(ByteChunkIterator, _super); - function ByteChunkIterator() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Decode a stream of UTF8-encoded byte arrays to a stream of strings. - * - * The byte arrays producetd from the ByteChunkIterator on which this is - * called will be interpreted as concatenated. No assumptions are made about - * the boundaries of the incoming chunks, so a multi-byte UTF8 encoding of a - * character may span the boundary between chunks. This naturally happens, - * for instance, when reading fixed-size byte arrays from a file. - */ - ByteChunkIterator.prototype.decodeUTF8 = function () { - return new Utf8Iterator(this); - }; - return ByteChunkIterator; -}(LazyIterator)); -// ============================================================================ -// The following private classes serve to implement the chainable methods -// on ByteChunkIterator. Unfortunately they can't be placed in separate files, -// due to resulting trouble with circular imports. -// ============================================================================ -// We wanted multiple inheritance, e.g. -// class Utf8Iterator extends QueueIterator, StringIterator -// but the TypeScript mixin approach is a bit hacky, so we take this adapter -// approach instead. -var Utf8Iterator = /** @class */ (function (_super) { - __extends(Utf8Iterator, _super); - function Utf8Iterator(upstream) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - _this.impl = new Utf8IteratorImpl(upstream); - return _this; - } - Utf8Iterator.prototype.summary = function () { - return this.impl.summary(); - }; - Utf8Iterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, this.impl.next()]; - }); - }); - }; - return Utf8Iterator; -}(StringIterator)); -/** - * Decode a stream of UTF8-encoded byte arrays to a stream of strings. - * - * This is tricky because the incoming byte array boundaries may disrupt a - * multi-byte UTF8 character. Thus any incomplete character data at the end of - * a chunk must be carried over and prepended to the next chunk before - * decoding. Luckily with native decoder, TextDecoder in browser and - * string_decoder in node, byte array boundaries are handled automatically. - * - * In the context of an input pipeline for machine learning, UTF8 decoding is - * needed to parse text files containing training examples or prediction - * requests (e.g., formatted as CSV or JSON). We cannot use the built-in - * decoding provided by FileReader.readAsText() because here we are in a - * streaming context, which FileReader does not support. - * - * @param upstream A `LazyIterator` of `Uint8Arrays` containing UTF8-encoded - * text, which should be interpreted as concatenated. No assumptions are - * made about the boundaries of the incoming chunks, so a multi-byte UTF8 - * encoding of a character may span the boundary between chunks. This - * naturally happens, for instance, when reading fixed-size byte arrays from a - * file. - */ -var Utf8IteratorImpl = /** @class */ (function (_super) { - __extends(Utf8IteratorImpl, _super); - function Utf8IteratorImpl(upstream) { - var _this = _super.call(this) || this; - _this.upstream = upstream; - if (tf.env().get('IS_BROWSER')) { - _this.decoder = new TextDecoder('utf-8'); - } - else { - // tslint:disable-next-line:no-require-imports - var StringDecoder = require('string_decoder').StringDecoder; - _this.decoder = new StringDecoder('utf8'); - } - return _this; - } - Utf8IteratorImpl.prototype.summary = function () { - return this.upstream.summary() + " -> Utf8"; - }; - Utf8IteratorImpl.prototype.pump = function () { - return __awaiter(this, void 0, void 0, function () { - var chunkResult, chunk, text; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, this.upstream.next()]; - case 1: - chunkResult = _a.sent(); - if (chunkResult.done) { - return [2 /*return*/, false]; - } - else { - chunk = chunkResult.value; - } - if (tf.env().get('IS_BROWSER')) { - text = this.decoder.decode(chunk, { stream: true }); - } - else { - text = this.decoder.write(Buffer.from(chunk.buffer)); - } - this.outputQueue.push(text); - return [2 /*return*/, true]; - } - }); - }); - }; - return Utf8IteratorImpl; -}(OneToManyIterator)); - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/** - * Provide a stream of chunks from a File, Blob, or Uint8Array. - * @param file The source File, Blob or Uint8Array. - * @param options Optional settings controlling file reading. - * @returns a lazy Iterator of Uint8Arrays containing sequential chunks of the - * input File, Blob or Uint8Array. - */ -var FileChunkIterator = /** @class */ (function (_super) { - __extends(FileChunkIterator, _super); - function FileChunkIterator(file, options) { - if (options === void 0) { options = {}; } - var _this = _super.call(this) || this; - _this.file = file; - _this.options = options; - tf.util.assert((file instanceof Uint8Array) || - (tf.env().get('IS_BROWSER') ? - (file instanceof File || file instanceof Blob) : - false), function () { return 'FileChunkIterator only supports File, Blob and Uint8Array ' + - 'right now.'; }); - _this.offset = options.offset || 0; - // default 1MB chunk has tolerable perf on large files - _this.chunkSize = options.chunkSize || 1024 * 1024; - return _this; - } - FileChunkIterator.prototype.summary = function () { - return "FileChunks " + this.file; - }; - FileChunkIterator.prototype.next = function () { - return __awaiter(this, void 0, void 0, function () { - var chunk, _a; - var _this = this; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if (this.offset >= ((this.file instanceof Uint8Array) ? - this.file.byteLength : - this.file.size)) { - return [2 /*return*/, { value: null, done: true }]; - } - chunk = new Promise(function (resolve, reject) { - var end = _this.offset + _this.chunkSize; - if (_this.file instanceof Uint8Array) { - // Note if end > this.uint8Array.byteLength, we just get a small last - // chunk. - resolve(new Uint8Array(_this.file.slice(_this.offset, end))); - } - else { - // This branch assumes that this.file type is File or Blob, which - // means it is in the browser environment. - // TODO(soergel): is this a performance issue? - var fileReader_1 = new FileReader(); - fileReader_1.onload = function (event) { - var data = fileReader_1.result; - // Not sure we can trust the return type of - // FileReader.readAsArrayBuffer See e.g. - // https://github.com/node-file-api/FileReader/issues/2 - if (data instanceof ArrayBuffer) { - data = new Uint8Array(data); - } - if (!(data instanceof Uint8Array)) { - return reject(new TypeError('FileReader returned unknown type.')); - } - resolve(data); - }; - fileReader_1.onabort = function (event) { - return reject(new Error('Aborted')); - }; - fileReader_1.onerror = function (event) { - return reject(new Error(event.type)); - }; - // TODO(soergel): better handle onabort, onerror - // Note if end > this.file.size, we just get a small last chunk. - var slice = _this.file.slice(_this.offset, end); - // We can't use readAsText here (even if we know the file is text) - // because the slice boundary may fall within a multi-byte character. - fileReader_1.readAsArrayBuffer(slice); - } - _this.offset = end; - }); - _a = {}; - return [4 /*yield*/, chunk]; - case 1: return [2 /*return*/, (_a.value = (_b.sent()), _a.done = false, _a)]; - } - }); - }); - }; - return FileChunkIterator; -}(ByteChunkIterator)); - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/** - * Provide a stream of chunks from a URL. - * - * Note this class first downloads the entire file into memory before providing - * the first element from the stream. This is because the Fetch API does not - * yet reliably provide a reader stream for the response body. - */ -function urlChunkIterator(url, options) { - if (options === void 0) { options = {}; } - return __awaiter(this, void 0, void 0, function () { - var urlString, requestInit, response, uint8Array, _a; - return __generator(this, function (_b) { - switch (_b.label) { - case 0: - if ((typeof url) === 'string') { - urlString = url; - } - else { - urlString = url.url; - requestInit = getRequestInitFromRequest(url); - } - return [4 /*yield*/, tf.util.fetch(urlString, requestInit)]; - case 1: - response = _b.sent(); - if (!response.ok) return [3 /*break*/, 3]; - _a = Uint8Array.bind; - return [4 /*yield*/, response.arrayBuffer()]; - case 2: - uint8Array = new (_a.apply(Uint8Array, [void 0, _b.sent()]))(); - return [2 /*return*/, new FileChunkIterator(uint8Array, options)]; - case 3: throw new Error(response.statusText); - } - }); - }); -} -// Generate RequestInit from Request to match tf.util.fetch signature. -var getRequestInitFromRequest = function (request) { - var init = { - method: request.method, - headers: request.headers, - body: request.body, - mode: request.mode, - credentials: request.credentials, - cache: request.cache, - redirect: request.redirect, - referrer: request.referrer, - integrity: request.integrity, - }; - return init; -}; - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -// Skip tslint any type check cause this method is aiming to check type of -// input. -// tslint:disable-next-line:no-any -function isLocalPath(source) { - return (typeof source === 'string') && source.substr(0, 7) === 'file://'; -} - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/** - * Represents a file, blob, or Uint8Array readable as a stream of binary data - * chunks. - */ -var FileDataSource = /** @class */ (function (_super) { - __extends(FileDataSource, _super); - /** - * Create a `FileDataSource`. - * - * @param input Local file path, or `File`/`Blob`/`Uint8Array` object to - * read. Local file only works in node environment. - * @param options Options passed to the underlying `FileChunkIterator`s, - * such as {chunksize: 1024}. - */ - function FileDataSource(input, options) { - if (options === void 0) { options = {}; } - var _this = _super.call(this) || this; - _this.input = input; - _this.options = options; - return _this; - } - FileDataSource.prototype.iterator = function () { - return __awaiter(this, void 0, void 0, function () { - var fs; - return __generator(this, function (_a) { - if (isLocalPath(this.input) && tf.env().get('IS_NODE')) { - fs = require('fs'); - this.input = fs.readFileSync(this.input.substr(7)); - } - // TODO(kangyizhang): Add LocalFileChunkIterator to split local streaming - // with file in browser. - return [2 /*return*/, new FileChunkIterator(this.input, this.options)]; - }); - }); - }; - return FileDataSource; -}(DataSource)); - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/* - * Represents a URL readable as a stream of binary data chunks. - */ -var URLDataSource = /** @class */ (function (_super) { - __extends(URLDataSource, _super); - /** - * Create a `URLDataSource`. - * - * @param url A source URL string, or a `Request` object. - * @param options Options passed to the underlying `FileChunkIterator`s, - * such as {chunksize: 1024}. - */ - function URLDataSource(url, fileOptions) { - if (fileOptions === void 0) { fileOptions = {}; } - var _this = _super.call(this) || this; - _this.url = url; - _this.fileOptions = fileOptions; - return _this; - } - // TODO(soergel): provide appropriate caching options. Currently this - // will download the URL anew for each call to iterator(). Since we have - // to treat the downloaded file as a blob/buffer anyway, we may as well retain - // it-- but that raises GC issues. Also we may want a persistent disk cache. - URLDataSource.prototype.iterator = function () { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - if (isLocalPath(this.url)) { - return [2 /*return*/, (new FileDataSource(this.url, this.fileOptions)) - .iterator()]; - } - else { - return [2 /*return*/, urlChunkIterator(this.url, this.fileOptions)]; - } - }); - }); - }; - return URLDataSource; -}(DataSource)); - -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -/** - * Create a `CSVDataset` by reading and decoding CSV file(s) from provided URL - * or local path if it's in Node environment. - * - * Note: If isLabel in columnConfigs is `true` for at least one column, the - * element in returned `CSVDataset` will be an object of - * `{xs:features, ys:labels}`: xs is a dict of features key/value pairs, ys - * is a dict of labels key/value pairs. If no column is marked as label, - * returns a dict of features only. - * - * ```js - * const csvUrl = - * 'https://storage.googleapis.com/tfjs-examples/multivariate-linear-regression/data/boston-housing-train.csv'; - * - * async function run() { - * // We want to predict the column "medv", which represents a median value of - * // a home (in $1000s), so we mark it as a label. - * const csvDataset = tf.data.csv( - * csvUrl, { - * columnConfigs: { - * medv: { - * isLabel: true - * } - * } - * }); - * - * // Number of features is the number of column names minus one for the label - * // column. - * const numOfFeatures = (await csvDataset.columnNames()).length - 1; - * - * // Prepare the Dataset for training. - * const flattenedDataset = - * csvDataset - * .map(({xs, ys}) => - * { - * // Convert xs(features) and ys(labels) from object form (keyed by - * // column name) to array form. - * return {xs:Object.values(xs), ys:Object.values(ys)}; - * }) - * .batch(10); - * - * // Define the model. - * const model = tf.sequential(); - * model.add(tf.layers.dense({ - * inputShape: [numOfFeatures], - * units: 1 - * })); - * model.compile({ - * optimizer: tf.train.sgd(0.000001), - * loss: 'meanSquaredError' - * }); - * - * // Fit the model using the prepared Dataset - * return model.fitDataset(flattenedDataset, { - * epochs: 10, - * callbacks: { - * onEpochEnd: async (epoch, logs) => { - * console.log(epoch + ':' + logs.loss); - * } - * } - * }); - * } - * - * await run(); - * ``` - * - * @param source URL or local path to get CSV file. If it's a local path, it - * must have prefix `file://` and it only works in node environment. - * @param csvConfig (Optional) A CSVConfig object that contains configurations - * of reading and decoding from CSV file(s). - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * configParamIndices: [1] - * } - */ -function csv(source, csvConfig) { - if (csvConfig === void 0) { csvConfig = {}; } - return new CSVDataset(new URLDataSource(source), csvConfig); -} -/** - * Create a `Dataset` that produces each element by calling a provided function. - * - * Note that repeated iterations over this `Dataset` may produce different - * results, because the function will be called anew for each element of each - * iteration. - * - * Also, beware that the sequence of calls to this function may be out of order - * in time with respect to the logical order of the Dataset. This is due to the - * asynchronous lazy nature of stream processing, and depends on downstream - * transformations (e.g. .shuffle()). If the provided function is pure, this is - * no problem, but if it is a closure over a mutable state (e.g., a traversal - * pointer), then the order of the produced elements may be scrambled. - * - * ```js - * let i = -1; - * const func = () => - * ++i < 5 ? {value: i, done: false} : {value: null, done: true}; - * const ds = tf.data.func(func); - * await ds.forEachAsync(e => console.log(e)); - * ``` - * - * @param f A function that produces one data element on each call. - */ -function func(f) { - var _this = this; - var iter = iteratorFromFunction(f); - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) { - return [2 /*return*/, iter]; - }); }); }); -} -/** - * Create a `Dataset` that produces each element from provided JavaScript - * generator, which is a function* - * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions), - * or a function that returns an - * iterator - * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions). - * - * The returned iterator should have `.next()` function that returns element in - * format of `{value: TensorContainer, done:boolean}`. - * - * Example of creating a dataset from an iterator factory: - * ```js - * function makeIterator() { - * const numElements = 10; - * let index = 0; - * - * const iterator = { - * next: () => { - * let result; - * if (index < numElements) { - * result = {value: index, done: false}; - * index++; - * return result; - * } - * return {value: index, done: true}; - * } - * }; - * return iterator; - * } - * const ds = tf.data.generator(makeIterator); - * await ds.forEachAsync(e => console.log(e)); - * ``` - * - * Example of creating a dataset from a generator: - * ```js - * function* dataGenerator() { - * const numElements = 10; - * let index = 0; - * while (index < numElements) { - * const x = index; - * index++; - * yield x; - * } - * } - * - * const ds = tf.data.generator(dataGenerator); - * await ds.forEachAsync(e => console.log(e)); - * ``` - * - * @param generator A Javascript generator function that returns a JavaScript - * iterator. - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * configParamIndices: [1] - * } - */ -function generator(generator) { - var _this = this; - return datasetFromIteratorFn(function () { return __awaiter(_this, void 0, void 0, function () { - var gen; - return __generator(this, function (_a) { - switch (_a.label) { - case 0: return [4 /*yield*/, generator()]; - case 1: - gen = _a.sent(); - return [2 /*return*/, iteratorFromFunction(function () { return gen.next(); })]; - } - }); - }); }); -} -/** - * Create an iterator that generate `Tensor`s from webcam video stream. This API - * only works in Browser environment when the device has webcam. - * - * Note: this code snippet only works when the device has a webcam. It will - * request permission to open the webcam when running. - * ```js - * const videoElement = document.createElement('video'); - * videoElement.width = 100; - * videoElement.height = 100; - * const cam = await tf.data.webcam(videoElement); - * const img = await cam.capture(); - * img.print(); - * cam.stop(); - * ``` - * - * @param webcamVideoElement A `HTMLVideoElement` used to play video from - * webcam. If this element is not provided, a hidden `HTMLVideoElement` will - * be created. In that case, `resizeWidth` and `resizeHeight` must be - * provided to set the generated tensor shape. - * @param webcamConfig A `WebcamConfig` object that contains configurations of - * reading and manipulating data from webcam video stream. - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * ignoreCI: true - * } - */ -function webcam(webcamVideoElement, webcamConfig) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, WebcamIterator.create(webcamVideoElement, webcamConfig)]; - }); - }); -} -/** - * Create an iterator that generate frequency-domain spectrogram `Tensor`s from - * microphone audio stream with browser's native FFT. This API only works in - * browser environment when the device has microphone. - * - * Note: this code snippet only works when the device has a microphone. It will - * request permission to open the microphone when running. - * ```js - * const mic = await tf.data.microphone({ - * fftSize: 1024, - * columnTruncateLength: 232, - * numFramesPerSpectrogram: 43, - * sampleRateHz:44100, - * includeSpectrogram: true, - * includeWaveform: true - * }); - * const audioData = await mic.capture(); - * const spectrogramTensor = audioData.spectrogram; - * spectrogramTensor.print(); - * const waveformTensor = audioData.waveform; - * waveformTensor.print(); - * mic.stop(); - * ``` - * - * @param microphoneConfig A `MicrophoneConfig` object that contains - * configurations of reading audio data from microphone. - * - * @doc { - * heading: 'Data', - * subheading: 'Creation', - * namespace: 'data', - * ignoreCI: true - * } - */ -function microphone(microphoneConfig) { - return __awaiter(this, void 0, void 0, function () { - return __generator(this, function (_a) { - return [2 /*return*/, MicrophoneIterator.create(microphoneConfig)]; - }); - }); -} - -/** @license See the LICENSE file. */ -// This code is auto-generated, do not modify this file! -var version = '3.6.0'; - -exports.CSVDataset = CSVDataset; -exports.Dataset = Dataset; -exports.FileDataSource = FileDataSource; -exports.TextLineDataset = TextLineDataset; -exports.URLDataSource = URLDataSource; -exports.array = array; -exports.csv = csv; -exports.func = func; -exports.generator = generator; -exports.microphone = microphone; -exports.version_data = version; -exports.webcam = webcam; -exports.zip = zip; -//# sourceMappingURL=tf-data.node.js.map diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.node.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.node.js.map deleted file mode 100644 index 60c2aefa8..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tf-data.node.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tf-data.node.js","sources":["../node_modules/seedrandom/lib/alea.js","../node_modules/seedrandom/lib/xor128.js","../node_modules/seedrandom/lib/xorwow.js","../node_modules/seedrandom/lib/xorshift7.js","../node_modules/seedrandom/lib/xor4096.js","../node_modules/seedrandom/lib/tychei.js","../node_modules/seedrandom/seedrandom.js","../node_modules/seedrandom/index.js","../src/util/deep_map.ts","../src/util/deep_clone.ts","../src/util/ring_buffer.ts","../src/util/growing_ring_buffer.ts","../src/iterators/lazy_iterator.ts","../src/dataset.ts","../src/datasets/text_line_dataset.ts","../src/datasets/csv_dataset.ts","../src/iterators/microphone_iterator.ts","../src/iterators/webcam_iterator.ts","../src/datasource.ts","../src/iterators/string_iterator.ts","../src/iterators/byte_chunk_iterator.ts","../src/iterators/file_chunk_iterator.ts","../src/iterators/url_chunk_iterator.ts","../src/util/source_util.ts","../src/sources/file_data_source.ts","../src/sources/url_data_source.ts","../src/readers.ts","../src/version.ts"],"sourcesContent":["// A port of an algorithm by Johannes Baagøe , 2010\n// http://baagoe.com/en/RandomMusings/javascript/\n// https://github.com/nquinlan/better-random-numbers-for-javascript-mirror\n// Original work is under MIT license -\n\n// Copyright (C) 2010 by Johannes Baagøe \n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n// \n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n// \n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n\n\n(function(global, module, define) {\n\nfunction Alea(seed) {\n var me = this, mash = Mash();\n\n me.next = function() {\n var t = 2091639 * me.s0 + me.c * 2.3283064365386963e-10; // 2^-32\n me.s0 = me.s1;\n me.s1 = me.s2;\n return me.s2 = t - (me.c = t | 0);\n };\n\n // Apply the seeding algorithm from Baagoe.\n me.c = 1;\n me.s0 = mash(' ');\n me.s1 = mash(' ');\n me.s2 = mash(' ');\n me.s0 -= mash(seed);\n if (me.s0 < 0) { me.s0 += 1; }\n me.s1 -= mash(seed);\n if (me.s1 < 0) { me.s1 += 1; }\n me.s2 -= mash(seed);\n if (me.s2 < 0) { me.s2 += 1; }\n mash = null;\n}\n\nfunction copy(f, t) {\n t.c = f.c;\n t.s0 = f.s0;\n t.s1 = f.s1;\n t.s2 = f.s2;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new Alea(seed),\n state = opts && opts.state,\n prng = xg.next;\n prng.int32 = function() { return (xg.next() * 0x100000000) | 0; }\n prng.double = function() {\n return prng() + (prng() * 0x200000 | 0) * 1.1102230246251565e-16; // 2^-53\n };\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nfunction Mash() {\n var n = 0xefc8249d;\n\n var mash = function(data) {\n data = data.toString();\n for (var i = 0; i < data.length; i++) {\n n += data.charCodeAt(i);\n var h = 0.02519603282416938 * n;\n n = h >>> 0;\n h -= n;\n h *= n;\n n = h >>> 0;\n h -= n;\n n += h * 0x100000000; // 2^32\n }\n return (n >>> 0) * 2.3283064365386963e-10; // 2^-32\n };\n\n return mash;\n}\n\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.alea = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xor128\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n\n // Set up generator function.\n me.next = function() {\n var t = me.x ^ (me.x << 11);\n me.x = me.y;\n me.y = me.z;\n me.z = me.w;\n return me.w ^= (me.w >>> 19) ^ t ^ (t >>> 8);\n };\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor128 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xorwow\" prng algorithm by\n// George Marsaglia. See http://www.jstatsoft.org/v08/i14/paper\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var t = (me.x ^ (me.x >>> 2));\n me.x = me.y; me.y = me.z; me.z = me.w; me.w = me.v;\n return (me.d = (me.d + 362437 | 0)) +\n (me.v = (me.v ^ (me.v << 4)) ^ (t ^ (t << 1))) | 0;\n };\n\n me.x = 0;\n me.y = 0;\n me.z = 0;\n me.w = 0;\n me.v = 0;\n\n if (seed === (seed | 0)) {\n // Integer seed.\n me.x = seed;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 64; k++) {\n me.x ^= strseed.charCodeAt(k) | 0;\n if (k == strseed.length) {\n me.d = me.x << 10 ^ me.x >>> 4;\n }\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.x = f.x;\n t.y = f.y;\n t.z = f.z;\n t.w = f.w;\n t.v = f.v;\n t.d = f.d;\n return t;\n}\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorwow = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","// A Javascript implementaion of the \"xorshift7\" algorithm by\n// François Panneton and Pierre L'ecuyer:\n// \"On the Xorgshift Random Number Generators\"\n// http://saluc.engr.uconn.edu/refs/crypto/rng/panneton05onthexorshift.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n // Update xor generator.\n var X = me.x, i = me.i, t, v, w;\n t = X[i]; t ^= (t >>> 7); v = t ^ (t << 24);\n t = X[(i + 1) & 7]; v ^= t ^ (t >>> 10);\n t = X[(i + 3) & 7]; v ^= t ^ (t >>> 3);\n t = X[(i + 4) & 7]; v ^= t ^ (t << 7);\n t = X[(i + 7) & 7]; t = t ^ (t << 13); v ^= t ^ (t << 9);\n X[i] = v;\n me.i = (i + 1) & 7;\n return v;\n };\n\n function init(me, seed) {\n var j, w, X = [];\n\n if (seed === (seed | 0)) {\n // Seed state array using a 32-bit integer.\n w = X[0] = seed;\n } else {\n // Seed state using a string.\n seed = '' + seed;\n for (j = 0; j < seed.length; ++j) {\n X[j & 7] = (X[j & 7] << 15) ^\n (seed.charCodeAt(j) + X[(j + 1) & 7] << 13);\n }\n }\n // Enforce an array length of 8, not all zeroes.\n while (X.length < 8) X.push(0);\n for (j = 0; j < 8 && X[j] === 0; ++j);\n if (j == 8) w = X[7] = -1; else w = X[j];\n\n me.x = X;\n me.i = 0;\n\n // Discard an initial 256 values.\n for (j = 256; j > 0; --j) {\n me.next();\n }\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.x = f.x.slice();\n t.i = f.i;\n return t;\n}\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.x) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xorshift7 = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n","// A Javascript implementaion of Richard Brent's Xorgens xor4096 algorithm.\n//\n// This fast non-cryptographic random number generator is designed for\n// use in Monte-Carlo algorithms. It combines a long-period xorshift\n// generator with a Weyl generator, and it passes all common batteries\n// of stasticial tests for randomness while consuming only a few nanoseconds\n// for each prng generated. For background on the generator, see Brent's\n// paper: \"Some long-period random number generators using shifts and xors.\"\n// http://arxiv.org/pdf/1004.3115v1.pdf\n//\n// Usage:\n//\n// var xor4096 = require('xor4096');\n// random = xor4096(1); // Seed with int32 or string.\n// assert.equal(random(), 0.1520436450538547); // (0, 1) range, 53 bits.\n// assert.equal(random.int32(), 1806534897); // signed int32, 32 bits.\n//\n// For nonzero numeric keys, this impelementation provides a sequence\n// identical to that by Brent's xorgens 3 implementaion in C. This\n// implementation also provides for initalizing the generator with\n// string seeds, or for saving and restoring the state of the generator.\n//\n// On Chrome, this prng benchmarks about 2.1 times slower than\n// Javascript's built-in Math.random().\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this;\n\n // Set up generator function.\n me.next = function() {\n var w = me.w,\n X = me.X, i = me.i, t, v;\n // Update Weyl generator.\n me.w = w = (w + 0x61c88647) | 0;\n // Update xor generator.\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n // Update Xor generator array state.\n v = X[i] = v ^ t;\n me.i = i;\n // Result is the combination.\n return (v + (w ^ (w >>> 16))) | 0;\n };\n\n function init(me, seed) {\n var t, v, i, j, w, X = [], limit = 128;\n if (seed === (seed | 0)) {\n // Numeric seeds initialize v, which is used to generates X.\n v = seed;\n seed = null;\n } else {\n // String seeds are mixed into v and X one character at a time.\n seed = seed + '\\0';\n v = 0;\n limit = Math.max(limit, seed.length);\n }\n // Initialize circular array and weyl value.\n for (i = 0, j = -32; j < limit; ++j) {\n // Put the unicode characters into the array, and shuffle them.\n if (seed) v ^= seed.charCodeAt((j + 32) % seed.length);\n // After 32 shuffles, take v as the starting w value.\n if (j === 0) w = v;\n v ^= v << 10;\n v ^= v >>> 15;\n v ^= v << 4;\n v ^= v >>> 13;\n if (j >= 0) {\n w = (w + 0x61c88647) | 0; // Weyl.\n t = (X[j & 127] ^= (v + w)); // Combine xor and weyl to init array.\n i = (0 == t) ? i + 1 : 0; // Count zeroes.\n }\n }\n // We have detected all zeroes; make the key nonzero.\n if (i >= 128) {\n X[(seed && seed.length || 0) & 127] = -1;\n }\n // Run the generator 512 times to further mix the state before using it.\n // Factoring this as a function slows the main generator, so it is just\n // unrolled here. The weyl generator is not advanced while warming up.\n i = 127;\n for (j = 4 * 128; j > 0; --j) {\n v = X[(i + 34) & 127];\n t = X[i = ((i + 1) & 127)];\n v ^= v << 13;\n t ^= t << 17;\n v ^= v >>> 15;\n t ^= t >>> 12;\n X[i] = v ^ t;\n }\n // Storing state as object members is faster than using closure variables.\n me.w = w;\n me.X = X;\n me.i = i;\n }\n\n init(me, seed);\n}\n\nfunction copy(f, t) {\n t.i = f.i;\n t.w = f.w;\n t.X = f.X.slice();\n return t;\n};\n\nfunction impl(seed, opts) {\n if (seed == null) seed = +(new Date);\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (state.X) copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.xor4096 = impl;\n}\n\n})(\n this, // window object or global\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n","// A Javascript implementaion of the \"Tyche-i\" prng algorithm by\n// Samuel Neves and Filipe Araujo.\n// See https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n\n(function(global, module, define) {\n\nfunction XorGen(seed) {\n var me = this, strseed = '';\n\n // Set up generator function.\n me.next = function() {\n var b = me.b, c = me.c, d = me.d, a = me.a;\n b = (b << 25) ^ (b >>> 7) ^ c;\n c = (c - d) | 0;\n d = (d << 24) ^ (d >>> 8) ^ a;\n a = (a - b) | 0;\n me.b = b = (b << 20) ^ (b >>> 12) ^ c;\n me.c = c = (c - d) | 0;\n me.d = (d << 16) ^ (c >>> 16) ^ a;\n return me.a = (a - b) | 0;\n };\n\n /* The following is non-inverted tyche, which has better internal\n * bit diffusion, but which is about 25% slower than tyche-i in JS.\n me.next = function() {\n var a = me.a, b = me.b, c = me.c, d = me.d;\n a = (me.a + me.b | 0) >>> 0;\n d = me.d ^ a; d = d << 16 ^ d >>> 16;\n c = me.c + d | 0;\n b = me.b ^ c; b = b << 12 ^ d >>> 20;\n me.a = a = a + b | 0;\n d = d ^ a; me.d = d = d << 8 ^ d >>> 24;\n me.c = c = c + d | 0;\n b = b ^ c;\n return me.b = (b << 7 ^ b >>> 25);\n }\n */\n\n me.a = 0;\n me.b = 0;\n me.c = 2654435769 | 0;\n me.d = 1367130551;\n\n if (seed === Math.floor(seed)) {\n // Integer seed.\n me.a = (seed / 0x100000000) | 0;\n me.b = seed | 0;\n } else {\n // String seed.\n strseed += seed;\n }\n\n // Mix in string seed, then discard an initial batch of 64 values.\n for (var k = 0; k < strseed.length + 20; k++) {\n me.b ^= strseed.charCodeAt(k) | 0;\n me.next();\n }\n}\n\nfunction copy(f, t) {\n t.a = f.a;\n t.b = f.b;\n t.c = f.c;\n t.d = f.d;\n return t;\n};\n\nfunction impl(seed, opts) {\n var xg = new XorGen(seed),\n state = opts && opts.state,\n prng = function() { return (xg.next() >>> 0) / 0x100000000; };\n prng.double = function() {\n do {\n var top = xg.next() >>> 11,\n bot = (xg.next() >>> 0) / 0x100000000,\n result = (top + bot) / (1 << 21);\n } while (result === 0);\n return result;\n };\n prng.int32 = xg.next;\n prng.quick = prng;\n if (state) {\n if (typeof(state) == 'object') copy(state, xg);\n prng.state = function() { return copy(xg, {}); }\n }\n return prng;\n}\n\nif (module && module.exports) {\n module.exports = impl;\n} else if (define && define.amd) {\n define(function() { return impl; });\n} else {\n this.tychei = impl;\n}\n\n})(\n this,\n (typeof module) == 'object' && module, // present in node.js\n (typeof define) == 'function' && define // present with an AMD loader\n);\n\n\n","/*\nCopyright 2014 David Bau.\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n*/\n\n(function (pool, math) {\n//\n// The following constants are related to IEEE 754 limits.\n//\nvar global = this,\n width = 256, // each RC4 output is 0 <= x < 256\n chunks = 6, // at least six RC4 outputs for each double\n digits = 52, // there are 52 significant digits in a double\n rngname = 'random', // rngname: name for Math.random and Math.seedrandom\n startdenom = math.pow(width, chunks),\n significance = math.pow(2, digits),\n overflow = significance * 2,\n mask = width - 1,\n nodecrypto; // node.js crypto module, initialized at the bottom.\n\n//\n// seedrandom()\n// This is the seedrandom function described above.\n//\nfunction seedrandom(seed, options, callback) {\n var key = [];\n options = (options == true) ? { entropy: true } : (options || {});\n\n // Flatten the seed string or build one from local entropy if needed.\n var shortseed = mixkey(flatten(\n options.entropy ? [seed, tostring(pool)] :\n (seed == null) ? autoseed() : seed, 3), key);\n\n // Use the seed to initialize an ARC4 generator.\n var arc4 = new ARC4(key);\n\n // This function returns a random double in [0, 1) that contains\n // randomness in every bit of the mantissa of the IEEE 754 value.\n var prng = function() {\n var n = arc4.g(chunks), // Start with a numerator n < 2 ^ 48\n d = startdenom, // and denominator d = 2 ^ 48.\n x = 0; // and no 'extra last byte'.\n while (n < significance) { // Fill up all significant digits by\n n = (n + x) * width; // shifting numerator and\n d *= width; // denominator and generating a\n x = arc4.g(1); // new least-significant-byte.\n }\n while (n >= overflow) { // To avoid rounding up, before adding\n n /= 2; // last byte, shift everything\n d /= 2; // right using integer math until\n x >>>= 1; // we have exactly the desired bits.\n }\n return (n + x) / d; // Form the number within [0, 1).\n };\n\n prng.int32 = function() { return arc4.g(4) | 0; }\n prng.quick = function() { return arc4.g(4) / 0x100000000; }\n prng.double = prng;\n\n // Mix the randomness into accumulated entropy.\n mixkey(tostring(arc4.S), pool);\n\n // Calling convention: what to return as a function of prng, seed, is_math.\n return (options.pass || callback ||\n function(prng, seed, is_math_call, state) {\n if (state) {\n // Load the arc4 state from the given state if it has an S array.\n if (state.S) { copy(state, arc4); }\n // Only provide the .state method if requested via options.state.\n prng.state = function() { return copy(arc4, {}); }\n }\n\n // If called as a method of Math (Math.seedrandom()), mutate\n // Math.random because that is how seedrandom.js has worked since v1.0.\n if (is_math_call) { math[rngname] = prng; return seed; }\n\n // Otherwise, it is a newer calling convention, so return the\n // prng directly.\n else return prng;\n })(\n prng,\n shortseed,\n 'global' in options ? options.global : (this == math),\n options.state);\n}\nmath['seed' + rngname] = seedrandom;\n\n//\n// ARC4\n//\n// An ARC4 implementation. The constructor takes a key in the form of\n// an array of at most (width) integers that should be 0 <= x < (width).\n//\n// The g(count) method returns a pseudorandom integer that concatenates\n// the next (count) outputs from ARC4. Its return value is a number x\n// that is in the range 0 <= x < (width ^ count).\n//\nfunction ARC4(key) {\n var t, keylen = key.length,\n me = this, i = 0, j = me.i = me.j = 0, s = me.S = [];\n\n // The empty key [] is treated as [0].\n if (!keylen) { key = [keylen++]; }\n\n // Set up S using the standard key scheduling algorithm.\n while (i < width) {\n s[i] = i++;\n }\n for (i = 0; i < width; i++) {\n s[i] = s[j = mask & (j + key[i % keylen] + (t = s[i]))];\n s[j] = t;\n }\n\n // The \"g\" method returns the next (count) outputs as one number.\n (me.g = function(count) {\n // Using instance members instead of closure state nearly doubles speed.\n var t, r = 0,\n i = me.i, j = me.j, s = me.S;\n while (count--) {\n t = s[i = mask & (i + 1)];\n r = r * width + s[mask & ((s[i] = s[j = mask & (j + t)]) + (s[j] = t))];\n }\n me.i = i; me.j = j;\n return r;\n // For robust unpredictability, the function call below automatically\n // discards an initial batch of values. This is called RC4-drop[256].\n // See http://google.com/search?q=rsa+fluhrer+response&btnI\n })(width);\n}\n\n//\n// copy()\n// Copies internal state of ARC4 to or from a plain object.\n//\nfunction copy(f, t) {\n t.i = f.i;\n t.j = f.j;\n t.S = f.S.slice();\n return t;\n};\n\n//\n// flatten()\n// Converts an object tree to nested arrays of strings.\n//\nfunction flatten(obj, depth) {\n var result = [], typ = (typeof obj), prop;\n if (depth && typ == 'object') {\n for (prop in obj) {\n try { result.push(flatten(obj[prop], depth - 1)); } catch (e) {}\n }\n }\n return (result.length ? result : typ == 'string' ? obj : obj + '\\0');\n}\n\n//\n// mixkey()\n// Mixes a string seed into a key that is an array of integers, and\n// returns a shortened string seed that is equivalent to the result key.\n//\nfunction mixkey(seed, key) {\n var stringseed = seed + '', smear, j = 0;\n while (j < stringseed.length) {\n key[mask & j] =\n mask & ((smear ^= key[mask & j] * 19) + stringseed.charCodeAt(j++));\n }\n return tostring(key);\n}\n\n//\n// autoseed()\n// Returns an object for autoseeding, using window.crypto and Node crypto\n// module if available.\n//\nfunction autoseed() {\n try {\n var out;\n if (nodecrypto && (out = nodecrypto.randomBytes)) {\n // The use of 'out' to remember randomBytes makes tight minified code.\n out = out(width);\n } else {\n out = new Uint8Array(width);\n (global.crypto || global.msCrypto).getRandomValues(out);\n }\n return tostring(out);\n } catch (e) {\n var browser = global.navigator,\n plugins = browser && browser.plugins;\n return [+new Date, global, plugins, global.screen, tostring(pool)];\n }\n}\n\n//\n// tostring()\n// Converts an array of charcodes to a string\n//\nfunction tostring(a) {\n return String.fromCharCode.apply(0, a);\n}\n\n//\n// When seedrandom.js is loaded, we immediately mix a few bits\n// from the built-in RNG into the entropy pool. Because we do\n// not want to interfere with deterministic PRNG state later,\n// seedrandom will not call math.random on its own again after\n// initialization.\n//\nmixkey(math.random(), pool);\n\n//\n// Nodejs and AMD support: export the implementation as a module using\n// either convention.\n//\nif ((typeof module) == 'object' && module.exports) {\n module.exports = seedrandom;\n // When in node.js, try using crypto package for autoseeding.\n try {\n nodecrypto = require('crypto');\n } catch (ex) {}\n} else if ((typeof define) == 'function' && define.amd) {\n define(function() { return seedrandom; });\n}\n\n// End anonymous scope, and pass initial values.\n})(\n [], // pool: entropy pool starts empty\n Math // math: package containing random, pow, and seedrandom\n);\n","// A library of seedable RNGs implemented in Javascript.\n//\n// Usage:\n//\n// var seedrandom = require('seedrandom');\n// var random = seedrandom(1); // or any seed.\n// var x = random(); // 0 <= x < 1. Every bit is random.\n// var x = random.quick(); // 0 <= x < 1. 32 bits of randomness.\n\n// alea, a 53-bit multiply-with-carry generator by Johannes Baagøe.\n// Period: ~2^116\n// Reported to pass all BigCrush tests.\nvar alea = require('./lib/alea');\n\n// xor128, a pure xor-shift generator by George Marsaglia.\n// Period: 2^128-1.\n// Reported to fail: MatrixRank and LinearComp.\nvar xor128 = require('./lib/xor128');\n\n// xorwow, George Marsaglia's 160-bit xor-shift combined plus weyl.\n// Period: 2^192-2^32\n// Reported to fail: CollisionOver, SimpPoker, and LinearComp.\nvar xorwow = require('./lib/xorwow');\n\n// xorshift7, by François Panneton and Pierre L'ecuyer, takes\n// a different approach: it adds robustness by allowing more shifts\n// than Marsaglia's original three. It is a 7-shift generator\n// with 256 bits, that passes BigCrush with no systmatic failures.\n// Period 2^256-1.\n// No systematic BigCrush failures reported.\nvar xorshift7 = require('./lib/xorshift7');\n\n// xor4096, by Richard Brent, is a 4096-bit xor-shift with a\n// very long period that also adds a Weyl generator. It also passes\n// BigCrush with no systematic failures. Its long period may\n// be useful if you have many generators and need to avoid\n// collisions.\n// Period: 2^4128-2^32.\n// No systematic BigCrush failures reported.\nvar xor4096 = require('./lib/xor4096');\n\n// Tyche-i, by Samuel Neves and Filipe Araujo, is a bit-shifting random\n// number generator derived from ChaCha, a modern stream cipher.\n// https://eden.dei.uc.pt/~sneves/pubs/2011-snfa2.pdf\n// Period: ~2^127\n// No systematic BigCrush failures reported.\nvar tychei = require('./lib/tychei');\n\n// The original ARC4-based prng included in this library.\n// Period: ~2^1600\nvar sr = require('./seedrandom');\n\nsr.alea = alea;\nsr.xor128 = xor128;\nsr.xorwow = xorwow;\nsr.xorshift7 = xorshift7;\nsr.xor4096 = xor4096;\nsr.tychei = tychei;\n\nmodule.exports = sr;\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\n\n// tslint:disable:no-any\n\n/**\n * A return value for a mapping function that can be applied via deepMap.\n *\n * If recurse is true, the value should be empty, and iteration will continue\n * into the object or array.\n */\nexport type DeepMapResult = {\n value: any,\n recurse: boolean\n};\n\n/**\n * Apply a mapping function to a nested structure in a recursive manner.\n *\n * The result of the mapping is an object with the same nested structure (i.e.,\n * of arrays and dicts) as the input, except that some subtrees are replaced,\n * according to the results of the mapping function.\n *\n * Mappings are memoized. Thus, if the nested structure contains the same\n * object in multiple positions, the output will contain the same mapped object\n * in those positions. Cycles are not supported, however.\n *\n * @param input: The object to which to apply the mapping function.\n * @param mapFn: A function that expects a single node of the object tree, and\n * returns a `DeepMapResult`. The `DeepMapResult` either provides a\n * replacement value for that node (i.e., replacing the subtree), or indicates\n * that the node should be processed recursively.\n */\nexport function deepMap(input: any, mapFn: (x: any) => DeepMapResult): any|\n any[] {\n return deepMapInternal(input, mapFn);\n}\n\n/**\n * @param seen: A Map of known object mappings (i.e., memoized results of\n * `mapFn()`)\n * @param containedIn: An set containing objects on the reference path currently\n * being processed (used to detect cycles).\n */\nfunction deepMapInternal(\n input: any, mapFn: (x: any) => DeepMapResult,\n seen: Map = new Map(), containedIn: Set<{}> = new Set()): any|\n any[] {\n if (input == null) {\n return null;\n }\n if (containedIn.has(input)) {\n throw new Error('Circular references are not supported.');\n }\n if (seen.has(input)) {\n return seen.get(input);\n }\n const result = mapFn(input);\n\n if (result.recurse && result.value !== null) {\n throw new Error(\n 'A deep map function may not return both a value and recurse=true.');\n }\n\n if (!result.recurse) {\n seen.set(input, result.value);\n return result.value;\n } else if (isIterable(input)) {\n // tslint:disable-next-line:no-any\n const mappedIterable: any|any[] = Array.isArray(input) ? [] : {};\n containedIn.add(input);\n for (const k in input) {\n const child = input[k];\n const childResult = deepMapInternal(child, mapFn, seen, containedIn);\n mappedIterable[k] = childResult;\n }\n containedIn.delete(input);\n return mappedIterable;\n } else {\n throw new Error(`Can't recurse into non-iterable type: ${input}`);\n }\n}\n\n// TODO(soergel, kangyizhang) Reconsider naming of deepZip() to avoid confusion\n// with zip()\n\n/**\n * Zip nested structures together in a recursive manner.\n *\n * This has the effect of transposing or pivoting data, e.g. converting it from\n * a row-major representation to a column-major representation.\n *\n * For example, `deepZip([{a: 1, b: 2}, {a: 3, b: 4}])` returns\n * `{a: [1, 3], b: [2, 4]}`.\n *\n * The inputs should all have the same nested structure (i.e., of arrays and\n * dicts). The result is a single object with the same nested structure, where\n * the leaves are arrays collecting the values of the inputs at that location\n * (or, optionally, the result of a custom function applied to those arrays).\n *\n * @param inputs: An array of the objects to zip together.\n * @param zipFn: (optional) A function that expects an array of elements at a\n * single node of the object tree, and returns a `DeepMapResult`. The\n * `DeepMapResult` either provides a result value for that node (i.e.,\n * representing the subtree), or indicates that the node should be processed\n * recursively. The default zipFn recurses as far as possible and places\n * arrays at the leaves.\n */\nexport function deepZip(\n inputs: any[], zipFn: (xs: any[]) => DeepMapResult = zipToList): any|any[] {\n return deepZipInternal(inputs, zipFn);\n}\n\n/**\n * @param containedIn: An set containing objects on the reference path currently\n * being processed (used to detect cycles).\n */\nfunction deepZipInternal(\n inputs: any[], zipFn: (xs: any[]) => DeepMapResult,\n containedIn: Set<{}> = new Set()): any|any[] {\n // The recursion follows the structure of input 0; it's assumed that all the\n // other inputs have the same structure.\n const input = inputs[0];\n if (containedIn.has(input)) {\n throw new Error('Circular references are not supported.');\n }\n const result = zipFn(inputs);\n\n if (result.recurse && result.value !== null) {\n throw new Error(\n 'A deep zip function may not return both a value and recurse=true.');\n }\n\n if (!result.recurse) {\n return result.value;\n } else if (isIterable(input)) {\n // tslint:disable-next-line:no-any\n const mappedIterable: any|any[] = Array.isArray(input) ? [] : {};\n containedIn.add(input);\n for (const k in input) {\n const children = inputs.map(x => x[k]);\n const childResult = deepZipInternal(children, zipFn, containedIn);\n mappedIterable[k] = childResult;\n }\n containedIn.delete(input);\n return mappedIterable;\n } else {\n throw new Error(`Can't recurse into non-iterable type: ${input}`);\n }\n}\n\n// tslint:disable-next-line:no-any\nexport function zipToList(x: any[]): DeepMapResult {\n if (x === null) {\n return null;\n }\n // TODO(soergel): validate array type?\n\n if (isIterable(x[0])) {\n return {value: null, recurse: true};\n } else {\n return {value: x, recurse: false};\n }\n}\n\n/**\n * A return value for an async map function for use with deepMapAndAwaitAll.\n *\n * If recurse is true, the value should be empty, and iteration will continue\n * into the object or array.\n */\nexport type DeepMapAsyncResult = {\n value: Promise,\n recurse: boolean\n};\n\n/**\n * Apply an async mapping function to a nested structure in a recursive manner.\n *\n * This first creates a nested structure of Promises, and then awaits all of\n * those, resulting in a single Promise for a resolved nested structure.\n *\n * The result of the mapping is an object with the same nested structure (i.e.,\n * of arrays and dicts) as the input, except that some subtrees are replaced,\n * according to the results of the mapping function.\n *\n * Mappings are memoized. Thus, if the nested structure contains the same\n * object in multiple positions, the output will contain the same mapped object\n * in those positions. Cycles are not supported, however.\n *\n * @param input: The object to which to apply the mapping function.\n * @param mapFn: A function that expects a single node of the object tree, and\n * returns a `DeepMapAsyncResult`. The `DeepMapAsyncResult` either provides\n * a `Promise` for a replacement value for that node (i.e., replacing the\n * subtree), or indicates that the node should be processed recursively. Note\n * that the decision whether or not to recurse must be made immediately; only\n * the mapped value may be promised.\n */\nexport async function deepMapAndAwaitAll(\n input: any, mapFn: (x: any) => DeepMapAsyncResult): Promise {\n const seen: Map> = new Map();\n\n // First do a normal deepMap, collecting Promises in 'seen' as a side effect.\n deepMapInternal(input, mapFn, seen);\n\n // Replace the Promises in 'seen' in place.\n // Note TypeScript provides no async map iteration, and regular map iteration\n // is broken too, so sadly we have to do Array.from() to make it work.\n // (There's no advantage to Promise.all(), and that would be tricky anyway.)\n for (const key of Array.from(seen.keys())) {\n const value = seen.get(key);\n if (tf.util.isPromise(value)) {\n const mappedValue = await value;\n seen.set(key, mappedValue);\n }\n }\n\n // Normal deepMap again, this time filling in the resolved values.\n // It's unfortunate that we have to do two passes.\n // TODO(soergel): test performance and think harder about a fast solution.\n const result = deepMapInternal(input, mapFn, seen);\n return result;\n}\n\n/**\n * Determine whether the argument is iterable.\n *\n * @returns true if the argument is an array or any non-Tensor object.\n */\n// tslint:disable-next-line:no-any\nexport function isIterable(obj: any): boolean {\n return obj != null && (!ArrayBuffer.isView(obj)) &&\n (Array.isArray(obj) ||\n (typeof obj === 'object' && !(obj instanceof tf.Tensor)));\n}\n\n/**\n * Determine whether the argument can be converted to Tensor.\n *\n * Tensors, primitives, arrays, and TypedArrays all qualify; anything else does\n * not.\n *\n * @returns true if the argument can be converted to Tensor.\n */\n// tslint:disable-next-line:no-any\nexport function canTensorify(obj: any): boolean {\n return obj == null || isPrimitive(obj) || Array.isArray(obj) ||\n (typeof obj === 'object' && (obj instanceof tf.Tensor)) ||\n tf.util.isTypedArray(obj);\n}\n\n/**\n * Returns true if the given `value` is a primitive type. Otherwise returns\n * false. This is equivalant to node util.isPrimitive\n */\nfunction isPrimitive(value: any): boolean {\n return (\n value === null ||\n (typeof value !== 'object' && typeof value !== 'function'));\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport {deepMap, DeepMapResult, isIterable} from './deep_map';\n\nexport function deepClone(container: T): T {\n return deepMap(container, cloneIfTensor);\n}\n\n// tslint:disable-next-line: no-any\nfunction cloneIfTensor(item: any): DeepMapResult {\n if (item instanceof tf.Tensor) {\n return ({value: item.clone(), recurse: false});\n } else if (isIterable(item)) {\n return {value: null, recurse: true};\n } else {\n return {value: item, recurse: false};\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\n/**\n * A ring buffer, providing O(1) FIFO, LIFO, and related operations.\n */\nexport class RingBuffer {\n // Note we store the indices in the range 0 <= index < 2*capacity.\n // This allows us to distinguish the full from the empty case.\n // See https://www.snellman.net/blog/archive/2016-12-13-ring-buffers/\n protected begin = 0; // inclusive\n protected end = 0; // exclusive\n protected doubledCapacity: number;\n\n protected data: T[];\n\n /**\n * Constructs a `RingBuffer`.\n * @param capacity The number of items that the buffer can accomodate.\n */\n constructor(public capacity: number) {\n if (capacity == null) {\n throw new RangeError('Can\\'t create a ring buffer of unknown capacity.');\n }\n if (capacity < 1) {\n throw new RangeError('Can\\'t create ring buffer of capacity < 1.');\n }\n this.data = new Array(capacity);\n this.doubledCapacity = 2 * capacity;\n }\n\n /**\n * Map any index into the range 0 <= index < 2*capacity.\n */\n protected wrap(index: number) {\n // don't trust % on negative numbers\n while (index < 0) {\n index += this.doubledCapacity;\n }\n return index % this.doubledCapacity;\n }\n\n protected get(index: number) {\n if (index < 0) {\n throw new RangeError('Can\\'t get item at a negative index.');\n }\n return this.data[index % this.capacity];\n }\n\n protected set(index: number, value: T) {\n if (index < 0) {\n throw new RangeError('Can\\'t set item at a negative index.');\n }\n this.data[index % this.capacity] = value;\n }\n\n /**\n * Returns the current number of items in the buffer.\n */\n length(): number {\n let length = this.end - this.begin;\n if (length < 0) {\n length = this.doubledCapacity + length;\n }\n return length;\n }\n\n /**\n * Reports whether the buffer is full.\n * @returns true if the number of items in the buffer equals its capacity, and\n * false otherwise.\n */\n isFull() {\n return this.length() === this.capacity;\n }\n\n /**\n * Reports whether the buffer is empty.\n * @returns true if the number of items in the buffer equals zero, and\n * false otherwise.\n */\n isEmpty() {\n return this.length() === 0;\n }\n\n /**\n * Adds an item to the end of the buffer.\n */\n push(value: T) {\n if (this.isFull()) {\n throw new RangeError('Ring buffer is full.');\n }\n this.set(this.end, value);\n this.end = this.wrap(this.end + 1);\n }\n\n /**\n * Adds many items to the end of the buffer, in order.\n */\n pushAll(values: T[]) {\n for (const value of values) {\n this.push(value);\n }\n }\n\n /**\n * Removes and returns the last item in the buffer.\n */\n pop(): T {\n if (this.isEmpty()) {\n throw new RangeError('Ring buffer is empty.');\n }\n this.end = this.wrap(this.end - 1);\n const result = this.get(this.end);\n this.set(this.end, undefined);\n return result;\n }\n\n /**\n * Adds an item to the beginning of the buffer.\n */\n unshift(value: T) {\n if (this.isFull()) {\n throw new RangeError('Ring buffer is full.');\n }\n this.begin = this.wrap(this.begin - 1);\n this.set(this.begin, value);\n }\n\n /**\n * Removes and returns the first item in the buffer.\n */\n shift(): T {\n if (this.isEmpty()) {\n throw new RangeError('Ring buffer is empty.');\n }\n const result = this.get(this.begin);\n this.set(this.begin, undefined);\n this.begin = this.wrap(this.begin + 1);\n return result;\n }\n\n /**\n * Removes and returns a specific item in the buffer, and moves the last item\n * to the vacated slot. This is useful for implementing a shuffling stream.\n * Note that this operation necessarily scrambles the original order.\n *\n * @param relativeIndex: the index of the item to remove, relative to the\n * first item in the buffer (e.g., hiding the ring nature of the underlying\n * storage).\n */\n shuffleExcise(relativeIndex: number): T {\n if (this.isEmpty()) {\n throw new RangeError('Ring buffer is empty.');\n }\n const index = this.wrap(this.begin + relativeIndex);\n const result = this.get(index);\n this.set(index, this.pop());\n return result;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {RingBuffer} from './ring_buffer';\n\nexport class GrowingRingBuffer extends RingBuffer {\n private static INITIAL_CAPACITY = 32;\n\n /**\n * Constructs a `GrowingRingBuffer`.\n */\n constructor() {\n super(GrowingRingBuffer.INITIAL_CAPACITY);\n }\n\n isFull() {\n return false;\n }\n\n push(value: T) {\n if (super.isFull()) {\n this.expand();\n }\n super.push(value);\n }\n\n unshift(value: T) {\n if (super.isFull()) {\n this.expand();\n }\n super.unshift(value);\n }\n\n /**\n * Doubles the capacity of the buffer.\n */\n private expand() {\n const newCapacity = this.capacity * 2;\n const newData = new Array(newCapacity);\n const len = this.length();\n\n // Rotate the buffer to start at index 0 again, since we can't just\n // allocate more space at the end.\n for (let i = 0; i < len; i++) {\n newData[i] = this.get(this.wrap(this.begin + i));\n }\n\n this.data = newData;\n this.capacity = newCapacity;\n this.doubledCapacity = 2 * this.capacity;\n this.begin = 0;\n this.end = len;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport * as seedrandom from 'seedrandom';\n\nimport {Container} from '../types';\nimport {deepClone} from '../util/deep_clone';\nimport {deepMapAndAwaitAll, DeepMapAsyncResult, DeepMapResult, deepZip, zipToList} from '../util/deep_map';\nimport {GrowingRingBuffer} from '../util/growing_ring_buffer';\nimport {RingBuffer} from '../util/ring_buffer';\n\n/**\n * A nested structure of LazyIterators, used as the input to zip().\n */\nexport type IteratorContainer = Container>;\n\n// Here we implement a simple asynchronous iterator.\n// This lets us avoid using either third-party stream libraries or\n// recent TypeScript language support requiring polyfills.\n\n/**\n * Create a `LazyIterator` from an array of items.\n */\nexport function iteratorFromItems(items: T[]): LazyIterator {\n return new ArrayIterator(items);\n}\n\n/**\n * Create a `LazyIterator` of incrementing integers.\n */\nexport function iteratorFromIncrementing(start: number): LazyIterator {\n let i = start;\n return iteratorFromFunction(() => ({value: i++, done: false}));\n}\n\n/**\n * Create a `LazyIterator` from a function.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const iter = tf.data.iteratorFromFunction(func);\n * await iter.forEachAsync(e => console.log(e));\n * ```\n *\n * @param func A function that produces data on each call.\n */\nexport function iteratorFromFunction(\n func: () =>\n IteratorResult| Promise>): LazyIterator {\n return new FunctionCallIterator(func);\n}\n\n/**\n * Create a `LazyIterator` by concatenating underlying streams, which are\n * themselves provided as a stream.\n *\n * This can also be thought of as a \"stream flatten\" operation.\n *\n * @param baseIterators A stream of streams to be concatenated.\n * @param baseErrorHandler An optional function that can intercept `Error`s\n * raised during a `next()` call on the base stream. This function can decide\n * whether the error should be propagated, whether the error should be\n * ignored, or whether the base stream should be terminated.\n */\nexport function iteratorFromConcatenated(\n baseIterators: LazyIterator>,\n baseErrorHandler?: (e: Error) => boolean): LazyIterator {\n return new ChainedIterator(baseIterators, baseErrorHandler);\n}\n\n/**\n * Create a `LazyIterator` by concatenating streams produced by calling a\n * stream-generating function a given number of times.\n *\n * Since a `LazyIterator` is read-once, it cannot be repeated, but this\n * function can be used to achieve a similar effect:\n *\n * LazyIterator.ofConcatenatedFunction(() => new MyIterator(), 6);\n *\n * @param iteratorFunc: A function that produces a new stream on each call.\n * @param count: The number of times to call the function.\n * @param baseErrorHandler An optional function that can intercept `Error`s\n * raised during a `next()` call on the base stream. This function can decide\n * whether the error should be propagated, whether the error should be\n * ignored, or whether the base stream should be terminated.\n */\nexport function iteratorFromConcatenatedFunction(\n iteratorFunc: () => IteratorResult>, count: number,\n baseErrorHandler?: (e: Error) => boolean): LazyIterator {\n return iteratorFromConcatenated(\n iteratorFromFunction(iteratorFunc).take(count), baseErrorHandler);\n}\n\n/**\n * Create a `LazyIterator` by zipping together an array, dict, or nested\n * structure of `LazyIterator`s (and perhaps additional constants).\n *\n * The underlying streams must provide elements in a consistent order such\n * that they correspond.\n *\n * Typically, the underlying streams should have the same number of\n * elements. If they do not, the behavior is determined by the\n * `mismatchMode` argument.\n *\n * The nested structure of the `iterators` argument determines the\n * structure of elements in the resulting iterator.\n *\n * @param iterators: An array or object containing LazyIterators at the\n * leaves.\n * @param mismatchMode: Determines what to do when one underlying iterator\n * is exhausted before the others. `ZipMismatchMode.FAIL` (the default)\n * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST`\n * causes the zipped iterator to terminate with the furst underlying\n * streams, so elements remaining on the longer streams are ignored.\n * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling\n * in nulls for the exhausted streams, until all streams are exhausted.\n */\nexport function iteratorFromZipped(\n iterators: IteratorContainer,\n mismatchMode: ZipMismatchMode = ZipMismatchMode.FAIL): LazyIterator {\n return new ZipIterator(iterators, mismatchMode);\n}\n\n/**\n * An asynchronous iterator, providing lazy access to a potentially\n * unbounded stream of elements.\n *\n * Iterator can be obtained from a dataset:\n * `const iter = await dataset.iterator();`\n */\nexport abstract class LazyIterator {\n // This class implements AsyncIterator, but we have not yet set the\n // TypeScript --downlevelIteration flag to enable that.\n\n abstract summary(): string;\n\n /**\n * Returns a `Promise` for the next element in the stream.\n *\n * When an item can be provided successfully, the return value is\n * `{value:T, done:false}`.\n *\n * Calling next() on a closed stream returns `{value:null, done:true}`.\n */\n abstract async next(): Promise>;\n\n /**\n * Collect all remaining elements of a bounded stream into an array.\n * Obviously this will succeed only for small streams that fit in memory.\n * Useful for testing.\n *\n * @returns A Promise for an array of stream elements, which will resolve\n * when the stream is exhausted.\n */\n async toArray(): Promise {\n const result: T[] = [];\n let x = await this.next();\n while (!x.done) {\n result.push(x.value);\n x = await this.next();\n }\n return result;\n }\n\n /**\n * Collect all elements of this dataset into an array with prefetching 100\n * elements. This is useful for testing, because the prefetch changes the\n * order in which the Promises are resolved along the processing pipeline.\n * This may help expose bugs where results are dependent on the order of\n * Promise resolution rather than on the logical order of the stream (i.e.,\n * due to hidden mutable state).\n *\n * @returns A Promise for an array of stream elements, which will resolve\n * when the stream is exhausted.\n */\n async toArrayForTest(): Promise {\n const stream = this.prefetch(100);\n const result: T[] = [];\n let x = await stream.next();\n while (!x.done) {\n result.push(x.value);\n x = await stream.next();\n }\n return result;\n }\n\n /**\n * Draw items from the stream until it is exhausted.\n *\n * This can be useful when the stream has side effects but no output. In\n * that case, calling this function guarantees that the stream will be\n * fully processed.\n */\n async resolveFully(): Promise {\n let x = await this.next();\n while (!x.done) {\n x = await this.next();\n }\n }\n\n /**\n * Draw items from the stream until it is exhausted, or a predicate fails.\n *\n * This can be useful when the stream has side effects but no output. In\n * that case, calling this function guarantees that the stream will be\n * fully processed.\n */\n async resolveWhile(predicate: (r: T) => boolean): Promise {\n let x = await this.next();\n let shouldContinue = predicate(x.value);\n while ((!x.done) && shouldContinue) {\n x = await this.next();\n shouldContinue = predicate(x.value);\n }\n }\n\n /**\n * Handles errors thrown on this stream using a provided handler function.\n *\n * @param handler A function that handles any `Error` thrown during a `next()`\n * call and returns true if the stream should continue (dropping the failed\n * call) or false if the stream should quietly terminate. If the handler\n * itself throws (or rethrows) an `Error`, that will be propagated.\n *\n * @returns A `LazyIterator` of elements passed through from upstream,\n * possibly filtering or terminating on upstream `next()` calls that\n * throw an `Error`.\n */\n handleErrors(handler: (error: Error) => boolean): LazyIterator {\n return new ErrorHandlingLazyIterator(this, handler);\n }\n\n // TODO(soergel): Implement reduce() etc.\n\n /**\n * Filters this stream according to `predicate`.\n *\n * @param predicate A function mapping a stream element to a boolean or a\n * `Promise` for one.\n *\n * @returns A `LazyIterator` of elements for which the predicate was true.\n */\n filter(predicate: (value: T) => boolean): LazyIterator {\n return new FilterIterator(this, predicate);\n }\n\n /**\n * Maps this stream through a 1-to-1 transform.\n *\n * @param transform A function mapping a stream element to a transformed\n * element.\n *\n * @returns A `LazyIterator` of transformed elements.\n */\n map(transform: (value: T) => O): LazyIterator {\n return new MapIterator(this, transform);\n }\n\n /**\n * Maps this stream through an async 1-to-1 transform.\n *\n * @param transform A function mapping a stream element to a `Promise` for a\n * transformed stream element.\n *\n * @returns A `LazyIterator` of transformed elements.\n */\n mapAsync(transform: (value: T) => Promise): LazyIterator {\n return new AsyncMapIterator(this, transform);\n }\n\n /**\n * Maps this stream through a 1-to-1 transform, forcing serial execution.\n *\n * @param transform A function mapping a stream element to a transformed\n * element.\n *\n * @returns A `LazyIterator` of transformed elements.\n */\n serialMapAsync(transform: (value: T) => Promise): LazyIterator {\n return new AsyncMapIterator(this, transform).serial();\n }\n\n /**\n * Maps this stream through a 1-to-many transform.\n *\n * @param transform A function mapping a stream element to an array of\n * transformed elements.\n *\n * @returns A `DataStream` of transformed elements.\n */\n flatmap(transform: (value: T) => O[]): LazyIterator {\n return new FlatmapIterator(this, transform);\n }\n\n /**\n * Apply a function to every element of the stream.\n *\n * @param f A function to apply to each stream element.\n */\n async forEachAsync(f: (value: T) => void): Promise {\n return this.map(f).resolveFully();\n }\n\n /**\n * Apply a function to every element of the stream, forcing serial execution.\n *\n * @param f A function to apply to each stream element. Should return 'true'\n * to indicate that the stream should continue, or 'false' to cause it to\n * terminate.\n */\n async serialForEach(f: (value: T) => Promise): Promise {\n return this.serialMapAsync(f).resolveWhile(x => (x === true));\n }\n\n /**\n * Groups elements into batches, represented as arrays of elements.\n *\n * We can think of the elements of this iterator as 'rows' (even if they are\n * nested structures). By the same token, consecutive values for a given\n * key within the elements form a 'column'. This matches the usual sense of\n * 'row' and 'column' when processing tabular data (e.g., parsing a CSV).\n *\n * Thus, \"Row-major\" means that the resulting batch is simply a collection of\n * rows: `[row1, row2, row3, ...]`. This is contrast to the column-major\n * form, which is needed for vectorized computation.\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @returns A `LazyIterator` of batches of elements, represented as arrays\n * of the original element type.\n */\n rowMajorBatch(batchSize: number, smallLastBatch = true): LazyIterator {\n return new RowMajorBatchIterator(this, batchSize, smallLastBatch);\n }\n\n /**\n * Groups elements into batches, represented in column-major form.\n *\n * We can think of the elements of this iterator as 'rows' (even if they are\n * nested structures). By the same token, consecutive values for a given\n * key within the elements form a 'column'. This matches the usual sense of\n * 'row' and 'column' when processing tabular data (e.g., parsing a CSV).\n *\n * Thus, \"column-major\" means that the resulting batch is a (potentially\n * nested) structure representing the columns. Each column entry, then,\n * contains a collection of the values found in that column for a range of\n * input elements. This representation allows for vectorized computation, in\n * contrast to the row-major form.\n *\n * The inputs should all have the same nested structure (i.e., of arrays and\n * dicts). The result is a single object with the same nested structure,\n * where the leaves are arrays collecting the values of the inputs at that\n * location (or, optionally, the result of a custom function applied to those\n * arrays).\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @param zipFn: (optional) A function that expects an array of elements at a\n * single node of the object tree, and returns a `DeepMapResult`. The\n * `DeepMapResult` either provides a result value for that node (i.e.,\n * representing the subtree), or indicates that the node should be processed\n * recursively. The default zipFn recurses as far as possible and places\n * arrays at the leaves.\n * @returns A `LazyIterator` of batches of elements, represented as an object\n * with collections at the leaves.\n */\n columnMajorBatch(\n batchSize: number, smallLastBatch = true,\n // tslint:disable-next-line:no-any\n zipFn: (xs: any[]) => DeepMapResult = zipToList):\n LazyIterator {\n // First collect the desired number of input elements as a row-major batch.\n const rowBatches = this.rowMajorBatch(batchSize, smallLastBatch);\n // Now 'rotate' or 'pivot' the data, collecting all values from each column\n // in the batch (i.e., for each key within the elements) into an array.\n return rowBatches.map(x => deepZip(x, zipFn));\n }\n\n /**\n * Concatenate this `LazyIterator` with another.\n *\n * @param iterator A `LazyIterator` to be concatenated onto this one.\n * @param baseErrorHandler An optional function that can intercept `Error`s\n * raised during a `next()` call on the base stream. This function can\n * decide whether the error should be propagated, whether the error should\n * be ignored, or whether the base stream should be terminated.\n * @returns A `LazyIterator`.\n */\n concatenate(\n iterator: LazyIterator,\n baseErrorHandler?: (e: Error) => boolean): LazyIterator {\n return new ChainedIterator(\n iteratorFromItems([this, iterator]), baseErrorHandler);\n }\n\n /**\n * Limits this stream to return at most `count` items.\n *\n * @param count The maximum number of items to provide from the stream. If\n * a negative or undefined value is given, the entire stream is returned\n * unaltered.\n */\n take(count: number): LazyIterator {\n if (count < 0 || count == null) {\n return this;\n }\n return new TakeIterator(this, count);\n }\n\n /**\n * Skips the first `count` items in this stream.\n *\n * @param count The number of items to skip. If a negative or undefined\n * value is given, the entire stream is returned unaltered.\n */\n skip(count: number): LazyIterator {\n if (count < 0 || count == null) {\n return this;\n }\n return new SkipIterator(this, count);\n }\n\n /**\n * Prefetch the first `bufferSize` items in this stream.\n *\n * Note this prefetches Promises, but makes no guarantees about when those\n * Promises resolve.\n *\n * @param bufferSize: An integer specifying the number of elements to be\n * prefetched.\n */\n prefetch(bufferSize: number): LazyIterator {\n return new PrefetchIterator(this, bufferSize);\n }\n\n // TODO(soergel): deep sharded shuffle, where supported\n\n /**\n * Randomly shuffles the elements of this stream.\n *\n * @param bufferSize: An integer specifying the number of elements from\n * this stream from which the new stream will sample.\n * @param seed: (Optional.) An integer specifying the random seed that\n * will be used to create the distribution.\n */\n shuffle(windowSize: number, seed?: string): LazyIterator {\n return new ShuffleIterator(this, windowSize, seed);\n }\n\n /**\n * Force an iterator to execute serially: each next() call will await the\n * prior one, so that they cannot execute concurrently.\n */\n serial(): LazyIterator {\n return new SerialIterator(this);\n }\n}\n\n// ============================================================================\n// The following private classes serve to implement the chainable methods\n// on LazyIterator. Unfortunately they can't be placed in separate files,\n// due to resulting trouble with circular imports.\n// ============================================================================\n\n// Iterators that just extend LazyIterator directly\n// ============================================================================\n\nclass ArrayIterator extends LazyIterator {\n private trav = 0;\n constructor(protected items: T[]) {\n super();\n }\n\n summary() {\n return `Array of ${this.items.length} items`;\n }\n\n async next(): Promise> {\n if (this.trav >= this.items.length) {\n return {value: null, done: true};\n }\n const item = this.items[this.trav];\n this.trav++;\n return {value: deepClone(item), done: false};\n }\n}\n\nclass FunctionCallIterator extends LazyIterator {\n constructor(\n protected nextFn: () => IteratorResult| Promise>) {\n super();\n }\n\n summary() {\n return `Function call`;\n }\n\n async next(): Promise> {\n try {\n return this.nextFn();\n } catch (e) {\n // Modify the error message but leave the stack trace intact\n e.message =\n `Error thrown while iterating through a dataset: ${e.message}`;\n throw e;\n }\n }\n}\n\nclass SerialIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n constructor(protected upstream: LazyIterator) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> Serial`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n return this.upstream.next();\n }\n}\n\nclass SkipIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n // Local state that should not be clobbered by out-of-order execution.\n count = 0;\n\n constructor(protected upstream: LazyIterator, protected maxCount: number) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> Skip`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n // TODO(soergel): consider tradeoffs of reading in parallel, eg.\n // collecting next() promises in an Array and then waiting for\n // Promise.all() of those. Benefit: pseudo-parallel execution. Drawback:\n // maybe delayed GC.\n while (this.count++ < this.maxCount) {\n const skipped = await this.upstream.next();\n // short-circuit if upstream is already empty\n if (skipped.done) {\n return skipped;\n }\n tf.dispose(skipped.value as {});\n }\n return this.upstream.next();\n }\n}\n\nclass TakeIterator extends LazyIterator {\n count = 0;\n constructor(protected upstream: LazyIterator, protected maxCount: number) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Take`;\n }\n\n async next(): Promise> {\n if (this.count++ >= this.maxCount) {\n return {value: null, done: true};\n }\n return this.upstream.next();\n }\n}\n\n// Note this batch just groups items into row-wise element arrays.\n// Rotating these to a column-wise representation happens only at the dataset\n// level.\nclass RowMajorBatchIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n constructor(\n protected upstream: LazyIterator, protected batchSize: number,\n protected enableSmallLastBatch = true) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> RowMajorBatch`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n const batch: T[] = [];\n while (batch.length < this.batchSize) {\n const item = await this.upstream.next();\n if (item.done) {\n if (this.enableSmallLastBatch && batch.length > 0) {\n return {value: batch, done: false};\n }\n return {value: null, done: true};\n }\n batch.push(item.value);\n }\n return {value: batch, done: false};\n }\n}\n\nclass FilterIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n constructor(\n protected upstream: LazyIterator,\n protected predicate: (value: T) => boolean) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> Filter`;\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private async serialNext(): Promise> {\n while (true) {\n const item = await this.upstream.next();\n if (item.done || this.predicate(item.value)) {\n return item;\n }\n tf.dispose(item.value as {});\n }\n }\n}\n\nclass MapIterator extends LazyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected transform: (value: I) => O) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Map`;\n }\n\n async next(): Promise> {\n const item = await this.upstream.next();\n if (item.done) {\n return {value: null, done: true};\n }\n const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {});\n // Careful: the transform may mutate the item in place.\n // That's why we have to remember the input Tensors above, and then\n // below dispose only those that were not passed through to the output.\n // Note too that the transform function is responsible for tidying\n // any intermediate Tensors. Here we are concerned only about the\n // inputs.\n const mapped = this.transform(item.value);\n const outputTensors = tf.tensor_util.getTensorsInContainer(mapped as {});\n\n // TODO(soergel) faster intersection\n // TODO(soergel) move to tf.disposeExcept(in, out)?\n for (const t of inputTensors) {\n if (!tf.tensor_util.isTensorInList(t, outputTensors)) {\n t.dispose();\n }\n }\n return {value: mapped, done: false};\n }\n}\n\nclass ErrorHandlingLazyIterator extends LazyIterator {\n count = 0;\n constructor(\n protected upstream: LazyIterator,\n protected handler: (error: Error) => boolean) {\n super();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n summary() {\n return `${this.upstream.summary()} -> handleErrors`;\n }\n\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n async serialNext(): Promise> {\n while (true) {\n try {\n return await this.upstream.next();\n } catch (e) {\n if (!this.handler(e)) {\n return {value: null, done: true};\n }\n // If the handler returns true, loop and fetch the next upstream item.\n\n // If the upstream iterator throws an endless stream of errors, and if\n // the handler says to ignore them, then we loop forever here. That is\n // the correct behavior-- it's up to the handler to decide when to stop.\n }\n }\n }\n}\n\nclass AsyncMapIterator extends LazyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected transform: (value: I) => Promise) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> AsyncMap`;\n }\n\n async next(): Promise> {\n const item = await this.upstream.next();\n if (item.done) {\n return {value: null, done: true};\n }\n const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {});\n // Careful: the transform may mutate the item in place.\n // That's why we have to remember the input Tensors above, and then\n // below dispose only those that were not passed through to the output.\n // Note too that the transform function is responsible for tidying\n // any intermediate Tensors. Here we are concerned only about the\n // inputs.\n const mapped = await this.transform(item.value);\n const outputTensors = tf.tensor_util.getTensorsInContainer(mapped as {});\n\n // TODO(soergel) faster intersection\n // TODO(soergel) move to tf.disposeExcept(in, out)?\n for (const t of inputTensors) {\n if (!tf.tensor_util.isTensorInList(t, outputTensors)) {\n t.dispose();\n }\n }\n return {value: mapped, done: false};\n }\n}\n\n// Iterators that maintain a queue of pending items\n// ============================================================================\n\n/**\n * A base class for transforming streams that operate by maintaining an\n * output queue of elements that are ready to return via next(). This is\n * commonly required when the transformation is 1-to-many: A call to next()\n * may trigger a call to the underlying stream, which will produce many\n * mapped elements of this stream-- of which we need to return only one, so\n * we have to queue the rest.\n */\nexport abstract class OneToManyIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n // Local state that should not be clobbered by out-of-order execution.\n protected outputQueue: RingBuffer;\n\n constructor() {\n super();\n this.outputQueue = new GrowingRingBuffer();\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n /**\n * Read one or more chunks from upstream and process them, possibly\n * reading or writing a carryover, and adding processed items to the\n * output queue. Note it's possible that no items are added to the queue\n * on a given pump() call, even if the upstream stream is not closed\n * (e.g., because items are filtered).\n *\n * @return `true` if any action was taken, i.e. fetching items from the\n * upstream source OR adding items to the output queue. `false` if the\n * upstream source is exhausted AND nothing was added to the queue\n * (i.e., any remaining carryover).\n */\n protected abstract async pump(): Promise;\n\n async serialNext(): Promise> {\n // Fetch so that the queue contains at least one item if possible.\n // If the upstream source is exhausted, AND there are no items left in\n // the output queue, then this stream is also exhausted.\n while (this.outputQueue.length() === 0) {\n // TODO(soergel): consider parallel reads.\n if (!await this.pump()) {\n return {value: null, done: true};\n }\n }\n return {value: this.outputQueue.shift(), done: false};\n }\n}\nclass FlatmapIterator extends OneToManyIterator {\n constructor(\n protected upstream: LazyIterator,\n protected transform: (value: I) => O[]) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Flatmap`;\n }\n\n async pump(): Promise {\n const item = await this.upstream.next();\n if (item.done) {\n return false;\n }\n const inputTensors = tf.tensor_util.getTensorsInContainer(item.value as {});\n // Careful: the transform may mutate the item in place.\n // that's why we have to remember the input Tensors above, and then\n // below dispose only those that were not passed through to the output.\n // Note too that the transform function is responsible for tidying any\n // intermediate Tensors. Here we are concerned only about the inputs.\n const mappedArray = this.transform(item.value);\n const outputTensors =\n tf.tensor_util.getTensorsInContainer(mappedArray as {});\n this.outputQueue.pushAll(mappedArray);\n\n // TODO(soergel) faster intersection, and deduplicate outputTensors\n // TODO(soergel) move to tf.disposeExcept(in, out)?\n for (const t of inputTensors) {\n if (!tf.tensor_util.isTensorInList(t, outputTensors)) {\n t.dispose();\n }\n }\n\n return true;\n }\n}\n\n/**\n * Provides a `LazyIterator` that concatenates a stream of underlying\n * streams.\n *\n * Doing this in a concurrency-safe way requires some trickery. In\n * particular, we want this stream to return the elements from the\n * underlying streams in the correct order according to when next() was\n * called, even if the resulting Promises resolve in a different order.\n */\nexport class ChainedIterator extends LazyIterator {\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise> = null;\n\n // Local state that should not be clobbered by out-of-order execution.\n private iterator: LazyIterator = null;\n private moreIterators: LazyIterator>;\n\n constructor(\n iterators: LazyIterator>,\n private readonly baseErrorHandler?: (e: Error) => boolean) {\n super();\n this.moreIterators = iterators;\n }\n\n summary() {\n const upstreamSummaries = 'TODO: fill in upstream of chained summaries';\n return `${upstreamSummaries} -> Chained`;\n }\n\n async next(): Promise> {\n this.lastRead = this.readFromChain(this.lastRead);\n return this.lastRead;\n }\n\n private async readFromChain(lastRead: Promise>):\n Promise> {\n // Must await on the previous read since the previous read may have advanced\n // the stream of streams, from which we need to read.\n // This is unfortunate since we can't parallelize reads. Which means\n // prefetching of chained streams is a no-op.\n // One solution is to prefetch immediately upstream of this.\n await lastRead;\n if (this.iterator == null) {\n const iteratorResult = await this.moreIterators.next();\n if (iteratorResult.done) {\n // No more streams to stream from.\n return {value: null, done: true};\n }\n this.iterator = iteratorResult.value;\n if (this.baseErrorHandler != null) {\n this.iterator = this.iterator.handleErrors(this.baseErrorHandler);\n }\n }\n const itemResult = await this.iterator.next();\n if (itemResult.done) {\n this.iterator = null;\n return this.readFromChain(lastRead);\n }\n return itemResult;\n }\n}\n\nexport enum ZipMismatchMode {\n FAIL, // require zipped streams to have the same length\n SHORTEST, // terminate zip when the first stream is exhausted\n LONGEST // use nulls for exhausted streams; use up the longest stream.\n}\n\n/**\n * Provides a `LazyIterator` that zips together an array, dict, or nested\n * structure of `LazyIterator`s (and perhaps additional constants).\n *\n * The underlying streams must provide elements in a consistent order such\n * that they correspond.\n *\n * Typically, the underlying streams should have the same number of\n * elements. If they do not, the behavior is determined by the\n * `mismatchMode` argument.\n *\n * The nested structure of the `iterators` argument determines the\n * structure of elements in the resulting iterator.\n *\n * Doing this in a concurrency-safe way requires some trickery. In\n * particular, we want this stream to return the elements from the\n * underlying streams in the correct order according to when next() was\n * called, even if the resulting Promises resolve in a different order.\n *\n * @param iterators: An array or object containing LazyIterators at the\n * leaves.\n * @param mismatchMode: Determines what to do when one underlying iterator\n * is exhausted before the others. `ZipMismatchMode.FAIL` (the default)\n * causes an error to be thrown in this case. `ZipMismatchMode.SHORTEST`\n * causes the zipped iterator to terminate with the furst underlying\n * streams, so elements remaining on the longer streams are ignored.\n * `ZipMismatchMode.LONGEST` causes the zipped stream to continue, filling\n * in nulls for the exhausted streams, until all streams are exhausted.\n */\nclass ZipIterator extends LazyIterator {\n private count = 0;\n private currentPromise: Promise> = null;\n\n constructor(\n protected readonly iterators: IteratorContainer,\n protected readonly mismatchMode: ZipMismatchMode = ZipMismatchMode.FAIL) {\n super();\n }\n\n summary() {\n const upstreamSummaries = 'TODO: fill in upstream of zip summaries';\n return `{${upstreamSummaries}} -> Zip`;\n }\n\n private async nextState(afterState: Promise>):\n Promise> {\n // This chaining ensures that the underlying next() are not even called\n // before the previous ones have resolved.\n await afterState;\n\n // Collect underlying iterator \"done\" signals as a side effect in\n // getNext()\n let numIterators = 0;\n let iteratorsDone = 0;\n\n function getNext(container: IteratorContainer): DeepMapAsyncResult {\n if (container instanceof LazyIterator) {\n const result = container.next();\n return {\n value: result.then(x => {\n numIterators++;\n if (x.done) {\n iteratorsDone++;\n }\n return x.value;\n }),\n recurse: false\n };\n } else {\n return {value: null, recurse: true};\n }\n }\n\n const mapped: O = await deepMapAndAwaitAll(this.iterators, getNext);\n\n if (numIterators === iteratorsDone) {\n // The streams have all ended.\n return {value: null, done: true};\n }\n if (iteratorsDone > 0) {\n switch (this.mismatchMode) {\n case ZipMismatchMode.FAIL:\n throw new Error(\n 'Zipped streams should have the same length. ' +\n `Mismatched at element ${this.count}.`);\n case ZipMismatchMode.SHORTEST:\n return {value: null, done: true};\n case ZipMismatchMode.LONGEST:\n default:\n // Continue. The exhausted streams already produced value: null.\n }\n }\n\n this.count++;\n return {value: mapped, done: false};\n }\n\n async next(): Promise> {\n this.currentPromise = this.nextState(this.currentPromise);\n return this.currentPromise;\n }\n}\n\n// Iterators that maintain a ring buffer of pending promises\n// ============================================================================\n\n/**\n * A stream that prefetches a given number of items from an upstream source,\n * returning them in FIFO order.\n *\n * Note this prefetches Promises, but makes no guarantees about when those\n * Promises resolve.\n */\nexport class PrefetchIterator extends LazyIterator {\n protected buffer: RingBuffer>>;\n\n constructor(\n protected upstream: LazyIterator, protected bufferSize: number) {\n super();\n this.buffer = new RingBuffer>>(bufferSize);\n }\n\n summary() {\n return `${this.upstream.summary()} -> Prefetch`;\n }\n\n /**\n * Refill the prefetch buffer. Returns only after the buffer is full, or\n * the upstream source is exhausted.\n */\n protected refill() {\n while (!this.buffer.isFull()) {\n const v = this.upstream.next();\n this.buffer.push(v);\n }\n }\n\n next(): Promise> {\n this.refill();\n // This shift will never throw an error because the buffer is always\n // full after a refill. If the stream is exhausted, the buffer will be\n // full of Promises that will resolve to the end-of-stream signal.\n return this.buffer.shift();\n }\n}\n\n/**\n * A stream that performs a sliding-window random shuffle on an upstream\n * source. This is like a `PrefetchIterator` except that the items are\n * returned in randomized order. Mixing naturally improves as the buffer\n * size increases.\n */\nexport class ShuffleIterator extends PrefetchIterator {\n private readonly random: seedrandom.prng;\n\n // Strict Promise execution order:\n // a next() call may not even begin until the previous one completes.\n private lastRead: Promise>;\n\n // Local state that should not be clobbered by out-of-order execution.\n private upstreamExhausted = false;\n\n constructor(\n protected upstream: LazyIterator, protected windowSize: number,\n seed?: string) {\n super(upstream, windowSize);\n this.random = seedrandom.alea(seed || tf.util.now().toString());\n this.lastRead = Promise.resolve({value: null, done: false});\n }\n\n async next(): Promise> {\n // This sets this.lastRead to a new Promise right away, as opposed to\n // saying `await this.lastRead; this.lastRead = this.serialNext();` which\n // would not work because this.nextRead would be updated only after the\n // promise resolves.\n this.lastRead = this.lastRead.then(() => this.serialNext());\n return this.lastRead;\n }\n\n private randomInt(max: number) {\n return Math.floor(this.random() * max);\n }\n\n protected chooseIndex(): number {\n return this.randomInt(this.buffer.length());\n }\n\n async serialNext(): Promise> {\n // TODO(soergel): consider performance\n if (!this.upstreamExhausted) {\n this.refill();\n }\n while (!this.buffer.isEmpty()) {\n const chosenIndex = this.chooseIndex();\n const result = await this.buffer.shuffleExcise(chosenIndex);\n if (result.done) {\n this.upstreamExhausted = true;\n } else {\n this.refill();\n return result;\n }\n }\n return {value: null, done: true};\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport * as tf from '@tensorflow/tfjs-core';\nimport {TensorContainer, TensorLike} from '@tensorflow/tfjs-core';\nimport * as seedrandom from 'seedrandom';\n\nimport {iteratorFromConcatenated, iteratorFromFunction, iteratorFromItems, iteratorFromZipped, LazyIterator, ZipMismatchMode} from './iterators/lazy_iterator';\nimport {Container} from './types';\nimport {canTensorify, deepMapAndAwaitAll, DeepMapResult, isIterable} from './util/deep_map';\n\n/**\n * A nested structure of Datasets, used as the input to zip().\n */\nexport type DatasetContainer = Container>;\n\n// TODO(soergel): consider vectorized operations within the pipeline.\n\n/**\n * Represents a potentially large list of independent data elements (typically\n * 'samples' or 'examples').\n *\n * A 'data example' may be a primitive, an array, a map from string keys to\n * values, or any nested structure of these.\n *\n * A `Dataset` represents an ordered collection of elements, together with a\n * chain of transformations to be performed on those elements. Each\n * transformation is a method of `Dataset` that returns another `Dataset`, so\n * these may be chained, e.g.\n * `const processedDataset = rawDataset.filter(...).map(...).batch(...)`.\n *\n * Data loading and transformation is done in a lazy, streaming fashion. The\n * dataset may be iterated over multiple times; each iteration starts the data\n * loading anew and recapitulates the transformations.\n *\n * A `Dataset` is typically processed as a stream of unbatched examples --i.e.,\n * its transformations are applied one example at a time. Batching produces a\n * new `Dataset` where each element is a batch. Batching should usually come\n * last in a pipeline, because data transformations are easier to express on a\n * per-example basis than on a per-batch basis.\n *\n * The following code examples are calling `await dataset.forEachAsync(...)` to\n * iterate once over the entire dataset in order to print out the data.\n *\n * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'}\n */\nexport abstract class Dataset {\n /*\n * Provide a new stream of elements. Note this will also start new streams\n * from any underlying `Dataset`s.\n *\n * CAUTION: Any Tensors contained within the elements returned from\n * this stream *must* be manually disposed to avoid a GPU memory leak.\n * The tf.tidy() approach cannot be used in an asynchronous context.\n */\n abstract async iterator(): Promise>;\n\n readonly size: number = null;\n\n // TODO(soergel): Make Datasets report whether repeated iterator() calls\n // produce the same result (e.g., reading from a file) or different results\n // (e.g., from the webcam). Currently we don't make this distinction but it\n // could be important for the user to know.\n // abstract isDeterministic(): boolean;\n\n /**\n * Groups elements into batches.\n *\n * It is assumed that each of the incoming dataset elements has the same\n * structure-- i.e. the same set of keys at each location in an object\n * hierarchy. For each key, the resulting `Dataset` provides a batched\n * element collecting all of the incoming values for that key.\n *\n * * Incoming primitives are grouped into a 1-D Tensor.\n * * Incoming Tensors are grouped into a new Tensor where the 0'th axis is\n * the batch dimension.\n * * Incoming arrays are converted to Tensor and then batched.\n * * A nested array is interpreted as an n-D Tensor, so the batched result\n * has n+1 dimensions.\n * * An array that cannot be converted to Tensor produces an error.\n *\n * If an array should not be batched as a unit, it should first be converted\n * to an object with integer keys.\n *\n * Here are a few examples:\n *\n * Batch a dataset of numbers:\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8]).batch(4);\n * await a.forEachAsync(e => e.print());\n * ```\n *\n * Batch a dataset of arrays:\n * ```js\n * const b = tf.data.array([[1], [2], [3], [4], [5], [6], [7], [8]]).batch(4);\n * await b.forEachAsync(e => e.print());\n * ```\n *\n * Batch a dataset of objects:\n * ```js\n * const c = tf.data.array([{a: 1, b: 11}, {a: 2, b: 12}, {a: 3, b: 13},\n * {a: 4, b: 14}, {a: 5, b: 15}, {a: 6, b: 16}, {a: 7, b: 17},\n * {a: 8, b: 18}]).batch(4);\n * await c.forEachAsync(e => {\n * console.log('{');\n * for(var key in e) {\n * console.log(key+':');\n * e[key].print();\n * }\n * console.log('}');\n * })\n * ```\n *\n * @param batchSize The number of elements desired per batch.\n * @param smallLastBatch Whether to emit the final batch when it has fewer\n * than batchSize elements. Default true.\n * @returns A `Dataset`, from which a stream of batches can be obtained.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n batch(batchSize: number, smallLastBatch = true): Dataset {\n const base = this;\n tf.util.assert(\n batchSize > 0, () => `batchSize needs to be positive, but it is\n ${batchSize}`);\n let size;\n if (this.size === Infinity || this.size == null) {\n // If the size of this dataset is infinity or null, the new size keeps the\n // same.\n size = this.size;\n } else if (smallLastBatch) {\n // If the size of this dataset is known and include small last batch, the\n // new size is full batch count plus last batch.\n size = Math.ceil(this.size / batchSize);\n } else {\n // If the size of this dataset is known and not include small last batch,\n // the new size is full batch count.\n size = Math.floor(this.size / batchSize);\n }\n return datasetFromIteratorFn(async () => {\n return (await base.iterator())\n .columnMajorBatch(batchSize, smallLastBatch, deepBatchConcat);\n }, size);\n }\n\n /**\n * Concatenates this `Dataset` with another.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]);\n * const b = tf.data.array([4, 5, 6]);\n * const c = a.concatenate(b);\n * await c.forEachAsync(e => console.log(e));\n * ```\n *\n * @param dataset A `Dataset` to be concatenated onto this one.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n concatenate(dataset: Dataset): Dataset {\n const base = this;\n let size;\n if (this.size === Infinity || dataset.size === Infinity) {\n // If the size of any of these two dataset is infinity, new size is\n // infinity.\n size = Infinity;\n } else if (this.size != null && dataset.size != null) {\n // If the size of both datasets are known and not infinity, new size is\n // sum the size of these two datasets.\n size = this.size + dataset.size;\n } else {\n // If neither of these two datasets has infinite size and any of these two\n // datasets' size is null, the new size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () =>\n (await base.iterator()).concatenate(await dataset.iterator()),\n size);\n }\n\n /**\n * Filters this dataset according to `predicate`.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])\n * .filter(x => x%2 === 0);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param predicate A function mapping a dataset element to a boolean or a\n * `Promise` for one.\n *\n * @returns A `Dataset` of elements for which the predicate was true.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n filter(predicate: (value: T) => boolean): Dataset {\n const base = this;\n let size;\n if (this.size === Infinity) {\n // If the size of this dataset is infinity, new size is infinity\n size = Infinity;\n } else {\n // If this dataset has limited elements, new size is null because it might\n // exhausted randomly.\n size = null;\n }\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).filter(x => tf.tidy(() => predicate(x)));\n }, size);\n }\n\n /**\n * Apply a function to every element of the dataset.\n *\n * After the function is applied to a dataset element, any Tensors contained\n * within that element are disposed.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param f A function to apply to each dataset element.\n * @returns A `Promise` that resolves after all elements have been processed.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async forEachAsync(f: (input: T) => void): Promise {\n return (await this.iterator()).forEachAsync(f);\n }\n\n /**\n * Maps this dataset through a 1-to-1 transform.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]).map(x => x*x);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param transform A function mapping a dataset element to a transformed\n * dataset element.\n *\n * @returns A `Dataset` of transformed elements.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n map(transform: (value: T) => O): Dataset {\n const base = this;\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).map(x => tf.tidy(() => transform(x)));\n }, this.size);\n }\n\n /**\n * Maps this dataset through an async 1-to-1 transform.\n *\n * ```js\n * const a =\n * tf.data.array([1, 2, 3]).mapAsync(x => new Promise(function(resolve){\n * setTimeout(() => {\n * resolve(x * x);\n * }, Math.random()*1000 + 500);\n * }));\n * console.log(await a.toArray());\n * ```\n *\n * @param transform A function mapping a dataset element to a `Promise` for a\n * transformed dataset element. This transform is responsible for disposing\n * any intermediate `Tensor`s, i.e. by wrapping its computation in\n * `tf.tidy()`; that cannot be automated here (as it is in the synchronous\n * `map()` case).\n *\n * @returns A `Dataset` of transformed elements.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n mapAsync(transform: (value: T) => Promise):\n Dataset {\n const base = this;\n return datasetFromIteratorFn(async () => {\n return (await base.iterator()).mapAsync(transform);\n }, this.size);\n }\n\n /**\n * Creates a `Dataset` that prefetches elements from this dataset.\n *\n * @param bufferSize: An integer specifying the number of elements to be\n * prefetched.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n prefetch(bufferSize: number): Dataset {\n if (bufferSize == null) {\n throw new RangeError(\n '`Dataset.prefetch()` requires bufferSize to be specified.');\n }\n\n const base = this;\n return datasetFromIteratorFn(\n async () => (await base.iterator()).prefetch(bufferSize), this.size);\n }\n\n /**\n * Repeats this dataset `count` times.\n *\n * NOTE: If this dataset is a function of global state (e.g. a random number\n * generator), then different repetitions may produce different elements.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3]).repeat(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: (Optional) An integer, representing the number of times\n * the dataset should be repeated. The default behavior (if `count` is\n * `undefined` or negative) is for the dataset be repeated indefinitely.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n repeat(count?: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && count > 0) {\n // If this dataset has size and count is positive, new size is current\n // size multiply count. This also covers the case that current size is\n // infinity.\n size = this.size * count;\n } else if (count === 0) {\n // If count is 0, new size is 0.\n size = 0;\n } else if (this.size != null && (count === undefined || count < 0)) {\n // If this dataset has size and count is undefined or negative, the\n // dataset will be repeated indefinitely and new size is infinity.\n size = Infinity;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(async () => {\n const iteratorIterator = iteratorFromFunction(\n async () => ({value: await base.iterator(), done: false}));\n return iteratorFromConcatenated(iteratorIterator.take(count));\n }, size);\n }\n\n /**\n * Creates a `Dataset` that skips `count` initial elements from this dataset.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).skip(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: The number of elements of this dataset that should be skipped\n * to form the new dataset. If `count` is greater than the size of this\n * dataset, the new dataset will contain no elements. If `count`\n * is `undefined` or negative, skips the entire dataset.\n *\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n skip(count: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && count >= 0 && this.size >= count) {\n // If the size of this dataset is greater than count, the new dataset's\n // size is current size minus skipped size.This also covers the case that\n // current size is infinity.\n size = this.size - count;\n } else if (\n this.size != null &&\n (this.size < count || count === undefined || count < 0)) {\n // If the size of this dataset is smaller than count, or count is\n // undefined or negative, skips the entire dataset and the new size is 0.\n size = 0;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () => (await base.iterator()).skip(count), size);\n }\n\n // TODO(soergel): deep sharded shuffle, where supported\n\n static readonly MAX_BUFFER_SIZE = 10000;\n\n /**\n * Pseudorandomly shuffles the elements of this dataset. This is done in a\n * streaming manner, by sampling from a given number of prefetched elements.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).shuffle(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param bufferSize: An integer specifying the number of elements from this\n * dataset from which the new dataset will sample.\n * @param seed: (Optional) An integer specifying the random seed that will\n * be used to create the distribution.\n * @param reshuffleEachIteration: (Optional) A boolean, which if true\n * indicates that the dataset should be pseudorandomly reshuffled each time\n * it is iterated over. If false, elements will be returned in the same\n * shuffled order on each iteration. (Defaults to `true`.)\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n shuffle(bufferSize: number, seed?: string, reshuffleEachIteration = true):\n Dataset {\n if (bufferSize == null || bufferSize < 0) {\n if (this.size == null) {\n throw new RangeError(\n '`Dataset.shuffle()` requires bufferSize to be specified.');\n } else {\n throw new RangeError(\n '`Dataset.shuffle()` requires bufferSize to be specified. ' +\n 'If your data fits in main memory (for regular JS objects), ' +\n 'and/or GPU memory (for `tf.Tensor`s), consider setting ' +\n `bufferSize to the dataset size (${this.size} elements)`);\n }\n }\n const base = this;\n const random = seedrandom.alea(seed || tf.util.now().toString());\n return datasetFromIteratorFn(async () => {\n let seed2 = random.int32();\n if (reshuffleEachIteration) {\n seed2 += random.int32();\n }\n return (await base.iterator()).shuffle(bufferSize, seed2.toString());\n }, this.size);\n }\n\n /**\n * Creates a `Dataset` with at most `count` initial elements from this\n * dataset.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]).take(3);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * @param count: The number of elements of this dataset that should be taken\n * to form the new dataset. If `count` is `undefined` or negative, or if\n * `count` is greater than the size of this dataset, the new dataset will\n * contain all elements of this dataset.\n * @returns A `Dataset`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n take(count: number): Dataset {\n const base = this;\n let size;\n if (this.size != null && this.size > count) {\n // If the size of this dataset is greater than count, the new dataset's\n // size is count.\n size = count;\n } else if (this.size != null && this.size <= count) {\n // If the size of this dataset is equal or smaller than count, the new\n // dataset's size is the size of this dataset.\n size = this.size;\n } else {\n // If the size of this dataset is null, the new dataset's size is null.\n size = null;\n }\n return datasetFromIteratorFn(\n async () => (await base.iterator()).take(count), size);\n }\n\n /**\n * Collect all elements of this dataset into an array.\n *\n * Obviously this will succeed only for small datasets that fit in memory.\n * Useful for testing and generally should be avoided if possible.\n *\n * ```js\n * const a = tf.data.array([1, 2, 3, 4, 5, 6]);\n * console.log(await a.toArray());\n * ```\n *\n * @returns A Promise for an array of elements, which will resolve\n * when a new stream has been obtained and fully consumed.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async toArray() {\n if (this.size === Infinity) {\n throw new Error('Can not convert infinite data stream to array.');\n }\n return (await this.iterator()).toArray();\n }\n\n /**\n * Collect all elements of this dataset into an array with prefetching 100\n * elements. This is useful for testing, because the prefetch changes the\n * order in which the Promises are resolved along the processing pipeline.\n * This may help expose bugs where results are dependent on the order of\n * Promise resolution rather than on the logical order of the stream (i.e.,\n * due to hidden mutable state).\n *\n * @returns A Promise for an array of elements, which will resolve\n * when a new stream has been obtained and fully consumed.\n */\n async toArrayForTest() {\n if (this.size === Infinity) {\n throw new Error('Can not convert infinite data stream to array.');\n }\n return (await this.iterator()).toArrayForTest();\n }\n}\n\n/**\n * Create a `Dataset` defined by a provided iterator() function.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const iter = tf.data.iteratorFromFunction(func);\n * const ds = tf.data.datasetFromIteratorFn(iter);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n */\nexport function datasetFromIteratorFn(\n iteratorFn: () => Promise>,\n size: number = null): Dataset {\n return new class extends Dataset {\n size = size;\n\n /*\n * Provide a new stream of elements. Note this will also start new streams\n * from any underlying `Dataset`s.\n */\n async iterator(): Promise> {\n return iteratorFn();\n }\n }\n ();\n}\n\n/**\n * Create a `Dataset` from an array of elements.\n *\n * Create a Dataset from an array of objects:\n * ```js\n * const a = tf.data.array([{'item': 1}, {'item': 2}, {'item': 3}]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n *\n * Create a Dataset from an array of numbers:\n * ```js\n * const a = tf.data.array([4, 5, 6]);\n * await a.forEachAsync(e => console.log(e));\n * ```\n * @param items An array of elements that will be parsed as items in a dataset.\n *\n * @doc {heading: 'Data', subheading: 'Creation', namespace: 'data'}\n */\nexport function array(items: T[]): Dataset {\n return datasetFromIteratorFn(\n async () => iteratorFromItems(items), items.length);\n}\n\n/**\n * Create a `Dataset` by zipping together an array, dict, or nested\n * structure of `Dataset`s (and perhaps additional constants).\n * The underlying datasets must provide elements in a consistent order such that\n * they correspond.\n *\n * The number of elements in the resulting dataset is the same as the size of\n * the smallest dataset in datasets.\n *\n * The nested structure of the `datasets` argument determines the\n * structure of elements in the resulting iterator.\n *\n * Note this means that, given an array of two datasets that produce dict\n * elements, the result is a dataset that produces elements that are arrays\n * of two dicts:\n *\n * Zip an array of datasets:\n * ```js\n * console.log('Zip two datasets of objects:');\n * const ds1 = tf.data.array([{a: 1}, {a: 2}, {a: 3}]);\n * const ds2 = tf.data.array([{b: 4}, {b: 5}, {b: 6}]);\n * const ds3 = tf.data.zip([ds1, ds2]);\n * await ds3.forEachAsync(e => console.log(JSON.stringify(e)));\n *\n * // If the goal is to merge the dicts in order to produce elements like\n * // {a: ..., b: ...}, this requires a second step such as:\n * console.log('Merge the objects:');\n * const ds4 = ds3.map(x => {return {a: x[0].a, b: x[1].b}});\n * await ds4.forEachAsync(e => console.log(e));\n * ```\n *\n * Zip a dict of datasets:\n * ```js\n * const a = tf.data.array([{a: 1}, {a: 2}, {a: 3}]);\n * const b = tf.data.array([{b: 4}, {b: 5}, {b: 6}]);\n * const c = tf.data.zip({c: a, d: b});\n * await c.forEachAsync(e => console.log(JSON.stringify(e)));\n * ```\n *\n * @doc {heading: 'Data', subheading: 'Operations', namespace: 'data'}\n */\nexport function zip(datasets: DatasetContainer):\n Dataset {\n // manually type-check the argument for JS users\n if (!isIterable(datasets)) {\n throw new Error('The argument to zip() must be an object or array.');\n }\n let size;\n if (Array.isArray(datasets)) {\n for (let i = 0; i < datasets.length; i++) {\n size = size == null ? (datasets[i] as Dataset).size :\n Math.min(size, (datasets[i] as Dataset).size);\n }\n } else if (datasets instanceof Object) {\n for (const ds in datasets) {\n size = size == null ? (datasets[ds] as Dataset).size :\n Math.min(size, (datasets[ds] as Dataset).size);\n }\n }\n return datasetFromIteratorFn(async () => {\n const streams = await deepMapAndAwaitAll(datasets, d => {\n if (d instanceof Dataset) {\n return {value: d.iterator(), recurse: false};\n } else if (isIterable(d)) {\n return {value: null, recurse: true};\n } else {\n throw new Error(\n 'Leaves of the structure passed to zip() must be Datasets, ' +\n 'not primitives.');\n }\n });\n return iteratorFromZipped(streams, ZipMismatchMode.SHORTEST);\n }, size);\n}\n\n/**\n * A zip function for use with deepZip, passed via the columnMajorBatch call.\n *\n * Accepts an array of identically-structured nested elements and either batches\n * them (if they are primitives, numeric arrays, or Tensors) or requests\n * recursion (if not).\n */\n// tslint:disable-next-line:no-any\nfunction deepBatchConcat(rows: any[]): DeepMapResult {\n if (rows === null) {\n return null;\n }\n\n // use the first item to decide whether to recurse or batch here.\n const exampleRow = rows[0];\n\n if (canTensorify(exampleRow)) {\n // rows is an array of primitives, Tensors, or arrays. Batch them.\n const value = batchConcat(rows);\n return {value, recurse: false};\n }\n\n // the example row is an object, so recurse into it.\n return {value: null, recurse: true};\n}\n\n/**\n * Assembles a list of same-shaped numbers, number arrays, or Tensors\n * into a single new Tensor where axis 0 is the batch dimension.\n */\nfunction batchConcat(arrays: T[]):\n tf.Tensor {\n if (arrays.length === 0) {\n // We can't return an empty Tensor because we don't know the element shape.\n throw new Error('Can\\'t make a batch of zero elements.');\n }\n\n if (arrays[0] instanceof tf.Tensor) {\n // Input is an array of Tensors\n return tf.stack(arrays as tf.Tensor[]);\n } else {\n // Input is a possibly-nested array of numbers.\n return tf.tensor(arrays as TensorLike);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {Dataset} from '../dataset';\nimport {DataSource} from '../datasource';\nimport {LazyIterator} from '../iterators/lazy_iterator';\n\n/**\n * Represents a potentially large collection of text lines.\n *\n * The results are not batched.\n */\nexport class TextLineDataset extends Dataset {\n /**\n * Create a `TextLineDataset`.\n *\n * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream.\n */\n constructor(protected readonly input: DataSource) {\n super();\n }\n\n async iterator(): Promise> {\n const inputIterator = await this.input.iterator();\n const utf8Iterator = inputIterator.decodeUTF8();\n const lineIterator = utf8Iterator.split('\\n').map(line => {\n // Windows/DOS format text file has extra line breaker at the end of line.\n if (line.endsWith('\\r')) {\n line = line.slice(0, -1);\n }\n return line;\n });\n return lineIterator;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {TensorContainer, util} from '@tensorflow/tfjs-core';\nimport {Dataset} from '../dataset';\nimport {DataSource} from '../datasource';\nimport {LazyIterator} from '../iterators/lazy_iterator';\nimport {ColumnConfig, CSVConfig} from '../types';\nimport {TextLineDataset} from './text_line_dataset';\n\nconst CODE_QUOTE = '\"';\nconst STATE_OUT = Symbol('out');\nconst STATE_FIELD = Symbol('field');\nconst STATE_QUOTE = Symbol('quote');\nconst STATE_QUOTE_AFTER_QUOTE = Symbol('quoteafterquote');\nconst STATE_WITHIN_QUOTE_IN_QUOTE = Symbol('quoteinquote');\n\n/**\n * Represents a potentially large collection of delimited text records.\n *\n * The produced `TensorContainer`s each contain one key-value pair for\n * every column of the table. When a field is empty in the incoming data, the\n * resulting value is `undefined`, or throw error if it is required. Values\n * that can be parsed as numbers are emitted as type `number`, other values\n * are parsed as `string`.\n *\n * The results are not batched.\n *\n * @doc {heading: 'Data', subheading: 'Classes', namespace: 'data'}\n */\nexport class CSVDataset extends Dataset {\n base: TextLineDataset;\n private hasHeader = true;\n private fullColumnNames: string[] = null;\n private columnNamesValidated = false;\n private columnConfigs: {[key: string]: ColumnConfig} = null;\n private configuredColumnsOnly = false;\n private delimiter = ',';\n private delimWhitespace = false;\n\n /**\n * Returns column names of the csv dataset. If `configuredColumnsOnly` is\n * true, return column names in `columnConfigs`. If `configuredColumnsOnly` is\n * false and `columnNames` is provided, `columnNames`. If\n * `configuredColumnsOnly` is false and `columnNames` is not provided, return\n * all column names parsed from the csv file. For example usage please go to\n * `tf.data.csv`.\n *\n * @doc {heading: 'Data', subheading: 'Classes'}\n */\n async columnNames() {\n if (!this.columnNamesValidated) {\n await this.setColumnNames();\n }\n return this.configuredColumnsOnly ? Object.keys(this.columnConfigs) :\n this.fullColumnNames;\n }\n\n /* 1) If `columnNames` is provided as string[], use this string[] as output\n * keys in corresponding order. The length must match the number of inferred\n * columns if `hasHeader` is true .\n * 2) If `columnNames` is not provided, parse header line as `columnNames` if\n * hasHeader is true. If `hasHeader` is false, throw an error.\n * 3) If `columnConfigs` is provided, all the keys in `columnConfigs` must\n * exist in parsed `columnNames`.\n */\n private async setColumnNames() {\n const columnNamesFromFile = await this.maybeReadHeaderLine();\n if (!this.fullColumnNames && !columnNamesFromFile) {\n // Throw an error if columnNames is not provided and no header line.\n throw new Error(\n 'Column names must be provided if there is no header line.');\n } else if (this.fullColumnNames && columnNamesFromFile) {\n // Check provided columnNames match header line.\n util.assert(\n columnNamesFromFile.length === this.fullColumnNames.length,\n () => 'The length of provided columnNames (' +\n this.fullColumnNames.length.toString() +\n ') does not match the length of the header line read from ' +\n 'file (' + columnNamesFromFile.length.toString() + ').');\n }\n if (!this.fullColumnNames) {\n this.fullColumnNames = columnNamesFromFile;\n }\n // Check if there are duplicate column names.\n const counts: {[key: string]: number} = this.fullColumnNames.reduce(\n (countAcc: {[key: string]: number}, name) => {\n countAcc[name] = (countAcc[name] + 1) || 1;\n return countAcc;\n },\n {});\n const duplicateNames =\n Object.keys(counts).filter((name) => (counts[name] > 1));\n util.assert(\n duplicateNames.length === 0,\n () => 'Duplicate column names found: ' + duplicateNames.toString());\n // Check if keys in columnConfigs match columnNames.\n if (this.columnConfigs) {\n for (const key of Object.keys(this.columnConfigs)) {\n const index = this.fullColumnNames.indexOf(key);\n if (index === -1) {\n throw new Error(\n 'The key \"' + key +\n '\" provided in columnConfigs does not match any of the column ' +\n 'names (' + this.fullColumnNames.toString() + ').');\n }\n }\n }\n this.columnNamesValidated = true;\n }\n\n private async maybeReadHeaderLine() {\n if (this.hasHeader) {\n const iter = await this.base.iterator();\n const firstElement = await iter.next();\n if (firstElement.done) {\n throw new Error('No data was found for CSV parsing.');\n }\n const firstLine: string = firstElement.value;\n const headers = this.parseRow(firstLine, false);\n return headers;\n } else {\n return null;\n }\n }\n\n /**\n * Create a `CSVDataset`.\n *\n * @param input A `DataSource` providing a chunked, UTF8-encoded byte stream.\n * @param csvConfig (Optional) A CSVConfig object that contains configurations\n * of reading and decoding from CSV file(s).\n *\n * hasHeader: (Optional) A boolean value that indicates whether the first\n * row of provided CSV file is a header line with column names, and should\n * not be included in the data. Defaults to `true`.\n *\n * columnNames: (Optional) A list of strings that corresponds to\n * the CSV column names, in order. If provided, it ignores the column\n * names inferred from the header row. If not provided, infers the column\n * names from the first row of the records. If hasHeader is false and\n * columnNames is not provided, this method throws an error.\n *\n * columnConfigs: (Optional) A dictionary whose key is column names, value\n * is an object stating if this column is required, column's data type,\n * default value, and if this column is label. If provided, keys must\n * correspond to names provided in columnNames or inferred from the file\n * header lines. If isLabel is true any column, returns an array of two\n * items: the first item is a dict of features key/value pairs, the second\n * item is a dict of labels key/value pairs. If no feature is marked as\n * label, returns a dict of features only.\n *\n * configuredColumnsOnly (Optional) If true, only columns provided in\n * columnConfigs will be parsed and provided during iteration.\n *\n * delimiter (Optional) The string used to parse each line of the input\n * file. Defaults to `,`.\n */\n constructor(protected readonly input: DataSource, csvConfig?: CSVConfig) {\n super();\n this.base = new TextLineDataset(input);\n if (!csvConfig) {\n csvConfig = {};\n }\n this.hasHeader = csvConfig.hasHeader === false ? false : true;\n this.fullColumnNames = csvConfig.columnNames;\n this.columnConfigs = csvConfig.columnConfigs;\n this.configuredColumnsOnly = csvConfig.configuredColumnsOnly;\n if (csvConfig.delimWhitespace) {\n util.assert(\n csvConfig.delimiter == null,\n () =>\n 'Delimiter should not be provided when delimWhitespace is true.');\n this.delimWhitespace = true;\n this.delimiter = ' ';\n } else {\n this.delimiter = csvConfig.delimiter ? csvConfig.delimiter : ',';\n }\n }\n\n async iterator(): Promise> {\n if (!this.columnNamesValidated) {\n await this.setColumnNames();\n }\n let lines = await this.base.iterator();\n if (this.hasHeader) {\n // We previously read the first line to get the columnNames.\n // Now that we're providing data, skip it.\n lines = lines.skip(1);\n }\n return lines.map(x => this.makeDataElement(x));\n }\n\n makeDataElement(line: string): TensorContainer {\n const values = this.parseRow(line);\n const features: {[key: string]: TensorContainer} = {};\n const labels: {[key: string]: TensorContainer} = {};\n\n for (let i = 0; i < this.fullColumnNames.length; i++) {\n const key = this.fullColumnNames[i];\n const config = this.columnConfigs ? this.columnConfigs[key] : null;\n if (this.configuredColumnsOnly && !config) {\n // This column is not selected.\n continue;\n } else {\n const value = values[i];\n let parsedValue = null;\n if (value === '') {\n // If default value is provided, use it. If default value is not\n // provided, set as undefined.\n if (config && config.default !== undefined) {\n parsedValue = config.default;\n } else if (config && (config.required || config.isLabel)) {\n throw new Error(\n `Required column ${key} is empty in this line: ${line}`);\n } else {\n parsedValue = undefined;\n }\n } else {\n // A value is present, so parse it based on type\n const valueAsNum = Number(value);\n if (isNaN(valueAsNum)) {\n // The value is a string and this column is declared as boolean\n // in config, parse it as boolean.\n if (config && config.dtype === 'bool') {\n parsedValue = this.getBoolean(value);\n } else {\n // Set value as string\n parsedValue = value;\n }\n } else if (!config || !config.dtype) {\n // If this value is a number and no type config is provided, return\n // it as number.\n parsedValue = valueAsNum;\n } else {\n // If this value is a number and data type is provided, parse it\n // according to provided data type.\n switch (config.dtype) {\n case 'float32':\n parsedValue = valueAsNum;\n break;\n case 'int32':\n parsedValue = Math.floor(valueAsNum);\n break;\n case 'bool':\n parsedValue = this.getBoolean(value);\n break;\n default:\n parsedValue = valueAsNum;\n }\n }\n }\n // Check if this column is label.\n (config && config.isLabel) ? labels[key] = parsedValue :\n features[key] = parsedValue;\n }\n }\n // If label exists, return an object of features and labels as {xs:features,\n // ys:labels}, otherwise return features only.\n if (Object.keys(labels).length === 0) {\n return features;\n\n } else {\n return {xs: features, ys: labels};\n }\n }\n\n private getBoolean(value: string): number {\n if (value === '1' || value.toLowerCase() === 'true') {\n return 1;\n } else {\n return 0;\n }\n }\n\n // adapted from https://beta.observablehq.com/@mbostock/streaming-csv\n private parseRow(line: string, validateElementCount = true): string[] {\n const result: string[] = [];\n let readOffset = 0;\n const readLength = line.length;\n let currentState = STATE_OUT;\n // Goes through the line to parse quote.\n for (let i = 0; i < readLength; i++) {\n switch (currentState) {\n // Before enter a new field\n case STATE_OUT:\n switch (line.charAt(i)) {\n // Enter a quoted field\n case CODE_QUOTE:\n readOffset = i + 1;\n currentState = STATE_QUOTE;\n break;\n // Read an empty field\n case this.delimiter:\n readOffset = i + 1;\n // If delimiter is white space and configured to collapse\n // multiple white spaces, ignore this white space.\n if (this.delimiter === ' ' && this.delimWhitespace) {\n break;\n }\n result.push('');\n currentState = STATE_OUT;\n break;\n // Enter an unquoted field\n default:\n currentState = STATE_FIELD;\n readOffset = i;\n break;\n }\n break;\n // In an unquoted field\n case STATE_FIELD:\n switch (line.charAt(i)) {\n // Exit an unquoted field, add it to result\n case this.delimiter:\n result.push(line.substring(readOffset, i));\n currentState = STATE_OUT;\n readOffset = i + 1;\n break;\n default:\n }\n break;\n // In a quoted field\n case STATE_QUOTE:\n switch (line.charAt(i)) {\n // Read a quote after a quote\n case CODE_QUOTE:\n currentState = STATE_QUOTE_AFTER_QUOTE;\n break;\n default:\n }\n break;\n // This state means it's right after a second quote in a field\n case STATE_QUOTE_AFTER_QUOTE:\n switch (line.charAt(i)) {\n // Finished a quoted field\n case this.delimiter:\n result.push(line.substring(readOffset, i - 1));\n currentState = STATE_OUT;\n readOffset = i + 1;\n break;\n // Finished a quoted part in a quoted field\n case CODE_QUOTE:\n currentState = STATE_QUOTE;\n break;\n // In a quoted part in a quoted field\n default:\n currentState = STATE_WITHIN_QUOTE_IN_QUOTE;\n break;\n }\n break;\n case STATE_WITHIN_QUOTE_IN_QUOTE:\n switch (line.charAt(i)) {\n // Exit a quoted part in a quoted field\n case CODE_QUOTE:\n currentState = STATE_QUOTE;\n break;\n default:\n }\n break;\n default:\n }\n }\n // Adds last item based on if it is quoted.\n if (currentState === STATE_QUOTE_AFTER_QUOTE) {\n result.push(line.substring(readOffset, readLength - 1));\n } else {\n result.push(line.substring(readOffset));\n }\n // Check if each row has the same number of elements as column names.\n if (validateElementCount && result.length !== this.fullColumnNames.length) {\n throw new Error(`Invalid row in csv file. Should have ${\n this.fullColumnNames.length} elements in a row, but got ${result}`);\n }\n return result;\n }\n}\n\n// TODO(soergel): add more basic datasets for parity with tf.data\n// tf.data.FixedLengthRecordDataset()\n// tf.data.TFRecordDataset()\n","/**\n * @license\n * Copyright 2019 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {env, Tensor, tensor, Tensor2D, Tensor3D, TensorContainer, util} from '@tensorflow/tfjs-core';\nimport {MicrophoneConfig} from '../types';\nimport {LazyIterator} from './lazy_iterator';\n\n/**\n * Provide a stream of tensors from microphone audio stream. The tensors are\n * representing audio data as frequency-domain spectrogram generated with\n * browser's native FFT. Tensors representing time-domain waveform is available\n * based on configuration. Only works in browser environment.\n */\nexport class MicrophoneIterator extends LazyIterator {\n private isClosed = false;\n private stream: MediaStream;\n private readonly fftSize: number;\n private readonly columnTruncateLength: number;\n private freqData: Float32Array;\n private timeData: Float32Array;\n private readonly numFrames: number;\n private analyser: AnalyserNode;\n private audioContext: AudioContext;\n private sampleRateHz: number;\n private readonly audioTrackConstraints: MediaTrackConstraints;\n private readonly smoothingTimeConstant: number;\n private readonly includeSpectrogram: boolean;\n private readonly includeWaveform: boolean;\n\n private constructor(protected readonly microphoneConfig: MicrophoneConfig) {\n super();\n this.fftSize = microphoneConfig.fftSize || 1024;\n const fftSizeLog2 = Math.log2(this.fftSize);\n if (this.fftSize < 0 || fftSizeLog2 < 4 || fftSizeLog2 > 14 ||\n !Number.isInteger(fftSizeLog2)) {\n throw new Error(\n `Invalid fftSize: it must be a power of 2 between ` +\n `2 to 4 and 2 to 14, but got ${this.fftSize}`);\n }\n\n this.numFrames = microphoneConfig.numFramesPerSpectrogram || 43;\n this.sampleRateHz = microphoneConfig.sampleRateHz;\n this.columnTruncateLength =\n microphoneConfig.columnTruncateLength || this.fftSize;\n this.audioTrackConstraints = microphoneConfig.audioTrackConstraints;\n this.smoothingTimeConstant = microphoneConfig.smoothingTimeConstant || 0;\n\n this.includeSpectrogram =\n microphoneConfig.includeSpectrogram === false ? false : true;\n this.includeWaveform =\n microphoneConfig.includeWaveform === true ? true : false;\n if (!this.includeSpectrogram && !this.includeWaveform) {\n throw new Error(\n 'Both includeSpectrogram and includeWaveform are false. ' +\n 'At least one type of data should be returned.');\n }\n }\n\n summary() {\n return `microphone`;\n }\n\n // Construct a MicrophoneIterator and start the audio stream.\n static async create(microphoneConfig: MicrophoneConfig = {}) {\n if (env().get('IS_NODE')) {\n throw new Error(\n 'microphone API is only supported in browser environment.');\n }\n\n const microphoneIterator = new MicrophoneIterator(microphoneConfig);\n\n // Call async function start() to initialize the audio stream.\n await microphoneIterator.start();\n\n return microphoneIterator;\n }\n\n // Start the audio stream and FFT.\n async start(): Promise {\n try {\n this.stream = await navigator.mediaDevices.getUserMedia({\n audio: this.audioTrackConstraints == null ? true :\n this.audioTrackConstraints,\n video: false\n });\n } catch (e) {\n throw new Error(\n `Error thrown while initializing video stream: ${e.message}`);\n }\n\n if (!this.stream) {\n throw new Error('Could not obtain audio from microphone.');\n }\n\n const ctxConstructor =\n // tslint:disable-next-line:no-any\n (window as any).AudioContext || (window as any).webkitAudioContext;\n this.audioContext = new ctxConstructor();\n\n if (!this.sampleRateHz) {\n // If sample rate is not provided, use the available sample rate on\n // device.\n this.sampleRateHz = this.audioContext.sampleRate;\n } else if (this.audioContext.sampleRate !== this.sampleRateHz) {\n throw new Error(\n `Mismatch in sampling rate: ` +\n `Expected: ${this.sampleRateHz}; ` +\n `Actual: ${this.audioContext.sampleRate}`);\n }\n\n const streamSource = this.audioContext.createMediaStreamSource(this.stream);\n this.analyser = this.audioContext.createAnalyser();\n this.analyser.fftSize = this.fftSize * 2;\n this.analyser.smoothingTimeConstant = this.smoothingTimeConstant;\n streamSource.connect(this.analyser);\n this.freqData = new Float32Array(this.fftSize);\n this.timeData = new Float32Array(this.fftSize);\n return;\n }\n\n async next(): Promise> {\n if (this.isClosed) {\n return {value: null, done: true};\n }\n\n let spectrogramTensor: Tensor;\n let waveformTensor: Tensor;\n\n const audioDataQueue = await this.getAudioData();\n if (this.includeSpectrogram) {\n const freqData = this.flattenQueue(audioDataQueue.freqDataQueue);\n spectrogramTensor = this.getTensorFromAudioDataArray(\n freqData, [this.numFrames, this.columnTruncateLength, 1]);\n }\n if (this.includeWaveform) {\n const timeData = this.flattenQueue(audioDataQueue.timeDataQueue);\n waveformTensor = this.getTensorFromAudioDataArray(\n timeData, [this.numFrames * this.fftSize, 1]);\n }\n\n return {\n value: {'spectrogram': spectrogramTensor, 'waveform': waveformTensor},\n done: false\n };\n }\n\n // Capture one result from the audio stream, and extract the value from\n // iterator.next() result.\n async capture(): Promise<{spectrogram: Tensor3D, waveform: Tensor2D}> {\n return (await this.next()).value as\n {spectrogram: Tensor3D, waveform: Tensor2D};\n }\n\n private async getAudioData():\n Promise<{freqDataQueue: Float32Array[], timeDataQueue: Float32Array[]}> {\n const freqDataQueue: Float32Array[] = [];\n const timeDataQueue: Float32Array[] = [];\n let currentFrames = 0;\n return new Promise(resolve => {\n const intervalID = setInterval(() => {\n if (this.includeSpectrogram) {\n this.analyser.getFloatFrequencyData(this.freqData);\n // If the audio stream is initializing, return empty queue.\n if (this.freqData[0] === -Infinity) {\n resolve({freqDataQueue, timeDataQueue});\n }\n freqDataQueue.push(this.freqData.slice(0, this.columnTruncateLength));\n }\n if (this.includeWaveform) {\n this.analyser.getFloatTimeDomainData(this.timeData);\n timeDataQueue.push(this.timeData.slice());\n }\n\n // Clean interval and return when all frames have been collected\n if (++currentFrames === this.numFrames) {\n clearInterval(intervalID);\n resolve({freqDataQueue, timeDataQueue});\n }\n }, this.fftSize / this.sampleRateHz * 1e3);\n });\n }\n\n // Stop the audio stream and pause the iterator.\n stop(): void {\n if (!this.isClosed) {\n this.isClosed = true;\n this.analyser.disconnect();\n this.audioContext.close();\n if (this.stream != null && this.stream.getTracks().length > 0) {\n this.stream.getTracks()[0].stop();\n }\n }\n }\n\n // Override toArray() function to prevent collecting.\n toArray(): Promise {\n throw new Error('Can not convert infinite audio stream to array.');\n }\n\n // Return audio sampling rate in Hz\n getSampleRate(): number {\n return this.sampleRateHz;\n }\n\n private flattenQueue(queue: Float32Array[]): Float32Array {\n const frameSize = queue[0].length;\n const freqData = new Float32Array(queue.length * frameSize);\n queue.forEach((data, i) => freqData.set(data, i * frameSize));\n return freqData;\n }\n\n private getTensorFromAudioDataArray(freqData: Float32Array, shape: number[]):\n Tensor {\n const vals = new Float32Array(util.sizeFromShape(shape));\n // If the data is less than the output shape, the rest is padded with zeros.\n vals.set(freqData, vals.length - freqData.length);\n return tensor(vals, shape);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {browser, cast, env, expandDims, image, reshape, tensor1d, Tensor1D, tensor2d, Tensor2D, Tensor3D, Tensor4D, tidy, util} from '@tensorflow/tfjs-core';\nimport {WebcamConfig} from '../types';\nimport {LazyIterator} from './lazy_iterator';\n\n/**\n * Provide a stream of image tensors from webcam video stream. Only works in\n * browser environment.\n */\nexport class WebcamIterator extends LazyIterator {\n private isClosed = true;\n private stream: MediaStream;\n private resize = false;\n private cropSize: [number, number];\n private cropBox: Tensor2D;\n private cropBoxInd: Tensor1D;\n\n private constructor(\n protected readonly webcamVideoElement: HTMLVideoElement,\n protected readonly webcamConfig: WebcamConfig) {\n super();\n if (this.needToResize()) {\n this.resize = true;\n this.cropSize =\n [this.webcamConfig.resizeHeight, this.webcamConfig.resizeWidth];\n this.cropBoxInd = tensor1d([0], 'int32');\n if (this.webcamConfig.centerCrop) {\n // Calculate the box based on resizing shape.\n const widthCroppingRatio =\n this.webcamConfig.resizeWidth * 1.0 / this.webcamVideoElement.width;\n const heightCroppingRatio = this.webcamConfig.resizeHeight * 1.0 /\n this.webcamVideoElement.height;\n const widthCropStart = (1 - widthCroppingRatio) / 2;\n const heightCropStart = (1 - heightCroppingRatio) / 2;\n const widthCropEnd = widthCropStart + widthCroppingRatio;\n const heightCropEnd = heightCroppingRatio + heightCropStart;\n this.cropBox = tensor2d(\n [heightCropStart, widthCropStart, heightCropEnd, widthCropEnd],\n [1, 4]);\n } else {\n this.cropBox = tensor2d([0, 0, 1, 1], [1, 4]);\n }\n }\n }\n\n summary() {\n return `webcam`;\n }\n\n // Construct a WebcamIterator and start it's video stream.\n static async create(\n webcamVideoElement?: HTMLVideoElement, webcamConfig: WebcamConfig = {}) {\n if (env().get('IS_NODE')) {\n throw new Error(\n 'tf.data.webcam is only supported in browser environment.');\n }\n\n if (!webcamVideoElement) {\n // If webcam video element is not provided, create a hidden video element\n // with provided width and height.\n webcamVideoElement = document.createElement('video');\n if (!webcamConfig.resizeWidth || !webcamConfig.resizeHeight) {\n throw new Error(\n 'Please provide webcam video element, or resizeWidth and ' +\n 'resizeHeight to create a hidden video element.');\n }\n webcamVideoElement.width = webcamConfig.resizeWidth;\n webcamVideoElement.height = webcamConfig.resizeHeight;\n }\n const webcamIterator = new WebcamIterator(webcamVideoElement, webcamConfig);\n\n // Call async function to initialize the video stream.\n await webcamIterator.start();\n\n return webcamIterator;\n }\n\n // Async function to start video stream.\n async start(): Promise {\n if (this.webcamConfig.facingMode) {\n util.assert(\n (this.webcamConfig.facingMode === 'user') ||\n (this.webcamConfig.facingMode === 'environment'),\n () =>\n `Invalid webcam facing mode: ${this.webcamConfig.facingMode}. ` +\n `Please provide 'user' or 'environment'`);\n }\n\n try {\n this.stream = await navigator.mediaDevices.getUserMedia({\n video: {\n deviceId: this.webcamConfig.deviceId,\n facingMode: this.webcamConfig.facingMode ?\n this.webcamConfig.facingMode :\n 'user',\n width: this.webcamVideoElement.width,\n height: this.webcamVideoElement.height\n }\n });\n } catch (e) {\n // Modify the error message but leave the stack trace intact\n e.message = `Error thrown while initializing video stream: ${e.message}`;\n throw e;\n }\n\n if (!this.stream) {\n throw new Error('Could not obtain video from webcam.');\n }\n\n // Older browsers may not have srcObject\n try {\n this.webcamVideoElement.srcObject = this.stream;\n } catch (error) {\n console.log(error);\n this.webcamVideoElement.src = window.URL.createObjectURL(this.stream);\n }\n // Start the webcam video stream\n this.webcamVideoElement.play();\n\n this.isClosed = false;\n\n return new Promise(resolve => {\n // Add event listener to make sure the webcam has been fully initialized.\n this.webcamVideoElement.onloadedmetadata = () => {\n resolve();\n };\n });\n }\n\n async next(): Promise> {\n if (this.isClosed) {\n return {value: null, done: true};\n }\n\n let img;\n try {\n img = browser.fromPixels(this.webcamVideoElement);\n } catch (e) {\n throw new Error(\n `Error thrown converting video to pixels: ${JSON.stringify(e)}`);\n }\n if (this.resize) {\n try {\n return {value: this.cropAndResizeFrame(img), done: false};\n } catch (e) {\n throw new Error(`Error thrown cropping the video: ${e.message}`);\n } finally {\n img.dispose();\n }\n } else {\n return {value: img, done: false};\n }\n }\n\n private needToResize() {\n // If resizeWidth and resizeHeight are provided, and different from the\n // width and height of original HTMLVideoElement, then resizing and cropping\n // is required.\n if (this.webcamConfig.resizeWidth && this.webcamConfig.resizeHeight &&\n (this.webcamVideoElement.width !== this.webcamConfig.resizeWidth ||\n this.webcamVideoElement.height !== this.webcamConfig.resizeHeight)) {\n return true;\n }\n return false;\n }\n\n // Cropping and resizing each frame based on config\n cropAndResizeFrame(img: Tensor3D): Tensor3D {\n return tidy(() => {\n const expandedImage: Tensor4D = expandDims(cast(img, 'float32'), (0));\n let resizedImage;\n resizedImage = image.cropAndResize(\n expandedImage, this.cropBox, this.cropBoxInd, this.cropSize,\n 'bilinear');\n // Extract image from batch cropping.\n const shape = resizedImage.shape;\n return reshape(resizedImage, shape.slice(1) as [number, number, number]);\n });\n }\n\n // Capture one frame from the video stream, and extract the value from\n // iterator.next() result.\n async capture(): Promise {\n return (await this.next()).value;\n }\n\n // Stop the video stream and pause webcam iterator.\n stop(): void {\n const tracks = this.stream.getTracks();\n\n tracks.forEach(track => track.stop());\n\n try {\n this.webcamVideoElement.srcObject = null;\n } catch (error) {\n console.log(error);\n this.webcamVideoElement.src = null;\n }\n this.isClosed = true;\n }\n\n // Override toArray() function to prevent collecting.\n toArray(): Promise {\n throw new Error('Can not convert infinite video stream to array.');\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {ByteChunkIterator} from './iterators/byte_chunk_iterator';\n\n/**\n * Represents a data source readable as a stream of binary data chunks.\n *\n * Because `Dataset`s can be read repeatedly (via `Dataset.iterator()`), this\n * provides a means to repeatedly create streams from the underlying data\n * sources.\n */\nexport abstract class DataSource {\n /**\n * Obtain a new stream of binary data chunks.\n *\n * Starts the new stream from the beginning of the data source, even if other\n * streams have been obtained previously.\n */\n abstract async iterator(): Promise;\n\n // TODO(soergel): consider chainable Dataset construction here\n}\n\n// TODO(soergel): consider convenience factory functions here\n// in combination with chainable source->dataset above, e.g.:\n// tf.data.url(...).asCsvDataset().shuffle().batch()\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {LazyIterator, OneToManyIterator} from './lazy_iterator';\n\nexport abstract class StringIterator extends LazyIterator {\n /**\n * Splits a string stream on a given separator.\n *\n * It is assumed that the incoming chunk boundaries have no semantic meaning,\n * so conceptually the incoming stream is treated simply as the concatenation\n * of its elements.\n *\n * The outgoing stream provides chunks corresponding to the results of the\n * standard string split() operation (even if such a chunk spanned incoming\n * chunks). The separators are not included.\n *\n * A typical usage is to split a text file (represented as a stream with\n * arbitrary chunk boundaries) into lines.\n *\n * @param upstream A readable stream of strings that can be treated as\n * concatenated.\n * @param separator A character to split on.\n */\n split(separator: string): StringIterator {\n return new SplitIterator(this, separator);\n }\n}\n\n// ============================================================================\n// The following private classes serve to implement the chainable methods\n// on StringIterator. Unfortunately they can't be placed in separate files, due\n// to resulting trouble with circular imports.\n// ============================================================================\n\n// We wanted multiple inheritance, e.g.\n// class SplitIterator extends QueueIterator, StringIterator\n// but the TypeScript mixin approach is a bit hacky, so we take this adapter\n// approach instead.\n\nclass SplitIterator extends StringIterator {\n private impl: SplitIteratorImpl;\n\n constructor(protected upstream: LazyIterator, separator: string) {\n super();\n this.impl = new SplitIteratorImpl(upstream, separator);\n }\n\n summary() {\n return this.impl.summary();\n }\n\n async next() {\n return this.impl.next();\n }\n}\n\nclass SplitIteratorImpl extends OneToManyIterator {\n // A partial string at the end of an upstream chunk\n carryover = '';\n\n constructor(\n protected upstream: LazyIterator, protected separator: string) {\n super();\n }\n\n summary() {\n return `${this.upstream.summary()} -> Split('${this.separator}')`;\n }\n\n async pump(): Promise {\n const chunkResult = await this.upstream.next();\n if (chunkResult.done) {\n if (this.carryover === '') {\n return false;\n }\n\n // Pretend that the pump succeeded in order to emit the small last batch.\n // The next pump() call will actually fail.\n this.outputQueue.push(this.carryover);\n this.carryover = '';\n return true;\n }\n const lines = chunkResult.value.split(this.separator);\n // Note the behavior: \" ab \".split(' ') === ['', 'ab', '']\n // Thus the carryover may be '' if the separator falls on a chunk\n // boundary; this produces the correct result.\n\n lines[0] = this.carryover + lines[0];\n for (const line of lines.slice(0, -1)) {\n this.outputQueue.push(line);\n }\n this.carryover = lines[lines.length - 1];\n\n return true;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {env} from '@tensorflow/tfjs-core';\nimport {LazyIterator, OneToManyIterator} from './lazy_iterator';\nimport {StringIterator} from './string_iterator';\n\nexport abstract class ByteChunkIterator extends LazyIterator {\n /**\n * Decode a stream of UTF8-encoded byte arrays to a stream of strings.\n *\n * The byte arrays producetd from the ByteChunkIterator on which this is\n * called will be interpreted as concatenated. No assumptions are made about\n * the boundaries of the incoming chunks, so a multi-byte UTF8 encoding of a\n * character may span the boundary between chunks. This naturally happens,\n * for instance, when reading fixed-size byte arrays from a file.\n */\n decodeUTF8(): StringIterator {\n return new Utf8Iterator(this);\n }\n}\n\n// ============================================================================\n// The following private classes serve to implement the chainable methods\n// on ByteChunkIterator. Unfortunately they can't be placed in separate files,\n// due to resulting trouble with circular imports.\n// ============================================================================\n\n// We wanted multiple inheritance, e.g.\n// class Utf8Iterator extends QueueIterator, StringIterator\n// but the TypeScript mixin approach is a bit hacky, so we take this adapter\n// approach instead.\n\nclass Utf8Iterator extends StringIterator {\n private impl: Utf8IteratorImpl;\n\n constructor(protected upstream: LazyIterator) {\n super();\n this.impl = new Utf8IteratorImpl(upstream);\n }\n\n summary() {\n return this.impl.summary();\n }\n\n async next() {\n return this.impl.next();\n }\n}\n\n/**\n * Decode a stream of UTF8-encoded byte arrays to a stream of strings.\n *\n * This is tricky because the incoming byte array boundaries may disrupt a\n * multi-byte UTF8 character. Thus any incomplete character data at the end of\n * a chunk must be carried over and prepended to the next chunk before\n * decoding. Luckily with native decoder, TextDecoder in browser and\n * string_decoder in node, byte array boundaries are handled automatically.\n *\n * In the context of an input pipeline for machine learning, UTF8 decoding is\n * needed to parse text files containing training examples or prediction\n * requests (e.g., formatted as CSV or JSON). We cannot use the built-in\n * decoding provided by FileReader.readAsText() because here we are in a\n * streaming context, which FileReader does not support.\n *\n * @param upstream A `LazyIterator` of `Uint8Arrays` containing UTF8-encoded\n * text, which should be interpreted as concatenated. No assumptions are\n * made about the boundaries of the incoming chunks, so a multi-byte UTF8\n * encoding of a character may span the boundary between chunks. This\n * naturally happens, for instance, when reading fixed-size byte arrays from a\n * file.\n */\nclass Utf8IteratorImpl extends OneToManyIterator {\n // `decoder` as `any` here to dynamically assign value based on the\n // environment.\n // tslint:disable-next-line:no-any\n decoder: any;\n\n constructor(protected readonly upstream: LazyIterator) {\n super();\n if (env().get('IS_BROWSER')) {\n this.decoder = new TextDecoder('utf-8');\n } else {\n // tslint:disable-next-line:no-require-imports\n const {StringDecoder} = require('string_decoder');\n this.decoder = new StringDecoder('utf8');\n }\n }\n summary() {\n return `${this.upstream.summary()} -> Utf8`;\n }\n\n async pump(): Promise {\n const chunkResult = await this.upstream.next();\n let chunk;\n if (chunkResult.done) {\n return false;\n } else {\n chunk = chunkResult.value;\n }\n\n let text: string;\n if (env().get('IS_BROWSER')) {\n text = this.decoder.decode(chunk, {stream: true});\n } else {\n text = this.decoder.write(Buffer.from(chunk.buffer));\n }\n this.outputQueue.push(text);\n return true;\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\n// inspired by https://github.com/maxogden/filereader-stream\nimport {env, util} from '@tensorflow/tfjs-core';\nimport {FileElement} from '../types';\nimport {ByteChunkIterator} from './byte_chunk_iterator';\n\nexport interface FileChunkIteratorOptions {\n /** The byte offset at which to begin reading the File or Blob. Default 0. */\n offset?: number;\n /** The number of bytes to read at a time. Default 1MB. */\n chunkSize?: number;\n}\n\n/**\n * Provide a stream of chunks from a File, Blob, or Uint8Array.\n * @param file The source File, Blob or Uint8Array.\n * @param options Optional settings controlling file reading.\n * @returns a lazy Iterator of Uint8Arrays containing sequential chunks of the\n * input File, Blob or Uint8Array.\n */\nexport class FileChunkIterator extends ByteChunkIterator {\n offset: number;\n chunkSize: number;\n\n constructor(\n protected file: FileElement,\n protected options: FileChunkIteratorOptions = {}) {\n super();\n util.assert(\n (file instanceof Uint8Array) ||\n (env().get('IS_BROWSER') ?\n (file instanceof File || file instanceof Blob) :\n false),\n () => 'FileChunkIterator only supports File, Blob and Uint8Array ' +\n 'right now.');\n this.offset = options.offset || 0;\n // default 1MB chunk has tolerable perf on large files\n this.chunkSize = options.chunkSize || 1024 * 1024;\n }\n\n summary() {\n return `FileChunks ${this.file}`;\n }\n\n async next(): Promise> {\n if (this.offset >= ((this.file instanceof Uint8Array) ?\n this.file.byteLength :\n this.file.size)) {\n return {value: null, done: true};\n }\n const chunk = new Promise((resolve, reject) => {\n const end = this.offset + this.chunkSize;\n if (this.file instanceof Uint8Array) {\n // Note if end > this.uint8Array.byteLength, we just get a small last\n // chunk.\n resolve(new Uint8Array(this.file.slice(this.offset, end)));\n } else {\n // This branch assumes that this.file type is File or Blob, which\n // means it is in the browser environment.\n\n // TODO(soergel): is this a performance issue?\n const fileReader = new FileReader();\n fileReader.onload = (event) => {\n let data: string|ArrayBuffer|Uint8Array = fileReader.result;\n // Not sure we can trust the return type of\n // FileReader.readAsArrayBuffer See e.g.\n // https://github.com/node-file-api/FileReader/issues/2\n if (data instanceof ArrayBuffer) {\n data = new Uint8Array(data);\n }\n if (!(data instanceof Uint8Array)) {\n return reject(new TypeError('FileReader returned unknown type.'));\n }\n resolve(data);\n };\n fileReader.onabort = (event) => {\n return reject(new Error('Aborted'));\n };\n fileReader.onerror = (event) => {\n return reject(new Error(event.type));\n };\n // TODO(soergel): better handle onabort, onerror\n // Note if end > this.file.size, we just get a small last chunk.\n const slice = this.file.slice(this.offset, end);\n // We can't use readAsText here (even if we know the file is text)\n // because the slice boundary may fall within a multi-byte character.\n fileReader.readAsArrayBuffer(slice);\n }\n this.offset = end;\n });\n return {value: (await chunk), done: false};\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {util} from '@tensorflow/tfjs-core';\nimport {FileChunkIterator, FileChunkIteratorOptions} from './file_chunk_iterator';\n\n/**\n * Provide a stream of chunks from a URL.\n *\n * Note this class first downloads the entire file into memory before providing\n * the first element from the stream. This is because the Fetch API does not\n * yet reliably provide a reader stream for the response body.\n */\nexport async function urlChunkIterator(\n url: RequestInfo, options: FileChunkIteratorOptions = {}) {\n let urlString;\n let requestInit;\n if ((typeof url) === 'string') {\n urlString = url as string;\n } else {\n urlString = (url as Request).url;\n requestInit = getRequestInitFromRequest(url as Request);\n }\n const response = await util.fetch(urlString, requestInit);\n if (response.ok) {\n const uint8Array = new Uint8Array(await response.arrayBuffer());\n return new FileChunkIterator(uint8Array, options);\n } else {\n throw new Error(response.statusText);\n }\n}\n\n// Generate RequestInit from Request to match tf.util.fetch signature.\nconst getRequestInitFromRequest = (request: Request) => {\n const init = {\n method: request.method,\n headers: request.headers,\n body: request.body,\n mode: request.mode,\n credentials: request.credentials,\n cache: request.cache,\n redirect: request.redirect,\n referrer: request.referrer,\n integrity: request.integrity,\n };\n return init;\n};\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\n// Skip tslint any type check cause this method is aiming to check type of\n// input.\n// tslint:disable-next-line:no-any\nexport function isLocalPath(source: any): boolean {\n return (typeof source === 'string') && source.substr(0, 7) === 'file://';\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {env} from '@tensorflow/tfjs-core';\nimport {DataSource} from '../datasource';\nimport {ByteChunkIterator} from '../iterators/byte_chunk_iterator';\nimport {FileChunkIterator, FileChunkIteratorOptions} from '../iterators/file_chunk_iterator';\nimport {FileElement} from '../types';\nimport {isLocalPath} from '../util/source_util';\n\n/**\n * Represents a file, blob, or Uint8Array readable as a stream of binary data\n * chunks.\n */\nexport class FileDataSource extends DataSource {\n /**\n * Create a `FileDataSource`.\n *\n * @param input Local file path, or `File`/`Blob`/`Uint8Array` object to\n * read. Local file only works in node environment.\n * @param options Options passed to the underlying `FileChunkIterator`s,\n * such as {chunksize: 1024}.\n */\n constructor(\n protected input: FileElement|string,\n protected readonly options: FileChunkIteratorOptions = {}) {\n super();\n }\n\n async iterator(): Promise {\n if (isLocalPath(this.input) && env().get('IS_NODE')) {\n // tslint:disable-next-line:no-require-imports\n const fs = require('fs');\n this.input = fs.readFileSync((this.input as string).substr(7));\n }\n // TODO(kangyizhang): Add LocalFileChunkIterator to split local streaming\n // with file in browser.\n return new FileChunkIterator(this.input as FileElement, this.options);\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {DataSource} from '../datasource';\nimport {ByteChunkIterator} from '../iterators/byte_chunk_iterator';\nimport {FileChunkIteratorOptions} from '../iterators/file_chunk_iterator';\nimport {urlChunkIterator} from '../iterators/url_chunk_iterator';\nimport {isLocalPath} from '../util/source_util';\nimport {FileDataSource} from './file_data_source';\n\n/*\n * Represents a URL readable as a stream of binary data chunks.\n */\nexport class URLDataSource extends DataSource {\n /**\n * Create a `URLDataSource`.\n *\n * @param url A source URL string, or a `Request` object.\n * @param options Options passed to the underlying `FileChunkIterator`s,\n * such as {chunksize: 1024}.\n */\n constructor(\n protected readonly url: RequestInfo,\n protected readonly fileOptions: FileChunkIteratorOptions = {}) {\n super();\n }\n\n // TODO(soergel): provide appropriate caching options. Currently this\n // will download the URL anew for each call to iterator(). Since we have\n // to treat the downloaded file as a blob/buffer anyway, we may as well retain\n // it-- but that raises GC issues. Also we may want a persistent disk cache.\n async iterator(): Promise {\n if (isLocalPath(this.url)) {\n return (new FileDataSource(this.url as string, this.fileOptions))\n .iterator();\n } else {\n return urlChunkIterator(this.url, this.fileOptions);\n }\n }\n}\n","/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {TensorContainer} from '@tensorflow/tfjs-core';\nimport {Dataset, datasetFromIteratorFn} from './dataset';\nimport {CSVDataset} from './datasets/csv_dataset';\nimport {iteratorFromFunction} from './iterators/lazy_iterator';\nimport {MicrophoneIterator} from './iterators/microphone_iterator';\nimport {WebcamIterator} from './iterators/webcam_iterator';\nimport {URLDataSource} from './sources/url_data_source';\nimport {CSVConfig, MicrophoneConfig, WebcamConfig} from './types';\n\n/**\n * Create a `CSVDataset` by reading and decoding CSV file(s) from provided URL\n * or local path if it's in Node environment.\n *\n * Note: If isLabel in columnConfigs is `true` for at least one column, the\n * element in returned `CSVDataset` will be an object of\n * `{xs:features, ys:labels}`: xs is a dict of features key/value pairs, ys\n * is a dict of labels key/value pairs. If no column is marked as label,\n * returns a dict of features only.\n *\n * ```js\n * const csvUrl =\n * 'https://storage.googleapis.com/tfjs-examples/multivariate-linear-regression/data/boston-housing-train.csv';\n *\n * async function run() {\n * // We want to predict the column \"medv\", which represents a median value of\n * // a home (in $1000s), so we mark it as a label.\n * const csvDataset = tf.data.csv(\n * csvUrl, {\n * columnConfigs: {\n * medv: {\n * isLabel: true\n * }\n * }\n * });\n *\n * // Number of features is the number of column names minus one for the label\n * // column.\n * const numOfFeatures = (await csvDataset.columnNames()).length - 1;\n *\n * // Prepare the Dataset for training.\n * const flattenedDataset =\n * csvDataset\n * .map(({xs, ys}) =>\n * {\n * // Convert xs(features) and ys(labels) from object form (keyed by\n * // column name) to array form.\n * return {xs:Object.values(xs), ys:Object.values(ys)};\n * })\n * .batch(10);\n *\n * // Define the model.\n * const model = tf.sequential();\n * model.add(tf.layers.dense({\n * inputShape: [numOfFeatures],\n * units: 1\n * }));\n * model.compile({\n * optimizer: tf.train.sgd(0.000001),\n * loss: 'meanSquaredError'\n * });\n *\n * // Fit the model using the prepared Dataset\n * return model.fitDataset(flattenedDataset, {\n * epochs: 10,\n * callbacks: {\n * onEpochEnd: async (epoch, logs) => {\n * console.log(epoch + ':' + logs.loss);\n * }\n * }\n * });\n * }\n *\n * await run();\n * ```\n *\n * @param source URL or local path to get CSV file. If it's a local path, it\n * must have prefix `file://` and it only works in node environment.\n * @param csvConfig (Optional) A CSVConfig object that contains configurations\n * of reading and decoding from CSV file(s).\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * configParamIndices: [1]\n * }\n */\nexport function csv(\n source: RequestInfo, csvConfig: CSVConfig = {}): CSVDataset {\n return new CSVDataset(new URLDataSource(source), csvConfig);\n}\n\n/**\n * Create a `Dataset` that produces each element by calling a provided function.\n *\n * Note that repeated iterations over this `Dataset` may produce different\n * results, because the function will be called anew for each element of each\n * iteration.\n *\n * Also, beware that the sequence of calls to this function may be out of order\n * in time with respect to the logical order of the Dataset. This is due to the\n * asynchronous lazy nature of stream processing, and depends on downstream\n * transformations (e.g. .shuffle()). If the provided function is pure, this is\n * no problem, but if it is a closure over a mutable state (e.g., a traversal\n * pointer), then the order of the produced elements may be scrambled.\n *\n * ```js\n * let i = -1;\n * const func = () =>\n * ++i < 5 ? {value: i, done: false} : {value: null, done: true};\n * const ds = tf.data.func(func);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * @param f A function that produces one data element on each call.\n */\nexport function func(\n f: () => IteratorResult| Promise>): Dataset {\n const iter = iteratorFromFunction(f);\n return datasetFromIteratorFn(async () => iter);\n}\n\n/**\n * Create a `Dataset` that produces each element from provided JavaScript\n * generator, which is a function*\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions),\n * or a function that returns an\n * iterator\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions).\n *\n * The returned iterator should have `.next()` function that returns element in\n * format of `{value: TensorContainer, done:boolean}`.\n *\n * Example of creating a dataset from an iterator factory:\n * ```js\n * function makeIterator() {\n * const numElements = 10;\n * let index = 0;\n *\n * const iterator = {\n * next: () => {\n * let result;\n * if (index < numElements) {\n * result = {value: index, done: false};\n * index++;\n * return result;\n * }\n * return {value: index, done: true};\n * }\n * };\n * return iterator;\n * }\n * const ds = tf.data.generator(makeIterator);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * Example of creating a dataset from a generator:\n * ```js\n * function* dataGenerator() {\n * const numElements = 10;\n * let index = 0;\n * while (index < numElements) {\n * const x = index;\n * index++;\n * yield x;\n * }\n * }\n *\n * const ds = tf.data.generator(dataGenerator);\n * await ds.forEachAsync(e => console.log(e));\n * ```\n *\n * @param generator A Javascript generator function that returns a JavaScript\n * iterator.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * configParamIndices: [1]\n * }\n */\nexport function generator(\n generator: () => Iterator| Promise>): Dataset {\n return datasetFromIteratorFn(async () => {\n const gen = await generator();\n return iteratorFromFunction(() => gen.next());\n });\n}\n\n/**\n * Create an iterator that generate `Tensor`s from webcam video stream. This API\n * only works in Browser environment when the device has webcam.\n *\n * Note: this code snippet only works when the device has a webcam. It will\n * request permission to open the webcam when running.\n * ```js\n * const videoElement = document.createElement('video');\n * videoElement.width = 100;\n * videoElement.height = 100;\n * const cam = await tf.data.webcam(videoElement);\n * const img = await cam.capture();\n * img.print();\n * cam.stop();\n * ```\n *\n * @param webcamVideoElement A `HTMLVideoElement` used to play video from\n * webcam. If this element is not provided, a hidden `HTMLVideoElement` will\n * be created. In that case, `resizeWidth` and `resizeHeight` must be\n * provided to set the generated tensor shape.\n * @param webcamConfig A `WebcamConfig` object that contains configurations of\n * reading and manipulating data from webcam video stream.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * ignoreCI: true\n * }\n */\nexport async function webcam(\n webcamVideoElement?: HTMLVideoElement,\n webcamConfig?: WebcamConfig): Promise {\n return WebcamIterator.create(webcamVideoElement, webcamConfig);\n}\n\n/**\n * Create an iterator that generate frequency-domain spectrogram `Tensor`s from\n * microphone audio stream with browser's native FFT. This API only works in\n * browser environment when the device has microphone.\n *\n * Note: this code snippet only works when the device has a microphone. It will\n * request permission to open the microphone when running.\n * ```js\n * const mic = await tf.data.microphone({\n * fftSize: 1024,\n * columnTruncateLength: 232,\n * numFramesPerSpectrogram: 43,\n * sampleRateHz:44100,\n * includeSpectrogram: true,\n * includeWaveform: true\n * });\n * const audioData = await mic.capture();\n * const spectrogramTensor = audioData.spectrogram;\n * spectrogramTensor.print();\n * const waveformTensor = audioData.waveform;\n * waveformTensor.print();\n * mic.stop();\n * ```\n *\n * @param microphoneConfig A `MicrophoneConfig` object that contains\n * configurations of reading audio data from microphone.\n *\n * @doc {\n * heading: 'Data',\n * subheading: 'Creation',\n * namespace: 'data',\n * ignoreCI: true\n * }\n */\nexport async function microphone(microphoneConfig?: MicrophoneConfig):\n Promise {\n return MicrophoneIterator.create(microphoneConfig);\n}\n","/** @license See the LICENSE file. */\n\n// This code is auto-generated, do not modify this file!\nconst version = '3.6.0';\nexport {version};\n"],"names":["this","define","sr","tf.util","tf.Tensor","tslib_1.__extends","tf.dispose","tf.tensor_util","seedrandom.alea","tf.tidy","tf.stack","tf.tensor","util","env","tensor","tensor1d","tensor2d","browser","tidy","expandDims","cast","image","reshape"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;AAClC;AACA,SAAS,IAAI,CAAC,IAAI,EAAE;AACpB,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,CAAC;AAC/B;AACA,EAAE,EAAE,CAAC,IAAI,GAAG,WAAW;AACvB,IAAI,IAAI,CAAC,GAAG,OAAO,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,sBAAsB,CAAC;AAC5D,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;AAClB,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC;AAClB,IAAI,OAAO,EAAE,CAAC,EAAE,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;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A4DgB,SAAS,CACrB,SAAkD;IADtD,iBAMC;IAJC,OAAO,qBAAqB,CAAC;;;;wBACf,qBAAM,SAAS,EAAE,EAAA;;oBAAvB,GAAG,GAAG,SAAiB;oBAC7B,sBAAO,oBAAoB,CAAC,cAAM,OAAA,GAAG,CAAC,IAAI,EAAE,GAAA,CAAC,EAAC;;;SAC/C,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA8BsB,MAAM,CACxB,kBAAqC,EACrC,YAA2B;;;YAC7B,sBAAO,cAAc,CAAC,MAAM,CAAC,kBAAkB,EAAE,YAAY,CAAC,EAAC;;;CAChE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAkCsB,UAAU,CAAC,gBAAmC;;;YAElE,sBAAO,kBAAkB,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAC;;;;;ACxRrD;AAEA;IACM,OAAO,GAAG;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tsconfig.tsbuildinfo b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tsconfig.tsbuildinfo deleted file mode 100644 index e4099eb0f..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/tsconfig.tsbuildinfo +++ /dev/null @@ -1,6041 +0,0 @@ -{ - "program": { - "fileInfos": { - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es5.d.ts": { - "version": "1f753cee573dea40df8a9dc873fef5566957b19ad513874f6643d8dfb14842d0", - "signature": "1f753cee573dea40df8a9dc873fef5566957b19ad513874f6643d8dfb14842d0" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2015.d.ts": { - "version": "7994d44005046d1413ea31d046577cdda33b8b2470f30281fd9c8b3c99fe2d96", - "signature": "7994d44005046d1413ea31d046577cdda33b8b2470f30281fd9c8b3c99fe2d96" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2016.d.ts": { - "version": "5f217838d25704474d9ef93774f04164889169ca31475fe423a9de6758f058d1", - "signature": "5f217838d25704474d9ef93774f04164889169ca31475fe423a9de6758f058d1" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2017.d.ts": { - "version": "459097c7bdd88fc5731367e56591e4f465f2c9de81a35427a7bd473165c34743", - "signature": "459097c7bdd88fc5731367e56591e4f465f2c9de81a35427a7bd473165c34743" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2018.d.ts": { - "version": "2edd3ddf436ef8e12df876dcae4ecd6a8748577944c477bf4b20d5596e0c9843", - "signature": "2edd3ddf436ef8e12df876dcae4ecd6a8748577944c477bf4b20d5596e0c9843" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.dom.d.ts": { - "version": "973df4e41aea3780ce77073777d37dd5896f684124f4c42409f3a832133837a4", - "signature": "973df4e41aea3780ce77073777d37dd5896f684124f4c42409f3a832133837a4" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2015.core.d.ts": { - "version": "2a0390a665763bcc90f0670e43c587928d8fefe2a94a11209c1e22cba7b09f52", - "signature": "2a0390a665763bcc90f0670e43c587928d8fefe2a94a11209c1e22cba7b09f52" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2015.collection.d.ts": { - "version": "dd94d8ef48c562389eb58af8df3a3a34d11367f7c818192aa5f16470d469e3f0", - "signature": "dd94d8ef48c562389eb58af8df3a3a34d11367f7c818192aa5f16470d469e3f0" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2015.generator.d.ts": { - "version": "828413486bdcaa342558e8e4570b1b287b776cb61b4b70b0214bd10c5d9a94c3", - "signature": "828413486bdcaa342558e8e4570b1b287b776cb61b4b70b0214bd10c5d9a94c3" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2015.iterable.d.ts": { - "version": "6c9f73334f8bf47aea685ca5b46a8f7e992a223e96fbceb030f26a4d2324ba21", - "signature": "6c9f73334f8bf47aea685ca5b46a8f7e992a223e96fbceb030f26a4d2324ba21" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2015.promise.d.ts": { - "version": "e6b8ff2798f8ebd7a1c7afd8671f2cb67ee1901c422f5964d74b0b34c6574ea2", - "signature": "e6b8ff2798f8ebd7a1c7afd8671f2cb67ee1901c422f5964d74b0b34c6574ea2" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2015.proxy.d.ts": { - "version": "5e72f949a89717db444e3bd9433468890068bb21a5638d8ab15a1359e05e54fe", - "signature": "5e72f949a89717db444e3bd9433468890068bb21a5638d8ab15a1359e05e54fe" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2015.reflect.d.ts": { - "version": "f5b242136ae9bfb1cc99a5971cccc44e99947ae6b5ef6fd8aa54b5ade553b976", - "signature": "f5b242136ae9bfb1cc99a5971cccc44e99947ae6b5ef6fd8aa54b5ade553b976" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2015.symbol.d.ts": { - "version": "9ae2860252d6b5f16e2026d8a2c2069db7b2a3295e98b6031d01337b96437230", - "signature": "9ae2860252d6b5f16e2026d8a2c2069db7b2a3295e98b6031d01337b96437230" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts": { - "version": "3e0a459888f32b42138d5a39f706ff2d55d500ab1031e0988b5568b0f67c2303", - "signature": "3e0a459888f32b42138d5a39f706ff2d55d500ab1031e0988b5568b0f67c2303" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2016.array.include.d.ts": { - "version": "3f96f1e570aedbd97bf818c246727151e873125d0512e4ae904330286c721bc0", - "signature": "3f96f1e570aedbd97bf818c246727151e873125d0512e4ae904330286c721bc0" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2017.object.d.ts": { - "version": "ff8ad203e83338289b0f5defc1a5b5c253fb7d251b464db497383f915a0df3f4", - "signature": "ff8ad203e83338289b0f5defc1a5b5c253fb7d251b464db497383f915a0df3f4" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts": { - "version": "b8667586a618c5cf64523d4e500ae39e781428abfb28f3de441fc66b56144b6f", - "signature": "b8667586a618c5cf64523d4e500ae39e781428abfb28f3de441fc66b56144b6f" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2017.string.d.ts": { - "version": "21df2e0059f14dcb4c3a0e125859f6b6ff01332ee24b0065a741d121250bc71c", - "signature": "21df2e0059f14dcb4c3a0e125859f6b6ff01332ee24b0065a741d121250bc71c" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2017.intl.d.ts": { - "version": "c1759cb171c7619af0d2234f2f8fb2a871ee88e956e2ed91bb61778e41f272c6", - "signature": "c1759cb171c7619af0d2234f2f8fb2a871ee88e956e2ed91bb61778e41f272c6" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts": { - "version": "28569d59e07d4378cb3d54979c4c60f9f06305c9bb6999ffe6cab758957adc46", - "signature": "28569d59e07d4378cb3d54979c4c60f9f06305c9bb6999ffe6cab758957adc46" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts": { - "version": "42102aaeb1bfec213be1e9777466a6d551eeba8567fed18c0cdbca8c35e3c6e4", - "signature": "42102aaeb1bfec213be1e9777466a6d551eeba8567fed18c0cdbca8c35e3c6e4" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2018.intl.d.ts": { - "version": "1b820b57379c726f94af50cd60053674af53ff9d079c1563cc70071e8b757dd0", - "signature": "1b820b57379c726f94af50cd60053674af53ff9d079c1563cc70071e8b757dd0" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2018.promise.d.ts": { - "version": "efe049114bad1035b0aa9a4a0359f50ab776e3897c411521e51d3013079cbd62", - "signature": "efe049114bad1035b0aa9a4a0359f50ab776e3897c411521e51d3013079cbd62" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2018.regexp.d.ts": { - "version": "e7780d04cd4120ee554c665829db2bbdd6b947cbaa3c150b7d9ea74df3beb2e8", - "signature": "e7780d04cd4120ee554c665829db2bbdd6b947cbaa3c150b7d9ea74df3beb2e8" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.esnext.intl.d.ts": { - "version": "f6e0c89daaf72eac38dfb1d5ef0972183f7f26a68da15bfe5bcb7cfccf0c7db8", - "signature": "f6e0c89daaf72eac38dfb1d5ef0972183f7f26a68da15bfe5bcb7cfccf0c7db8" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.esnext.bigint.d.ts": { - "version": "63b66918290d794f73832a6d0325be5026236674fe8c0cb0b68d162000d7bbe8", - "signature": "63b66918290d794f73832a6d0325be5026236674fe8c0cb0b68d162000d7bbe8" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts": { - "version": "46aa64ffc74a2023fc61676fe443f427674b35c9f5202fdc12925a58b0f96881", - "signature": "46aa64ffc74a2023fc61676fe443f427674b35c9f5202fdc12925a58b0f96881" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts": { - "version": "9c6270c22ed2fd502944edb4c73c4f9f6fb099f3dffc261742af0fbaf0c298e5", - "signature": "9c6270c22ed2fd502944edb4c73c4f9f6fb099f3dffc261742af0fbaf0c298e5" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts": { - "version": "bd755aadfff454a975ca3d84762a238443317440a739ad72d461c9dcc20d6315", - "signature": "bd755aadfff454a975ca3d84762a238443317440a739ad72d461c9dcc20d6315" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts": { - "version": "46eb8555f7562d27f0284e187c66375dfa466565f5a024540c3633c4b6c45ade", - "signature": "46eb8555f7562d27f0284e187c66375dfa466565f5a024540c3633c4b6c45ade" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts": { - "version": "37886fa4c9c0b9e8f4e29ad4dcf2c2e6b650d500c5c177549ddd523a13f40299", - "signature": "37886fa4c9c0b9e8f4e29ad4dcf2c2e6b650d500c5c177549ddd523a13f40299" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts": { - "version": "166ff3d6766067f70bb4a94d4cf7a309084089492a6c8ac6005f0431b7491980", - "signature": "166ff3d6766067f70bb4a94d4cf7a309084089492a6c8ac6005f0431b7491980" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts": { - "version": "83d637d2b47af0be47ab3b047c62c1d58a7d30683a2620a775c9c155c56ca8bd", - "signature": "83d637d2b47af0be47ab3b047c62c1d58a7d30683a2620a775c9c155c56ca8bd" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tape.d.ts": { - "version": "9ca6d52be56e7b1719c96e6823f8e03e5176b313cde1b1c37ea5569ecb2911ee", - "signature": "9ca6d52be56e7b1719c96e6823f8e03e5176b313cde1b1c37ea5569ecb2911ee" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts": { - "version": "7ad65c44d024034a29b45f0fb1cd82027f765df4ad91a836edb13019c7cc05a9", - "signature": "7ad65c44d024034a29b45f0fb1cd82027f765df4ad91a836edb13019c7cc05a9" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts": { - "version": "5d4bce83c8c039b4323b388891f3faf85fb03c4b32badf3c04755edbd1308374", - "signature": "5d4bce83c8c039b4323b388891f3faf85fb03c4b32badf3c04755edbd1308374" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts": { - "version": "3ee5f0b447d1dde52f0e1b45b17e07e059f85bf46cc883e0de1f7d22cf7e0157", - "signature": "3ee5f0b447d1dde52f0e1b45b17e07e059f85bf46cc883e0de1f7d22cf7e0157" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_browser.d.ts": { - "version": "de7baa577b8c83a6d4d6c5a32d882f2839dbabf7bb4a04675406307b403d5abc", - "signature": "de7baa577b8c83a6d4d6c5a32d882f2839dbabf7bb4a04675406307b403d5abc" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_node.d.ts": { - "version": "839d71de94b938163365c2402f68c8cd97527b77aa6bb4b16a7346bd04a70bc7", - "signature": "839d71de94b938163365c2402f68c8cd97527b77aa6bb4b16a7346bd04a70bc7" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/base_side_effects.d.ts": { - "version": "e72298820cb11c7a6aae36b4e47b49859d9264b073d95266b814f93b5f718454", - "signature": "e72298820cb11c7a6aae36b4e47b49859d9264b073d95266b814f93b5f718454" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts": { - "version": "99200727d5ba3db7d7ef5ae08581d09ab2cabafb08a79244c769eea33e9c6492", - "signature": "99200727d5ba3db7d7ef5ae08581d09ab2cabafb08a79244c769eea33e9c6492" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.d.ts": { - "version": "98001c77050f27688a389a806fa7849f2315433af382b2f371a1a7fed0b292e0", - "signature": "98001c77050f27688a389a806fa7849f2315433af382b2f371a1a7fed0b292e0" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.d.ts": { - "version": "f812888e553ccf2d9408cd2d1c6aa98c978c577e1f5321df491f754ff11bc1e2", - "signature": "f812888e553ccf2d9408cd2d1c6aa98c978c577e1f5321df491f754ff11bc1e2" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.d.ts": { - "version": "05d0d19679586a95ac3d7859c26f27dd6bf3fcdb5f88adcab511b9c04eee8d26", - "signature": "05d0d19679586a95ac3d7859c26f27dd6bf3fcdb5f88adcab511b9c04eee8d26" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/http.d.ts": { - "version": "af2ae3879b3a86e8a34d2c674e18b3a0bcb4504ce5b09636c31ec2f43017dc31", - "signature": "af2ae3879b3a86e8a34d2c674e18b3a0bcb4504ce5b09636c31ec2f43017dc31" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.d.ts": { - "version": "f1882e3746a788d1f414cd87c1c0033dfb40debc11b80b492550652f023321bf", - "signature": "f1882e3746a788d1f414cd87c1c0033dfb40debc11b80b492550652f023321bf" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.d.ts": { - "version": "744647b3ddeec13aa5f2661a9bf5e072ddaf6c064dfcc2416b8ed3c8aa1ee5f2", - "signature": "744647b3ddeec13aa5f2661a9bf5e072ddaf6c064dfcc2416b8ed3c8aa1ee5f2" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.d.ts": { - "version": "387563640750ecfdd8b56b586b4b0798ce18da1f2a8afe844dbf1c462b88aea8", - "signature": "387563640750ecfdd8b56b586b4b0798ce18da1f2a8afe844dbf1c462b88aea8" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/model_management.d.ts": { - "version": "46947a1ecdb3edf95d8b9a57efc4e9ca39a1477997dfe198e4ffa80a256506ae", - "signature": "46947a1ecdb3edf95d8b9a57efc4e9ca39a1477997dfe198e4ffa80a256506ae" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/io.d.ts": { - "version": "50fe9645e4eba88752608b6aefd21c7347f7a9abccb15e4fef4c9b6a413e2fcc", - "signature": "50fe9645e4eba88752608b6aefd21c7347f7a9abccb15e4fef4c9b6a413e2fcc" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/confusion_matrix.d.ts": { - "version": "bd9f822fd8e9f16d0603dadce0a6ea05983d0fea785cb602cea1386f9666978b", - "signature": "bd9f822fd8e9f16d0603dadce0a6ea05983d0fea785cb602cea1386f9666978b" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/math.d.ts": { - "version": "d51a44d1afcfd4638aaab82384847e5b88da7b73746e5ffe319f2718cfa91216", - "signature": "d51a44d1afcfd4638aaab82384847e5b88da7b73746e5ffe319f2718cfa91216" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/browser.d.ts": { - "version": "2360ed10ebccb78f8bb6ec31383706be73cac17e1461d282daff4d7ef3a3b0ff", - "signature": "2360ed10ebccb78f8bb6ec31383706be73cac17e1461d282daff4d7ef3a3b0ff" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd_util.d.ts": { - "version": "39cdbc5ab4bd5857ef31c1da13cdce3360f78800d018322e8a2f3c653d4bb85b", - "signature": "39cdbc5ab4bd5857ef31c1da13cdce3360f78800d018322e8a2f3c653d4bb85b" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd_util.d.ts": { - "version": "87364ce9c2a44e0f2efee198c622af5fb8a2e16093ca3b1f25577a6dd9e6f6fb", - "signature": "87364ce9c2a44e0f2efee198c622af5fb8a2e16093ca3b1f25577a6dd9e6f6fb" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.d.ts": { - "version": "3855c1a5dd5d4c2b26af99030d2812981d3952e23c55f2327cd393e2d082fe23", - "signature": "3855c1a5dd5d4c2b26af99030d2812981d3952e23c55f2327cd393e2d082fe23" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts": { - "version": "6fbfb7e78de77b645bd9c40030c07abe7647d001e7f0c069bb7a33e6f9f31b1a", - "signature": "6fbfb7e78de77b645bd9c40030c07abe7647d001e7f0c069bb7a33e6f9f31b1a" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_util.d.ts": { - "version": "4a05690f4f0f7ecf0bf9fd9847833f0c75a209835f156efe184efa4b2954aad8", - "signature": "4a05690f4f0f7ecf0bf9fd9847833f0c75a209835f156efe184efa4b2954aad8" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/test_util.d.ts": { - "version": "3e6823951be7cd1589ea8f439803ffd5db6066012e6f1009e580dd64e5ceef44", - "signature": "3e6823951be7cd1589ea8f439803ffd5db6066012e6f1009e580dd64e5ceef44" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/util_base.d.ts": { - "version": "71a759231eaed7da76deaeec72584243dd03b3b2fa2ede30cb628ba0b624e901", - "signature": "71a759231eaed7da76deaeec72584243dd03b3b2fa2ede30cb628ba0b624e901" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/util.d.ts": { - "version": "1dccee149020f2e3cc35ae782c6e6d97a5edaf1e87002a5a7bd15474e9e1a554", - "signature": "1dccee149020f2e3cc35ae782c6e6d97a5edaf1e87002a5a7bd15474e9e1a554" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/version.d.ts": { - "version": "6a4911ec90ecea7527148d73599b8b40708772c2b8592df3bfb951d440857741", - "signature": "6a4911ec90ecea7527148d73599b8b40708772c2b8592df3bfb951d440857741" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/model_types.d.ts": { - "version": "3ad2f8df17e95c8e942a08c6877044f2cce4a018190e458ba1bc5f11c3fa9e76", - "signature": "3ad2f8df17e95c8e942a08c6877044f2cce4a018190e458ba1bc5f11c3fa9e76" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts": { - "version": "7d5ee92406c6d72cad7eeb5d2cbc179185470eb9c7facb460c1c1c074a06118f", - "signature": "7d5ee92406c6d72cad7eeb5d2cbc179185470eb9c7facb460c1c1c074a06118f" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.d.ts": { - "version": "b7cc9c8939f0f9a10c9bfa0bfb7089ed048a93453c7e6c0a358263fddf914b8d", - "signature": "b7cc9c8939f0f9a10c9bfa0bfb7089ed048a93453c7e6c0a358263fddf914b8d" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.d.ts": { - "version": "bbe6bf6957271a185e1e3d8277c7a428b19bd9c9ec0dc804019e475609c90ecf", - "signature": "bbe6bf6957271a185e1e3d8277c7a428b19bd9c9ec0dc804019e475609c90ecf" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.d.ts": { - "version": "a271e976d69e21ab7cb6c221aa87ee6075e4efe7ede0b300a34f26d1425e2a6d", - "signature": "a271e976d69e21ab7cb6c221aa87ee6075e4efe7ede0b300a34f26d1425e2a6d" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.d.ts": { - "version": "a526cbdb8a9d4f6a7a9755922c85d5a8feeae49e476db26d50cd0cbd217b3a75", - "signature": "a526cbdb8a9d4f6a7a9755922c85d5a8feeae49e476db26d50cd0cbd217b3a75" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts": { - "version": "9d99cfcec5c201212c1160bb8f7d0f931a618b917ca3e468bcc8613b6d571565", - "signature": "9d99cfcec5c201212c1160bb8f7d0f931a618b917ca3e468bcc8613b6d571565" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.d.ts": { - "version": "fe9c3f5a65501accc1253a86e1547111a23fee26396ac24c1e02d1d606b7b296", - "signature": "fe9c3f5a65501accc1253a86e1547111a23fee26396ac24c1e02d1d606b7b296" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.d.ts": { - "version": "9e9e810595867a84fa0ef7e72a53bb4d9895f09640b972263729eef7bba93101", - "signature": "9e9e810595867a84fa0ef7e72a53bb4d9895f09640b972263729eef7bba93101" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/abs.d.ts": { - "version": "8b529d7700246abd74c27e726f25208c90099cbe8a6223e274a897e5cde09168", - "signature": "8b529d7700246abd74c27e726f25208c90099cbe8a6223e274a897e5cde09168" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/acos.d.ts": { - "version": "1c5d6481a5edaa76aed6044202de7839a6969c20c87ad39796d93da9ac313eac", - "signature": "1c5d6481a5edaa76aed6044202de7839a6969c20c87ad39796d93da9ac313eac" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/acosh.d.ts": { - "version": "c06f17c10437887aacbeefea50ade0a2bf1827e9aca3ccb8bdf5ad8d2bab8f8e", - "signature": "c06f17c10437887aacbeefea50ade0a2bf1827e9aca3ccb8bdf5ad8d2bab8f8e" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/add.d.ts": { - "version": "16255eefce61ab566f106c8644f9379a2994293ef9eec51b9b9ecfbf5e0474b6", - "signature": "16255eefce61ab566f106c8644f9379a2994293ef9eec51b9b9ecfbf5e0474b6" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/add_n.d.ts": { - "version": "70e9b3d95493df68655cbc2269d625ef13d95c2bf61011497df857319063a533", - "signature": "70e9b3d95493df68655cbc2269d625ef13d95c2bf61011497df857319063a533" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/all.d.ts": { - "version": "41aee4b49ff23d473076865f29ce1a5f699804bbf1af38780db1b92bcbaec0b7", - "signature": "41aee4b49ff23d473076865f29ce1a5f699804bbf1af38780db1b92bcbaec0b7" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/any.d.ts": { - "version": "c30164e2cd8babba16cad34d0cede15e7ffc592fc6500357b9003591330fa387", - "signature": "c30164e2cd8babba16cad34d0cede15e7ffc592fc6500357b9003591330fa387" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/arg_max.d.ts": { - "version": "1756398317f965b0b480dee48b19009c1fd9f4a7c3403f3a45e37619e649c726", - "signature": "1756398317f965b0b480dee48b19009c1fd9f4a7c3403f3a45e37619e649c726" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/arg_min.d.ts": { - "version": "22049afccdb7f88e4ee8d98003c9470634b2cbeb844c369de7d7f98bce498ce1", - "signature": "22049afccdb7f88e4ee8d98003c9470634b2cbeb844c369de7d7f98bce498ce1" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/asin.d.ts": { - "version": "c5d41708554b67eaf4d5afb66b281d89192466129ae84aad5efcc026defe310a", - "signature": "c5d41708554b67eaf4d5afb66b281d89192466129ae84aad5efcc026defe310a" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/asinh.d.ts": { - "version": "6705de067a5dcaaf5774ac8e4e58fe2096b873133d4c8288af005dce6346fbc9", - "signature": "6705de067a5dcaaf5774ac8e4e58fe2096b873133d4c8288af005dce6346fbc9" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/atan.d.ts": { - "version": "fa35fc2d299ae5a21efb116b1d6e3a8dcb94e5ccd1599282491442d9224b84c9", - "signature": "fa35fc2d299ae5a21efb116b1d6e3a8dcb94e5ccd1599282491442d9224b84c9" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/atan2.d.ts": { - "version": "5eebeacdef0d21c0826bee2f245bb2c176c4a865581cd6cfa0e5da896be588d5", - "signature": "5eebeacdef0d21c0826bee2f245bb2c176c4a865581cd6cfa0e5da896be588d5" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/atanh.d.ts": { - "version": "339f35c841141467b641e173bb2870c353ef41b9864b6b5437d22b47b43aedbc", - "signature": "339f35c841141467b641e173bb2870c353ef41b9864b6b5437d22b47b43aedbc" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool.d.ts": { - "version": "4779f347053b580e22586d955898d393f8790f0e1612e608ae3f53d3ec67cd98", - "signature": "4779f347053b580e22586d955898d393f8790f0e1612e608ae3f53d3ec67cd98" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d.d.ts": { - "version": "cb7c2a998a0a8205b702a71ddaaf64c8693a54b3f381c089c0f085b59634ca89", - "signature": "cb7c2a998a0a8205b702a71ddaaf64c8693a54b3f381c089c0f085b59634ca89" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/basic_lstm_cell.d.ts": { - "version": "bd35a19b9b71b2e7c3e1f5f619fb1c75955223bd32f5a9e1478e208377a17525", - "signature": "bd35a19b9b71b2e7c3e1f5f619fb1c75955223bd32f5a9e1478e208377a17525" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batch_to_space_nd.d.ts": { - "version": "ffa4d5d173432ca8701eaa7635a02803d470e81e0b352bc82bf26100fa1f1067", - "signature": "ffa4d5d173432ca8701eaa7635a02803d470e81e0b352bc82bf26100fa1f1067" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.d.ts": { - "version": "894504eb4eb70a3166a70257958965778d83c6a37936d0750f4faff297b1142b", - "signature": "894504eb4eb70a3166a70257958965778d83c6a37936d0750f4faff297b1142b" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm2d.d.ts": { - "version": "7e3c55b68d42b5f39d32e067713cc85e4ae7116effa9e447e31cc00506ebf963", - "signature": "7e3c55b68d42b5f39d32e067713cc85e4ae7116effa9e447e31cc00506ebf963" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm3d.d.ts": { - "version": "d3ec33f64f7fbc36fd90e1c99033355fd07692315cbe929370912b6c5d16be5c", - "signature": "d3ec33f64f7fbc36fd90e1c99033355fd07692315cbe929370912b6c5d16be5c" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm4d.d.ts": { - "version": "6357cdab9aea5171cda9cc358bb3ddbb07e0b032ced4f613c65eb40b946c0b5b", - "signature": "6357cdab9aea5171cda9cc358bb3ddbb07e0b032ced4f613c65eb40b946c0b5b" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/bincount.d.ts": { - "version": "5b4cc9623078814ec76d1b5963732795832004e051a615f8cb7687ab6eed6617", - "signature": "5b4cc9623078814ec76d1b5963732795832004e051a615f8cb7687ab6eed6617" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.d.ts": { - "version": "827e6bbc08cb73b35752331a18ff6692aaa22b564be9498b8e137a80e25c6c31", - "signature": "827e6bbc08cb73b35752331a18ff6692aaa22b564be9498b8e137a80e25c6c31" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/buffer.d.ts": { - "version": "569161c1629b6e22081a2e5f2551e6bc50243ebe3246bf6342916b1ceffa0b69", - "signature": "569161c1629b6e22081a2e5f2551e6bc50243ebe3246bf6342916b1ceffa0b69" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cast.d.ts": { - "version": "cae32150a86f1cd3e202e9b9033ae4e8203d0b36e207fc61017060213f1d830f", - "signature": "cae32150a86f1cd3e202e9b9033ae4e8203d0b36e207fc61017060213f1d830f" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ceil.d.ts": { - "version": "901cb6f2c15e727dd5a4de0dfb07947abd1ae45954fde1678ca91f40ff561d9d", - "signature": "901cb6f2c15e727dd5a4de0dfb07947abd1ae45954fde1678ca91f40ff561d9d" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.d.ts": { - "version": "aac14cd580be19a56a1b5fad155234e80b38a258fa3b226ae9a0fa17cad9fee6", - "signature": "aac14cd580be19a56a1b5fad155234e80b38a258fa3b226ae9a0fa17cad9fee6" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/clone.d.ts": { - "version": "194a8e7094c100be87a02adbc417bc5b3f42cbcbc937addc374bc0469af5cf5c", - "signature": "194a8e7094c100be87a02adbc417bc5b3f42cbcbc937addc374bc0469af5cf5c" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/complex.d.ts": { - "version": "6b10cddafdca8e194cec8dc221edc207841565c51f27398b53b9999a8e102dc9", - "signature": "6b10cddafdca8e194cec8dc221edc207841565c51f27398b53b9999a8e102dc9" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat.d.ts": { - "version": "8e18ec88d94bcc4df19667abda6d7c71c50c7e096fb13c26cc01636b4c91acca", - "signature": "8e18ec88d94bcc4df19667abda6d7c71c50c7e096fb13c26cc01636b4c91acca" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_1d.d.ts": { - "version": "47e9925a0bda0783ed82ca50178ca9124bbf1c59eb022b875914faabc68bbceb", - "signature": "47e9925a0bda0783ed82ca50178ca9124bbf1c59eb022b875914faabc68bbceb" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_2d.d.ts": { - "version": "c6df7049fbfd24716b3ab81373da8113e8b207aa1260704772e0e0352af058b5", - "signature": "c6df7049fbfd24716b3ab81373da8113e8b207aa1260704772e0e0352af058b5" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_3d.d.ts": { - "version": "79a59d49d7e1d1e6671f6dedfe2d1c01a72b22622c2deffa65f107c4ffc6bb8a", - "signature": "79a59d49d7e1d1e6671f6dedfe2d1c01a72b22622c2deffa65f107c4ffc6bb8a" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_4d.d.ts": { - "version": "668d5ce1b96bbadb9574109bd09a8947b373e7c0b1261e8f3a591a842f9535ec", - "signature": "668d5ce1b96bbadb9574109bd09a8947b373e7c0b1261e8f3a591a842f9535ec" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts": { - "version": "7797f67cf7ea748c3d89c4bf68e47329de863c45ac1b4a8babf93ef340211c03", - "signature": "7797f67cf7ea748c3d89c4bf68e47329de863c45ac1b4a8babf93ef340211c03" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d.d.ts": { - "version": "1a6dbdf9a3282648e5b69803930bc17ae48d30602bd0343fb233842e2c5ec13d", - "signature": "1a6dbdf9a3282648e5b69803930bc17ae48d30602bd0343fb233842e2c5ec13d" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d.d.ts": { - "version": "8596a7a142dea1bea54e04807798732c0f32c06e5c8db961679ad36a45de87c4", - "signature": "8596a7a142dea1bea54e04807798732c0f32c06e5c8db961679ad36a45de87c4" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose.d.ts": { - "version": "91428bd4c9e53e80926399a471083fca8a3aefcc246b1ec32ea7ad6f566ee04f", - "signature": "91428bd4c9e53e80926399a471083fca8a3aefcc246b1ec32ea7ad6f566ee04f" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d.d.ts": { - "version": "e23d3e950518660f9c1ff36f8c602680b8ca6a296d2b88a5877e91a15d155c3c", - "signature": "e23d3e950518660f9c1ff36f8c602680b8ca6a296d2b88a5877e91a15d155c3c" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_transpose.d.ts": { - "version": "f0a4ed7088f531861c37d8e28a68f6151f0f66858c0ad7475e492fdff1ce59c2", - "signature": "f0a4ed7088f531861c37d8e28a68f6151f0f66858c0ad7475e492fdff1ce59c2" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cos.d.ts": { - "version": "ec8ae98ff590c7141fa1a4ad5c0b14785d72df2ed3b4f6bbda0b2d580e6bafd6", - "signature": "ec8ae98ff590c7141fa1a4ad5c0b14785d72df2ed3b4f6bbda0b2d580e6bafd6" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cosh.d.ts": { - "version": "663c3c4217f491c54399fd7264bf1659c06c5bc81c0afaddf9fb3fc85bc1afb8", - "signature": "663c3c4217f491c54399fd7264bf1659c06c5bc81c0afaddf9fb3fc85bc1afb8" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cumsum.d.ts": { - "version": "7712abbb1c799ffe2ea2ffe2775bee5035269946782d1b6d47133d70d37f760d", - "signature": "7712abbb1c799ffe2ea2ffe2775bee5035269946782d1b6d47133d70d37f760d" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dense_bincount.d.ts": { - "version": "875b34fb02921f1da3fd8a0aa8af6748403ba5b99d18533b231b6192c1ffa06e", - "signature": "875b34fb02921f1da3fd8a0aa8af6748403ba5b99d18533b231b6192c1ffa06e" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/depth_to_space.d.ts": { - "version": "fb131aa84671acc5be60d18087cc561b05c8e76aae83d7ff0d3874edc587eca1", - "signature": "fb131aa84671acc5be60d18087cc561b05c8e76aae83d7ff0d3874edc587eca1" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d.d.ts": { - "version": "8984dc4755bd4fe87b07e024cb17cd89829feed1bc67309e32087e67f688b1b0", - "signature": "8984dc4755bd4fe87b07e024cb17cd89829feed1bc67309e32087e67f688b1b0" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/diag.d.ts": { - "version": "72d01272d1d9a552ef5f9217c7f1645eef0fab09bc4552884260dd73999662af", - "signature": "72d01272d1d9a552ef5f9217c7f1645eef0fab09bc4552884260dd73999662af" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dilation2d.d.ts": { - "version": "1cfa001ae9518c1d0337b2c4a32ef85c41ca9578b6e149d925eb2c030be4ae80", - "signature": "1cfa001ae9518c1d0337b2c4a32ef85c41ca9578b6e149d925eb2c030be4ae80" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/div.d.ts": { - "version": "824b7ffebbb8111dfa95e4967916ab829c6c9bca9d68b159b61774dcd341a648", - "signature": "824b7ffebbb8111dfa95e4967916ab829c6c9bca9d68b159b61774dcd341a648" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/div_no_nan.d.ts": { - "version": "ebb83385012262cb8dfa03c27b27de50553d3b4d2dfc95d246a131a8a58c6b9f", - "signature": "ebb83385012262cb8dfa03c27b27de50553d3b4d2dfc95d246a131a8a58c6b9f" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dot.d.ts": { - "version": "6dcfc441590a142aaa7be977184369e815ee90087edda9d07e19aeb2235853a8", - "signature": "6dcfc441590a142aaa7be977184369e815ee90087edda9d07e19aeb2235853a8" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/einsum.d.ts": { - "version": "d88ed767104aa99dff1dd1bc8f6d6d37af212bdca3588440d4f61ca9fe626ea4", - "signature": "d88ed767104aa99dff1dd1bc8f6d6d37af212bdca3588440d4f61ca9fe626ea4" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/elu.d.ts": { - "version": "1780577c9491f3a2aeccdf4a88c07a284264a4b8590a732d3ef7f726c6058795", - "signature": "1780577c9491f3a2aeccdf4a88c07a284264a4b8590a732d3ef7f726c6058795" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/equal.d.ts": { - "version": "cc6e1ce514759a6c6ce4fe2967236f878a64b6255bb4f6ee286ac180ece01507", - "signature": "cc6e1ce514759a6c6ce4fe2967236f878a64b6255bb4f6ee286ac180ece01507" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/erf.d.ts": { - "version": "8e832f1f5d4a6577670922b6668d13f247d4ce7d6d6a3b71a2da59d20b7bf8dd", - "signature": "8e832f1f5d4a6577670922b6668d13f247d4ce7d6d6a3b71a2da59d20b7bf8dd" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/exp.d.ts": { - "version": "d2b258cc70d8f3dd4e005333df31bf080d4ab5a0e2faf07be755c8fd13d4a816", - "signature": "d2b258cc70d8f3dd4e005333df31bf080d4ab5a0e2faf07be755c8fd13d4a816" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/expand_dims.d.ts": { - "version": "4222d1f1d996ad0b3015b48a5fa8135ba0b879ae259a9ad36d9efd46fa517d32", - "signature": "4222d1f1d996ad0b3015b48a5fa8135ba0b879ae259a9ad36d9efd46fa517d32" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/expm1.d.ts": { - "version": "42a740be26ba9fe4363692a71ae8f7dc0238ee788d4710b4752f761a6fa687ef", - "signature": "42a740be26ba9fe4363692a71ae8f7dc0238ee788d4710b4752f761a6fa687ef" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/eye.d.ts": { - "version": "e726f54782f4907b65d6221cc70c3059a0b0c9f4d268d7c5839852a5ef3b602f", - "signature": "e726f54782f4907b65d6221cc70c3059a0b0c9f4d268d7c5839852a5ef3b602f" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fill.d.ts": { - "version": "cb1ffe61516790216eaa7159d1a6fd67bf7be3ddc8fdb6b363c1bcf21f7e08d4", - "signature": "cb1ffe61516790216eaa7159d1a6fd67bf7be3ddc8fdb6b363c1bcf21f7e08d4" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/floor.d.ts": { - "version": "379034b8279605f9da9812e64ba7fed5255e60283301061b7eb483fe126c336a", - "signature": "379034b8279605f9da9812e64ba7fed5255e60283301061b7eb483fe126c336a" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/floordiv.d.ts": { - "version": "cdaff7682592fd3369e8cf469c7bd8008fae74ad52f342a89c2783e08825a096", - "signature": "cdaff7682592fd3369e8cf469c7bd8008fae74ad52f342a89c2783e08825a096" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/gather.d.ts": { - "version": "066e4314ca2638dc25433297482a2abfe178af3a472f03b2ebde5240dd833f27", - "signature": "066e4314ca2638dc25433297482a2abfe178af3a472f03b2ebde5240dd833f27" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/greater.d.ts": { - "version": "42a1203441188acfe6b7dd3fbd25b969ee81f9540730d6c17f1b389881900bb5", - "signature": "42a1203441188acfe6b7dd3fbd25b969ee81f9540730d6c17f1b389881900bb5" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/greater_equal.d.ts": { - "version": "b2e4131104512db5eed7a93ad5dad2e3d4cc4e3d55e938aaaec58d4f23558d91", - "signature": "b2e4131104512db5eed7a93ad5dad2e3d4cc4e3d55e938aaaec58d4f23558d91" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/imag.d.ts": { - "version": "3c16d2e404e4cfd0d73f1a81f9fe283360687f5e27a68187f3b6c38facb4e481", - "signature": "3c16d2e404e4cfd0d73f1a81f9fe283360687f5e27a68187f3b6c38facb4e481" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/is_finite.d.ts": { - "version": "ba97f4a93db0f07b6bc41dda3190125f18e18268d505e5e3d6edcefcdce015f1", - "signature": "ba97f4a93db0f07b6bc41dda3190125f18e18268d505e5e3d6edcefcdce015f1" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/is_inf.d.ts": { - "version": "744be6da3fe8830a7b7c258ddb898dae49f1ec04b0a5d00cb5742509cb0acfe5", - "signature": "744be6da3fe8830a7b7c258ddb898dae49f1ec04b0a5d00cb5742509cb0acfe5" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/is_nan.d.ts": { - "version": "baa1a420a9bbb0e9a0943159e7d9efcb11cfbdcd93fc11a0e2eedf07daf2abc5", - "signature": "baa1a420a9bbb0e9a0943159e7d9efcb11cfbdcd93fc11a0e2eedf07daf2abc5" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.d.ts": { - "version": "23ac3138bb0a278db32d791ee4b518294ba175729df13ea4483a9161612882b5", - "signature": "23ac3138bb0a278db32d791ee4b518294ba175729df13ea4483a9161612882b5" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/less.d.ts": { - "version": "06cff0171cc90c909e85138ae31872a0a816a8daed69b3cb5049a6e65ed3ba97", - "signature": "06cff0171cc90c909e85138ae31872a0a816a8daed69b3cb5049a6e65ed3ba97" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/less_equal.d.ts": { - "version": "368983493cf721eb101a702dd38dd03084ccd3f3270bfabdbd500e1d28bd4bb7", - "signature": "368983493cf721eb101a702dd38dd03084ccd3f3270bfabdbd500e1d28bd4bb7" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/linspace.d.ts": { - "version": "78e4622dc5567296ced4d1461f3ea2797199ce7ebc5d98139b6ebeb218e5cce1", - "signature": "78e4622dc5567296ced4d1461f3ea2797199ce7ebc5d98139b6ebeb218e5cce1" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization.d.ts": { - "version": "286749c3b87f1cce55c0c2cc5fe151dc259ba28c67b725f4f0227ef5d63619ee", - "signature": "286749c3b87f1cce55c0c2cc5fe151dc259ba28c67b725f4f0227ef5d63619ee" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log.d.ts": { - "version": "f888fd86a4e579950d9bd2c8a23aa09c0d7fad4b3a67d033b7ba18c71b3390ea", - "signature": "f888fd86a4e579950d9bd2c8a23aa09c0d7fad4b3a67d033b7ba18c71b3390ea" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log1p.d.ts": { - "version": "ebc24e879d7398024f1ba998b9deba1a6136b04064365aa3259ee0901659c8d3", - "signature": "ebc24e879d7398024f1ba998b9deba1a6136b04064365aa3259ee0901659c8d3" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log_sigmoid.d.ts": { - "version": "4f9cd4ef48f1b0a9b6e0e285fcb04538433251c80b112103963dd001baee6f75", - "signature": "4f9cd4ef48f1b0a9b6e0e285fcb04538433251c80b112103963dd001baee6f75" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log_softmax.d.ts": { - "version": "af40b15084aa592c493c4acfd14f6cec29413be167acab49d38d260659752878", - "signature": "af40b15084aa592c493c4acfd14f6cec29413be167acab49d38d260659752878" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log_sum_exp.d.ts": { - "version": "4c1a3ca35ed1621c48cbcda0a4da6e3cecde825e3e674b2f4784aa4bf854698f", - "signature": "4c1a3ca35ed1621c48cbcda0a4da6e3cecde825e3e674b2f4784aa4bf854698f" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_and.d.ts": { - "version": "dab0057b7b8848c8eb82916adafe6c5f3bcb7663967fdf315cf56c46bd9a7057", - "signature": "dab0057b7b8848c8eb82916adafe6c5f3bcb7663967fdf315cf56c46bd9a7057" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_not.d.ts": { - "version": "561ad70cac8d1db528b0dd915cebd5218b953a1aab250a0a3a3f961fe014e230", - "signature": "561ad70cac8d1db528b0dd915cebd5218b953a1aab250a0a3a3f961fe014e230" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_or.d.ts": { - "version": "011e1e8c0ec904dee10949f2a0ab5894c425dbb6451c13fe86838820d3667004", - "signature": "011e1e8c0ec904dee10949f2a0ab5894c425dbb6451c13fe86838820d3667004" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_xor.d.ts": { - "version": "8e5f8394da4118e380e9cd16e779282b050da57c48b335dc7190a72a1bc2694a", - "signature": "8e5f8394da4118e380e9cd16e779282b050da57c48b335dc7190a72a1bc2694a" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.d.ts": { - "version": "364f253cd5305be0242d5033549adaad4dfbef54e5d5a6ab47d6dd70d9dca90c", - "signature": "364f253cd5305be0242d5033549adaad4dfbef54e5d5a6ab47d6dd70d9dca90c" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max.d.ts": { - "version": "d0365fd9f98f0eb2795f1f1047a3fc45102cb187b89ec656a71e2eb7de42c985", - "signature": "d0365fd9f98f0eb2795f1f1047a3fc45102cb187b89ec656a71e2eb7de42c985" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool.d.ts": { - "version": "69f4f666d06fd4f45200530d787add6c599d97b0cd21fde2540c49125598f200", - "signature": "69f4f666d06fd4f45200530d787add6c599d97b0cd21fde2540c49125598f200" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d.d.ts": { - "version": "4dfde4033f71c7220a3b138e995cace7a0885fbc35abe15766f9ca7c7c9d8418", - "signature": "4dfde4033f71c7220a3b138e995cace7a0885fbc35abe15766f9ca7c7c9d8418" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_with_argmax.d.ts": { - "version": "850dc81d0a5553866f5cddd34458f957292ac1d4eb48b92c2f2fa8a67fb70389", - "signature": "850dc81d0a5553866f5cddd34458f957292ac1d4eb48b92c2f2fa8a67fb70389" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/maximum.d.ts": { - "version": "a8574338c328285539f999a2ec5def0ae4c0dfaf44019418b62b6cdde91500ac", - "signature": "a8574338c328285539f999a2ec5def0ae4c0dfaf44019418b62b6cdde91500ac" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mean.d.ts": { - "version": "e00dc8e8276e9043fd7de97fbe071b754da3865646577fe08f0734e77bb03cc0", - "signature": "e00dc8e8276e9043fd7de97fbe071b754da3865646577fe08f0734e77bb03cc0" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/meshgrid.d.ts": { - "version": "d108ba371b6ea1ceac47680f5b351797723f76b829e63b6568e597adbde49707", - "signature": "d108ba371b6ea1ceac47680f5b351797723f76b829e63b6568e597adbde49707" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/min.d.ts": { - "version": "0d22fbb779a85d2d2114e2477cdb45e242bd28168bf2199327d30269ffc3a61f", - "signature": "0d22fbb779a85d2d2114e2477cdb45e242bd28168bf2199327d30269ffc3a61f" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/minimum.d.ts": { - "version": "8889652d8c2e86303c5325b5428abf98e4eaa6367ddb7eb6fb6996fe10093ab4", - "signature": "8889652d8c2e86303c5325b5428abf98e4eaa6367ddb7eb6fb6996fe10093ab4" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mirror_pad.d.ts": { - "version": "c77837ff406cd4d525d0d98329af3989f653f8a87abbcfc1dbe2cd4ba3d8b378", - "signature": "c77837ff406cd4d525d0d98329af3989f653f8a87abbcfc1dbe2cd4ba3d8b378" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mod.d.ts": { - "version": "7ea8082c2b75c74d87c52b5cd9cec64fb67ddb44eea801b2b879c44549dcceed", - "signature": "7ea8082c2b75c74d87c52b5cd9cec64fb67ddb44eea801b2b879c44549dcceed" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/moments.d.ts": { - "version": "0fb1cc243f0ba9e1e8d9a8bbeb2302bf8820432120e0ed7689e1dfff203113d2", - "signature": "0fb1cc243f0ba9e1e8d9a8bbeb2302bf8820432120e0ed7689e1dfff203113d2" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mul.d.ts": { - "version": "e19ed70d4cd396a5b432104090e26d94e620ef03a7675e0120978a9b0c91bec5", - "signature": "e19ed70d4cd396a5b432104090e26d94e620ef03a7675e0120978a9b0c91bec5" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/multi_rnn_cell.d.ts": { - "version": "7845d766a8ee4bca373e30c89de2ccf608339342b510f799ba66d9fd0536a766", - "signature": "7845d766a8ee4bca373e30c89de2ccf608339342b510f799ba66d9fd0536a766" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial.d.ts": { - "version": "df2ecfd53876192b22b74707b40384d8ec8778064f1552977eff479cb71b2de1", - "signature": "df2ecfd53876192b22b74707b40384d8ec8778064f1552977eff479cb71b2de1" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/neg.d.ts": { - "version": "117c002184b040063a5e77f289888f90c015947084a03f56bcb8ea404e33d881", - "signature": "117c002184b040063a5e77f289888f90c015947084a03f56bcb8ea404e33d881" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/not_equal.d.ts": { - "version": "f89452d3ca3aea0f65469f61a401d0e397e036583cff57daee99daf392bfa584", - "signature": "f89452d3ca3aea0f65469f61a401d0e397e036583cff57daee99daf392bfa584" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.d.ts": { - "version": "6e059447d70226f3ff83431c714afdf5d9238a8d88c74a503157ad162266428c", - "signature": "6e059447d70226f3ff83431c714afdf5d9238a8d88c74a503157ad162266428c" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ones.d.ts": { - "version": "0a134facc6d1974de3b9b64e85d6935c9315e3ec1267739bb26fba253705ff0d", - "signature": "0a134facc6d1974de3b9b64e85d6935c9315e3ec1267739bb26fba253705ff0d" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ones_like.d.ts": { - "version": "1a2c39566cd0bb39c9e6e74e2101ff18d3828051dc04fb7d015be6a08b2b2b29", - "signature": "1a2c39566cd0bb39c9e6e74e2101ff18d3828051dc04fb7d015be6a08b2b2b29" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/outer_product.d.ts": { - "version": "5b7f73bf80fc4283fdf43143151ffb1fa658f22e34ab8f93e4107181419e8ab5", - "signature": "5b7f73bf80fc4283fdf43143151ffb1fa658f22e34ab8f93e4107181419e8ab5" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad.d.ts": { - "version": "b9804589d8afc30f545603ddec740427fb4d80bee166165c2fde48a670719284", - "signature": "b9804589d8afc30f545603ddec740427fb4d80bee166165c2fde48a670719284" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad1d.d.ts": { - "version": "76fd6ed523095c41b1da8efd70c2d58539a02f77cc0d0b5d42c8d30f191da7df", - "signature": "76fd6ed523095c41b1da8efd70c2d58539a02f77cc0d0b5d42c8d30f191da7df" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad2d.d.ts": { - "version": "1da4af676a459cb50d772e6675e33d36269a3444d065b6908acc1bd6b77cfb6c", - "signature": "1da4af676a459cb50d772e6675e33d36269a3444d065b6908acc1bd6b77cfb6c" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad3d.d.ts": { - "version": "7eeabe859314746c755608e4c1c71da620d27507ccfcbd589151477671a19a76", - "signature": "7eeabe859314746c755608e4c1c71da620d27507ccfcbd589151477671a19a76" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad4d.d.ts": { - "version": "fc43d2f2123d5a62892df7b9108983b2b277f2c01e47c344bcf2a5c6c25c8186", - "signature": "fc43d2f2123d5a62892df7b9108983b2b277f2c01e47c344bcf2a5c6c25c8186" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pool.d.ts": { - "version": "0fae9518384676c37c2db3d56d2d11d8cc82ba24fec06ff1b2246134dbff8784", - "signature": "0fae9518384676c37c2db3d56d2d11d8cc82ba24fec06ff1b2246134dbff8784" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pow.d.ts": { - "version": "ba2503f2b408d516d8cbc4d421f3101c08efa408f684519e386a2493391f3627", - "signature": "ba2503f2b408d516d8cbc4d421f3101c08efa408f684519e386a2493391f3627" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/prelu.d.ts": { - "version": "bc6e94b1c8442ca2f06e132af407e836972ab362eae2ae98b2db4f96f92d6f92", - "signature": "bc6e94b1c8442ca2f06e132af407e836972ab362eae2ae98b2db4f96f92d6f92" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/print.d.ts": { - "version": "46563e1ebd360cd48248be7ced7448dd31789c65f82014c35b223ae26efc4267", - "signature": "46563e1ebd360cd48248be7ced7448dd31789c65f82014c35b223ae26efc4267" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/prod.d.ts": { - "version": "7863605292a1ee363f3c3783be9600cbffd63c2be91c0ab555bc0f6984144552", - "signature": "7863605292a1ee363f3c3783be9600cbffd63c2be91c0ab555bc0f6984144552" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/rand.d.ts": { - "version": "620ccf1fc2ff093d596c2c930f31dd5edbde974b050ee593cc4f142c9bdffc7f", - "signature": "620ccf1fc2ff093d596c2c930f31dd5edbde974b050ee593cc4f142c9bdffc7f" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/random_gamma.d.ts": { - "version": "cf3fae0259d8bd8ae326c36ed0ab3d358bc0c311620e6b3a8fadd663c5beb092", - "signature": "cf3fae0259d8bd8ae326c36ed0ab3d358bc0c311620e6b3a8fadd663c5beb092" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/random_normal.d.ts": { - "version": "9a6ff8adde50ff44c819348c523638978fbc8c82a5d0bd13dc7378a2cc7d7606", - "signature": "9a6ff8adde50ff44c819348c523638978fbc8c82a5d0bd13dc7378a2cc7d7606" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/random_uniform.d.ts": { - "version": "d91163311c397198dcf18d8ed591c0f88836141fcc6097bb6e3e62e721183e94", - "signature": "d91163311c397198dcf18d8ed591c0f88836141fcc6097bb6e3e62e721183e94" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/range.d.ts": { - "version": "752421ffbebb494e93d6ece8d23f3b24c1ba4231aa1b35d63c88aaff19c69152", - "signature": "752421ffbebb494e93d6ece8d23f3b24c1ba4231aa1b35d63c88aaff19c69152" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/real.d.ts": { - "version": "8ea1e30398c31506633ee77e955bedb696c3440b034aabe22b08413ea896a796", - "signature": "8ea1e30398c31506633ee77e955bedb696c3440b034aabe22b08413ea896a796" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reciprocal.d.ts": { - "version": "e57c98f7b795094b2ec1c8c597aeeeaba591b8246c7f6c61cbbb5006aa8b84c7", - "signature": "e57c98f7b795094b2ec1c8c597aeeeaba591b8246c7f6c61cbbb5006aa8b84c7" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/relu.d.ts": { - "version": "6a28862cba14c3ff4489be7f395981ee0f87118ab7826ad7991ae0c2cec9ff8f", - "signature": "6a28862cba14c3ff4489be7f395981ee0f87118ab7826ad7991ae0c2cec9ff8f" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/relu6.d.ts": { - "version": "d68518957f61c28b41af3d14302f69f0cf7ef391c120ab154f22f39217805267", - "signature": "d68518957f61c28b41af3d14302f69f0cf7ef391c120ab154f22f39217805267" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reshape.d.ts": { - "version": "0d9d5959e1baa43568430585f07b6bb7a1021c54ed181fbca9f6263942279a80", - "signature": "0d9d5959e1baa43568430585f07b6bb7a1021c54ed181fbca9f6263942279a80" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.d.ts": { - "version": "d1d256ac11657d24fbec4d491f714969cb433b23784bc0d529489ce9d13daa8c", - "signature": "d1d256ac11657d24fbec4d491f714969cb433b23784bc0d529489ce9d13daa8c" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_1d.d.ts": { - "version": "c6dfb0fdce1f5222ce8a5ae3f8fce443e30cdf98ab8a8ff6b59511564fd2ca3a", - "signature": "c6dfb0fdce1f5222ce8a5ae3f8fce443e30cdf98ab8a8ff6b59511564fd2ca3a" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_2d.d.ts": { - "version": "dc4b0671d7a71af5ec32dd18595bd89f89e150c146c933275799e6f171e81549", - "signature": "dc4b0671d7a71af5ec32dd18595bd89f89e150c146c933275799e6f171e81549" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_3d.d.ts": { - "version": "b367e3c1acac161c852bcf2c1d317fcd481148450ad26cf165dc93777cfe3824", - "signature": "b367e3c1acac161c852bcf2c1d317fcd481148450ad26cf165dc93777cfe3824" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_4d.d.ts": { - "version": "9471b6911f9283f1277502d4cad5c94a2bd9f43b86700f3934a938d2c804281b", - "signature": "9471b6911f9283f1277502d4cad5c94a2bd9f43b86700f3934a938d2c804281b" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/round.d.ts": { - "version": "6dcfb44c67bda8e433c2234fcbc61013539167e0cb0e53da9116074bc8fe3d6c", - "signature": "6dcfb44c67bda8e433c2234fcbc61013539167e0cb0e53da9116074bc8fe3d6c" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/rsqrt.d.ts": { - "version": "1a453bd323f28633ded464f61bf601bddf28f7f51de8c344bf1d523e903f4c55", - "signature": "1a453bd323f28633ded464f61bf601bddf28f7f51de8c344bf1d523e903f4c55" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/scalar.d.ts": { - "version": "0453b500489af97db08b9294884d743749f6e65c24d4ab40916db9cd7754603d", - "signature": "0453b500489af97db08b9294884d743749f6e65c24d4ab40916db9cd7754603d" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/selu.d.ts": { - "version": "d08a516e69f76d2db65718dad54b7838b9cb50f1d00c9fdb04b6a5ebd1cb9dcf", - "signature": "d08a516e69f76d2db65718dad54b7838b9cb50f1d00c9fdb04b6a5ebd1cb9dcf" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/separable_conv2d.d.ts": { - "version": "e1d1b54bfebf2f3ec3fa7feabb91a2be43cc9999964316edb87dfa028fabc98b", - "signature": "e1d1b54bfebf2f3ec3fa7feabb91a2be43cc9999964316edb87dfa028fabc98b" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/setdiff1d_async.d.ts": { - "version": "dcdc364deed98b55f65801c782abe862c573307c653806ee2262b0646a390f33", - "signature": "dcdc364deed98b55f65801c782abe862c573307c653806ee2262b0646a390f33" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.d.ts": { - "version": "9f6f6e899e2284cfd18cca30a5b3e3c313a228f4423c95e74c6345cb9d704a20", - "signature": "9f6f6e899e2284cfd18cca30a5b3e3c313a228f4423c95e74c6345cb9d704a20" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sign.d.ts": { - "version": "29cf2db15f23fb4e0e690ea895fcc4476782b9f024c4d3df3cf8e9cd7c78da0f", - "signature": "29cf2db15f23fb4e0e690ea895fcc4476782b9f024c4d3df3cf8e9cd7c78da0f" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sin.d.ts": { - "version": "fb722149e233d5e9b0d8e2bdeaf5892a4b8035592d907ba2469289d00c7d3362", - "signature": "fb722149e233d5e9b0d8e2bdeaf5892a4b8035592d907ba2469289d00c7d3362" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sinh.d.ts": { - "version": "d8181aee65ba90eea56aab03fca2ede7e19f1d57f561b2b794851750ae93edf4", - "signature": "d8181aee65ba90eea56aab03fca2ede7e19f1d57f561b2b794851750ae93edf4" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice.d.ts": { - "version": "d123859260d588493c1689896a199d61051d5302eda1033123eaf3d341e74cea", - "signature": "d123859260d588493c1689896a199d61051d5302eda1033123eaf3d341e74cea" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice1d.d.ts": { - "version": "eb9dbbf3436a185f794d7df836925adabfd6ae3e4978a0414511b8b1f688e98a", - "signature": "eb9dbbf3436a185f794d7df836925adabfd6ae3e4978a0414511b8b1f688e98a" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice2d.d.ts": { - "version": "90be5c0a88263271550227fc4e5fbfb57cd3826c6e21b26ca8a141c84be5943c", - "signature": "90be5c0a88263271550227fc4e5fbfb57cd3826c6e21b26ca8a141c84be5943c" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice3d.d.ts": { - "version": "b4727ceb1a19163bf2359b7d92648301310a1c76e2914e1078b58bc07b5ef72b", - "signature": "b4727ceb1a19163bf2359b7d92648301310a1c76e2914e1078b58bc07b5ef72b" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice4d.d.ts": { - "version": "c4f95b1e815479c01a5043f7a7962073c054033e4fa4f039ee2adfebedcffbed", - "signature": "c4f95b1e815479c01a5043f7a7962073c054033e4fa4f039ee2adfebedcffbed" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.d.ts": { - "version": "510adfc55a51d2d6e08a6519e14f0ef123018d3711158ce4a9098e7637686488", - "signature": "510adfc55a51d2d6e08a6519e14f0ef123018d3711158ce4a9098e7637686488" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/softplus.d.ts": { - "version": "4a25dadf5ec4b679dfc01f020c912d8567fc29cbcb0a110518a6a486c82320e9", - "signature": "4a25dadf5ec4b679dfc01f020c912d8567fc29cbcb0a110518a6a486c82320e9" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/space_to_batch_nd.d.ts": { - "version": "441cfa5bf8ca6671be8ef2f3becfc678a4afc01d6f886a4e94878e32298c3804", - "signature": "441cfa5bf8ca6671be8ef2f3becfc678a4afc01d6f886a4e94878e32298c3804" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/fft.d.ts": { - "version": "c47f21e1be455cdf4ed7a5e38c20d5be9e7c5f6f6e2ea37a01ad058b5f61fc97", - "signature": "c47f21e1be455cdf4ed7a5e38c20d5be9e7c5f6f6e2ea37a01ad058b5f61fc97" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/ifft.d.ts": { - "version": "16b426a80cd98a1473d925e6f8d3bab679e94fdc2e5ecb5406f079343ab0533d", - "signature": "16b426a80cd98a1473d925e6f8d3bab679e94fdc2e5ecb5406f079343ab0533d" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/irfft.d.ts": { - "version": "096f66887dd48c8d4d820ca64e23909edbe893e16a6e427c620871ad2910a415", - "signature": "096f66887dd48c8d4d820ca64e23909edbe893e16a6e427c620871ad2910a415" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/rfft.d.ts": { - "version": "8abc6aad380575ba975b33ced648af9e5cdad075e8b00f05b99dd041f37365f9", - "signature": "8abc6aad380575ba975b33ced648af9e5cdad075e8b00f05b99dd041f37365f9" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/split.d.ts": { - "version": "5ffc540e38b10ffb3f3d9ae54b8a976e3da4b350647b4886e1aa72c9d75e5701", - "signature": "5ffc540e38b10ffb3f3d9ae54b8a976e3da4b350647b4886e1aa72c9d75e5701" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sqrt.d.ts": { - "version": "a93c1256a96a0d4e18b7a2cc65b3f8a0c0dcb23fbb4c7af6e1113877c404e3be", - "signature": "a93c1256a96a0d4e18b7a2cc65b3f8a0c0dcb23fbb4c7af6e1113877c404e3be" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/square.d.ts": { - "version": "7c21938e95b0e582c769bc0db13267ac37bdf25ba04489ac374204c0f4fd84f9", - "signature": "7c21938e95b0e582c769bc0db13267ac37bdf25ba04489ac374204c0f4fd84f9" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/squared_difference.d.ts": { - "version": "ef6ee8b77a2bcfa8ed403459d47ac077421c93d128cdcb85d7d472073faaf3f1", - "signature": "ef6ee8b77a2bcfa8ed403459d47ac077421c93d128cdcb85d7d472073faaf3f1" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.d.ts": { - "version": "171b073b849566ea0b1164943edae39da2063914acf9bdacf759198714730b1e", - "signature": "171b073b849566ea0b1164943edae39da2063914acf9bdacf759198714730b1e" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/stack.d.ts": { - "version": "877982ad86e55624cf0841b798faac8ff3bb29813f35a4ecd307168735620e91", - "signature": "877982ad86e55624cf0841b798faac8ff3bb29813f35a4ecd307168735620e91" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/step.d.ts": { - "version": "be4b86fcf41f7c52ca0a1ede68dad397871f39bcffbd1db77fcd2871a6c1dc6d", - "signature": "be4b86fcf41f7c52ca0a1ede68dad397871f39bcffbd1db77fcd2871a6c1dc6d" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.d.ts": { - "version": "84666917c7f0565389877df2c91217174059ca45524a7dd9f86295edcb1f744e", - "signature": "84666917c7f0565389877df2c91217174059ca45524a7dd9f86295edcb1f744e" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sub.d.ts": { - "version": "fe3f6412d56a35ac5a448d5277b7a3314ab15167dd90fd76e7d6ed07f67f169a", - "signature": "fe3f6412d56a35ac5a448d5277b7a3314ab15167dd90fd76e7d6ed07f67f169a" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sum.d.ts": { - "version": "9edf485a02787a1b40395701070e7cdfc6bf35a45df9166ea932306b0cead0d4", - "signature": "9edf485a02787a1b40395701070e7cdfc6bf35a45df9166ea932306b0cead0d4" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tan.d.ts": { - "version": "1a0538b8ddc8044259ca51cd5d7e381a92298ffe47701520f2344f26eb153c8a", - "signature": "1a0538b8ddc8044259ca51cd5d7e381a92298ffe47701520f2344f26eb153c8a" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tanh.d.ts": { - "version": "8ba196faf00666e17a0547aa0cbdf77974b399b1e05b52785e72393b86a82edf", - "signature": "8ba196faf00666e17a0547aa0cbdf77974b399b1e05b52785e72393b86a82edf" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor.d.ts": { - "version": "7953df8a48a3d4f9f6bf4ebc3ca740796a86b4ffcd967745b0697252d965df95", - "signature": "7953df8a48a3d4f9f6bf4ebc3ca740796a86b4ffcd967745b0697252d965df95" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor1d.d.ts": { - "version": "3d2ae62f5defa9d62b6f7ddbca46ecd0ff80ce4df31ff0cec16200dbbaf51dfd", - "signature": "3d2ae62f5defa9d62b6f7ddbca46ecd0ff80ce4df31ff0cec16200dbbaf51dfd" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor2d.d.ts": { - "version": "acffecc16427ecf797219c0dfbede2e54be4211884e11aa552b93ed9667c23bf", - "signature": "acffecc16427ecf797219c0dfbede2e54be4211884e11aa552b93ed9667c23bf" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor3d.d.ts": { - "version": "9d0e96d38bb0ec5ca7ecca26c61de4e9539e7ac764efd6ed5020b15a2ac78803", - "signature": "9d0e96d38bb0ec5ca7ecca26c61de4e9539e7ac764efd6ed5020b15a2ac78803" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor4d.d.ts": { - "version": "668eecae7c3d99776b032b229256ebd8a14ba89e8a06fc3fef705f6dea15bcea", - "signature": "668eecae7c3d99776b032b229256ebd8a14ba89e8a06fc3fef705f6dea15bcea" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor5d.d.ts": { - "version": "d357f738da0f93e6c49d1aace9db3566258d53dd7daf2e1c90a43127965f7631", - "signature": "d357f738da0f93e6c49d1aace9db3566258d53dd7daf2e1c90a43127965f7631" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor6d.d.ts": { - "version": "487ff9e2450ab931ba314a8d2dd51bd19fca70c95e30aef28c71c359e29c0733", - "signature": "487ff9e2450ab931ba314a8d2dd51bd19fca70c95e30aef28c71c359e29c0733" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tile.d.ts": { - "version": "8032117fab1daf0eceffc5a9bd6f5e20de5b2972b20a0b032c47eafaa9c19c24", - "signature": "8032117fab1daf0eceffc5a9bd6f5e20de5b2972b20a0b032c47eafaa9c19c24" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/topk.d.ts": { - "version": "e1fc6040b74a8d6d04788dddc1d79e2aba43ea8a5db1699da0ae467fbbaa49c2", - "signature": "e1fc6040b74a8d6d04788dddc1d79e2aba43ea8a5db1699da0ae467fbbaa49c2" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/truncated_normal.d.ts": { - "version": "09a9f7b161090a8f2153a2d7b7616b77506295abb5b86590be7a68245f8dc532", - "signature": "09a9f7b161090a8f2153a2d7b7616b77506295abb5b86590be7a68245f8dc532" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/unique.d.ts": { - "version": "d5650f0d75ce845539cf80614750fe1a14790e398588da1adcca6c5f53225b72", - "signature": "d5650f0d75ce845539cf80614750fe1a14790e398588da1adcca6c5f53225b72" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/unsorted_segment_sum.d.ts": { - "version": "c72c275a60c4b61b5740bcc56075b9d84a2469c9a24e3afa848f4ffc2904b108", - "signature": "c72c275a60c4b61b5740bcc56075b9d84a2469c9a24e3afa848f4ffc2904b108" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/unstack.d.ts": { - "version": "7515ba30314cdbdbf5b15969e34ba49b080c32e918be6b9f613e2c0dae4b7751", - "signature": "7515ba30314cdbdbf5b15969e34ba49b080c32e918be6b9f613e2c0dae4b7751" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/variable.d.ts": { - "version": "cd79dfad796293ac51aa676353f060a8738d8ea6287259f62f323933fa1c634d", - "signature": "cd79dfad796293ac51aa676353f060a8738d8ea6287259f62f323933fa1c634d" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/where.d.ts": { - "version": "12e912f1e14d2104547e1f6646d681c5599cf0dcfaeb4581f4551d97e64c9d82", - "signature": "12e912f1e14d2104547e1f6646d681c5599cf0dcfaeb4581f4551d97e64c9d82" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/where_async.d.ts": { - "version": "239b41f76844bec24ec8c2504f49c51932466736afe761bb6b8129338141b6a6", - "signature": "239b41f76844bec24ec8c2504f49c51932466736afe761bb6b8129338141b6a6" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/zeros.d.ts": { - "version": "730587b7e34bdcb172d5390f54bcefedceaf176cf639e988c6d00eeda5290f60", - "signature": "730587b7e34bdcb172d5390f54bcefedceaf176cf639e988c6d00eeda5290f60" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/zeros_like.d.ts": { - "version": "169a345845855cf044b3328b61ab4f7ca62008193bb46271b64cbce075bb967a", - "signature": "169a345845855cf044b3328b61ab4f7ca62008193bb46271b64cbce075bb967a" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/boolean_mask.d.ts": { - "version": "914b180923c6ac0f1426d6d5e1adaf44d8a8719c61d2be1cc8cc4e03031c5ecf", - "signature": "914b180923c6ac0f1426d6d5e1adaf44d8a8719c61d2be1cc8cc4e03031c5ecf" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.d.ts": { - "version": "e065920af631f891852e11918336d4f9dd1abe8ed9065c3ec338915dae3a089d", - "signature": "e065920af631f891852e11918336d4f9dd1abe8ed9065c3ec338915dae3a089d" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/norm.d.ts": { - "version": "bb345be2a8aa098fa2de11f2cef824f9089da46db14043c70dcce54f17a305d7", - "signature": "bb345be2a8aa098fa2de11f2cef824f9089da46db14043c70dcce54f17a305d7" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average.d.ts": { - "version": "91c55f2950e628414dc6e450cea9a2a198de55b58b3001ed28d9cee15956f926", - "signature": "91c55f2950e628414dc6e450cea9a2a198de55b58b3001ed28d9cee15956f926" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd.d.ts": { - "version": "855f37046c96ffe04be9b43fcb0268ff4cdc23c8e36f0d929f473316bd506211", - "signature": "855f37046c96ffe04be9b43fcb0268ff4cdc23c8e36f0d929f473316bd506211" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sparse_to_dense.d.ts": { - "version": "3cad925712cc4d761fb82b269b1c9971100deecdaecbb9c59ae19a9cd395e9eb", - "signature": "3cad925712cc4d761fb82b269b1c9971100deecdaecbb9c59ae19a9cd395e9eb" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd.d.ts": { - "version": "e2f9c30420b817a569a09754941a4287f30befc4e9750569d227f9fed5c7f52d", - "signature": "e2f9c30420b817a569a09754941a4287f30befc4e9750569d227f9fed5c7f52d" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dropout.d.ts": { - "version": "939695ce06e5beae32d8f3030fef29b295f68c3d4648d49669b0e7e918688d03", - "signature": "939695ce06e5beae32d8f3030fef29b295f68c3d4648d49669b0e7e918688d03" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/signal_ops_util.d.ts": { - "version": "3109329a6e15088af904ef2e55997e19bd715fec22a8a1fd8189fc599ac9edc6", - "signature": "3109329a6e15088af904ef2e55997e19bd715fec22a8a1fd8189fc599ac9edc6" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/in_top_k.d.ts": { - "version": "745cb240fa6421e309860efec3ccfcfd71f91ec85ce3a3ba19e2433340db020f", - "signature": "745cb240fa6421e309860efec3ccfcfd71f91ec85ce3a3ba19e2433340db020f" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/operation.d.ts": { - "version": "6b0e4d16e5a1c5922acb1a2491be705cb17dcfda9e0f73161351525c6bc882d0", - "signature": "6b0e4d16e5a1c5922acb1a2491be705cb17dcfda9e0f73161351525c6bc882d0" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts": { - "version": "5bee3d5a5c3d409c0b0499a561919ceab633700e43db3d2c736c08cbe6ffe155", - "signature": "5bee3d5a5c3d409c0b0499a561919ceab633700e43db3d2c736c08cbe6ffe155" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused/conv2d.d.ts": { - "version": "d861031e2ba65a6420fe6b45ffe1c6429cdd5d7853f1ea2df9c9332f47857657", - "signature": "d861031e2ba65a6420fe6b45ffe1c6429cdd5d7853f1ea2df9c9332f47857657" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused/depthwise_conv2d.d.ts": { - "version": "ea344e18e1240cda6ccaa2e5fdaae72bb2c59e47b2127a4b2b48f57ecdb6ee3c", - "signature": "ea344e18e1240cda6ccaa2e5fdaae72bb2c59e47b2127a4b2b48f57ecdb6ee3c" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused/mat_mul.d.ts": { - "version": "b18c0c0a05c7d0667611e45aa7566758adc37733dc258c33ea5fe8a14aea30a6", - "signature": "b18c0c0a05c7d0667611e45aa7566758adc37733dc258c33ea5fe8a14aea30a6" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_ops.d.ts": { - "version": "fc52f3d4503d187ec72b139a7edb3c8ca6f5008980340752cb5d5078929626a4", - "signature": "fc52f3d4503d187ec72b139a7edb3c8ca6f5008980340752cb5d5078929626a4" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops_utils.d.ts": { - "version": "716c36572e7674628608f36b0737fd42bfc15fd8928d3709843b4b62d40c2e2a", - "signature": "716c36572e7674628608f36b0737fd42bfc15fd8928d3709843b4b62d40c2e2a" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ops.d.ts": { - "version": "d4d550e3eeca8c2e63b243fc4db53f221779dfb47ed7ccbd0d34b5323387c1eb", - "signature": "d4d550e3eeca8c2e63b243fc4db53f221779dfb47ed7ccbd0d34b5323387c1eb" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.d.ts": { - "version": "f13a9198176221207dc3d36a4037e5c7cd2767b7a01e83e2c2eb1b76cdca058f", - "signature": "f13a9198176221207dc3d36a4037e5c7cd2767b7a01e83e2c2eb1b76cdca058f" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/train.d.ts": { - "version": "651d5fcefc312e1926762293a94e8f3b22db1e0ac5a7ca6afa02c51882066d1f", - "signature": "651d5fcefc312e1926762293a94e8f3b22db1e0ac5a7ca6afa02c51882066d1f" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/globals.d.ts": { - "version": "d721b7b7e2bae3a00803c38f8b851e2175373a360f322f0abef543f5efb823b8", - "signature": "d721b7b7e2bae3a00803c38f8b851e2175373a360f322f0abef543f5efb823b8" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/gradients.d.ts": { - "version": "5d1be82088f6e2667de1c021cb2e98aa6d274b037508218154ed09f4640e3636", - "signature": "5d1be82088f6e2667de1c021cb2e98aa6d274b037508218154ed09f4640e3636" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/browser_util.d.ts": { - "version": "12cd22576286346b71c41626c5f47390ebdcd3e9b3a6f05d3e3746545c3408b3", - "signature": "12cd22576286346b71c41626c5f47390ebdcd3e9b3a6f05d3e3746545c3408b3" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.d.ts": { - "version": "e410475b6f69fc0f473f99ab7a9e9df36d9569c16ae59482c8f688d838210d68", - "signature": "e410475b6f69fc0f473f99ab7a9e9df36d9569c16ae59482c8f688d838210d68" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.d.ts": { - "version": "80733a15ee9be4c4a964458852fd4ffef0b641a4570405087cada03c8b0d1551", - "signature": "80733a15ee9be4c4a964458852fd4ffef0b641a4570405087cada03c8b0d1551" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util.d.ts": { - "version": "230c2aa8ad0965b18748154b8831e3fff23585a34f9fbbc36f86fc39c788099d", - "signature": "230c2aa8ad0965b18748154b8831e3fff23585a34f9fbbc36f86fc39c788099d" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_util.d.ts": { - "version": "d3550a9b2c95a16636307e376b70dcd5f209af4084656c2681958ca0c94793db", - "signature": "d3550a9b2c95a16636307e376b70dcd5f209af4084656c2681958ca0c94793db" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reduce_util.d.ts": { - "version": "5c59028ee83c45a9dece43db5b53d95d47dca13152682b5a29452ebe4255f008", - "signature": "5c59028ee83c45a9dece43db5b53d95d47dca13152682b5a29452ebe4255f008" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/rotate_util.d.ts": { - "version": "235838e05310e2a5c7eb1dee9e7d809de2f13f1ece6434b01e026632188e158b", - "signature": "235838e05310e2a5c7eb1dee9e7d809de2f13f1ece6434b01e026632188e158b" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_util.d.ts": { - "version": "f65dbdf26605a07c546fdd00de6d02e1c958672791635511d64386ce5f4036a6", - "signature": "f65dbdf26605a07c546fdd00de6d02e1c958672791635511d64386ce5f4036a6" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.d.ts": { - "version": "2745294bad1d9a1bc213c03aacc47f465f9a23474488253e9c8824ee18a01251", - "signature": "2745294bad1d9a1bc213c03aacc47f465f9a23474488253e9c8824ee18a01251" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/erf_util.d.ts": { - "version": "0718d101018dfd11086a8ece97ce49a87bb784a576ae4901ce9c21a999f6c461", - "signature": "0718d101018dfd11086a8ece97ce49a87bb784a576ae4901ce9c21a999f6c461" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/log.d.ts": { - "version": "addda8d833e1739492f09a4cd1a64c98d42a05cf80a581458ea9cf27507a29f2", - "signature": "addda8d833e1739492f09a4cd1a64c98d42a05cf80a581458ea9cf27507a29f2" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/complex_util.d.ts": { - "version": "d31befee43579fd7ef04043ceb5fad291f92e35e3f1574d5a2726a6e3626d4bd", - "signature": "d31befee43579fd7ef04043ceb5fad291f92e35e3f1574d5a2726a6e3626d4bd" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/einsum_util.d.ts": { - "version": "b3ecac3b0623ac0c62e38777349e8886504d76182aa39bbc1a8cdc23b057ffb4", - "signature": "b3ecac3b0623ac0c62e38777349e8886504d76182aa39bbc1a8cdc23b057ffb4" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/split_util.d.ts": { - "version": "c222091a253aecbd9d0132320bd9ccd94fe916db113ddb47408ab010c4ff5a3c", - "signature": "c222091a253aecbd9d0132320bd9ccd94fe916db113ddb47408ab010c4ff5a3c" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.d.ts": { - "version": "43573c8ed9d06c7899ec3b95aff3860f026e77626ed9139264318acc01374aec", - "signature": "43573c8ed9d06c7899ec3b95aff3860f026e77626ed9139264318acc01374aec" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/backend_util.d.ts": { - "version": "f17dbc11f07d828c438e9f95b2a45bc7bd804eb01beb61ee0b39a26bbf348a9c", - "signature": "f17dbc11f07d828c438e9f95b2a45bc7bd804eb01beb61ee0b39a26bbf348a9c" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/device_util.d.ts": { - "version": "f4d525c92f9aebb3b23cc749c1da5f6295622121dee85c29c2f680dd02f9e738", - "signature": "f4d525c92f9aebb3b23cc749c1da5f6295622121dee85c29c2f680dd02f9e738" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/non_max_suppression_impl.d.ts": { - "version": "3eabdaa394f886b46b851b3008f9d7c7c76484a7f99ec18d366a9df303f7f1c2", - "signature": "3eabdaa394f886b46b851b3008f9d7c7c76484a7f99ec18d366a9df303f7f1c2" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/where_impl.d.ts": { - "version": "a0f16c0740e640a08bac78d3f901207281c8fdf72dcb04bba2003eedf6c1e98e", - "signature": "a0f16c0740e640a08bac78d3f901207281c8fdf72dcb04bba2003eedf6c1e98e" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/kernel_impls.d.ts": { - "version": "db346ff36c2ad0955a83243b062dd6b30710bef47fcd4b95aeb92ec8d7c59df1", - "signature": "db346ff36c2ad0955a83243b062dd6b30710bef47fcd4b95aeb92ec8d7c59df1" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_names.d.ts": { - "version": "cb86cab04d650d7694859841a3635b139dcc3c4e561f35f84300092456220ed4", - "signature": "cb86cab04d650d7694859841a3635b139dcc3c4e561f35f84300092456220ed4" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/base.d.ts": { - "version": "854262aadff6afa8256dc68ec8546e063a3fba9a0a1e46caf9cd7b4cf16062fd", - "signature": "854262aadff6afa8256dc68ec8546e063a3fba9a0a1e46caf9cd7b4cf16062fd" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts": { - "version": "94c1ffdcfc7ad35c3d5945f1720f04efdcbda5278a250fb509b5ce2c6685998d", - "signature": "94c1ffdcfc7ad35c3d5945f1720f04efdcbda5278a250fb509b5ce2c6685998d" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/seedrandom/index.d.ts": { - "version": "012629586939a163039e819b87685e3c4d8cfa7bae5289725d6de859bc037066", - "signature": "012629586939a163039e819b87685e3c4d8cfa7bae5289725d6de859bc037066" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts": { - "version": "d0d2c628a0f679ee6bdc45b75aec8cc44c450be52efe9c43121bc5457ff2bc9f", - "signature": "464be198b33017557df055908f36c38762c98993cf9cf973880c111fbcfdea22" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/util/deep_map.ts": { - "version": "95ab9cef5d62e4e0a3246b73e0c9bdec93d325f5c1ba01cd34dca1f6c1a8291c", - "signature": "bc4ba957ad6cafc3f3b48f0d4c15318e09e82f77acf4c88e723adb4ea1806602" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/util/deep_clone.ts": { - "version": "a938de63fe79f49e7747200a2bd14e55ebdabd47f27df3bd2e43dd89507c767e", - "signature": "815b3806451a45ed91fe7721b534a3dcbf36e13a3587ad821d1e19a4d5306d7c" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/util/ring_buffer.ts": { - "version": "9ef273ec92b7a82067dc87dee955551b12f2980bd3476d2c7de87825d9cde384", - "signature": "08e015b7fe39d0360dd46fd0eed8c5a52b1cfbe29900a9584b6fbd9affc5f70b" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/util/growing_ring_buffer.ts": { - "version": "4a4bd0715a433b182e11c9284371b6ccc9d30cce37e0d4bd75b4efbaed388de8", - "signature": "c3e6074778506688dca079cd3953777ecadf4b316d311e8c693438329ce99d8a" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts": { - "version": "c44dcb6c7feb5a77a2018222862b4c097cb8323d39c7c87895fa0356bcf6fcea", - "signature": "6f0de3d5c70dc369bd6a8be7a0ce690510b91237bc850d7a2da7ce1d6d33656a" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/dataset.ts": { - "version": "9e064f153f725b71ae9bb7027df5754357698491165aef27774653c28443588e", - "signature": "3cafd93d839f8cde71c25c89a05da9493c53c91604643bffa2ec283f020df87f" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/string_iterator.ts": { - "version": "6c147e9dd339e44ca6a34ad0cb4c1f2db6382b1b60ce3c81ff1e4c19623b4393", - "signature": "70ace40091f314b14c20307a1b26432bfde9f5d9cb016a24b1066f34012c0cfd" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/byte_chunk_iterator.ts": { - "version": "ece07290641407fac925c1384549a31d1f2dc2070d0bc2c4573bb0db4a4cc8a7", - "signature": "7e872fe646b53d937e45f3bdcb43d2058afbdd541883de19dc329b5ddc7fe98e" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/datasource.ts": { - "version": "03fe24ab30c16548f28e256c5c77270a9ba53e47ce115aabfb97857b65006811", - "signature": "5ca09ef289f77fe6f8b8411a85c9935f02226fbc73b8eb8c4300e9f678d0e3ea" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/text_line_dataset.ts": { - "version": "4cf5e041e19e7313d36eacd17b7baf18c53ad5ed8b1972bbb6384a89de8eeaee", - "signature": "8bf5d6ff0fa8fbac6bae25905680786ca9f86a776359ef32be484d8b3861f8c2" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/csv_dataset.ts": { - "version": "6a136d5c71e9767d72ab747bcd76b5532aa22b390de572488de8475674d7820c", - "signature": "77df0964c04cde54db4811bb38cb0539cc34d79c81566c4d7211c44adb7a2a20" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/microphone_iterator.ts": { - "version": "5f16e5044f9c2d76903194bd6ac9b8ab12e87b3b3f953967f6893a454474dd1a", - "signature": "84d433daa75f307230e1a57f92e1823887f2e6a14977b87cd9f7f0e67556d4bc" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/webcam_iterator.ts": { - "version": "64df09a84cb60a20be6de2356fd6718c4a1fcbe622772c8ac8478b8872dc123a", - "signature": "a083be4debc30784687d51c86b2ad20b392f5468f1036d1e6402cd012243900b" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/file_chunk_iterator.ts": { - "version": "6b0c157cb3ac7b6747d8974f789a3311dc5a1840d9761278e1f8183e1813c17e", - "signature": "f6e551642a498552855a4e4e819cfacc32cf8ce479e60a25ec7d66fad0600c43" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/url_chunk_iterator.ts": { - "version": "804e938c01406e502242684bdb6df0a333b55c4ceb124c0aefbce37a114f2fd7", - "signature": "a28d6c58f7babe14044e1b7f54d30fbf025525eb155d8c14c851d9da5e31a0a8" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/util/source_util.ts": { - "version": "f0b2b35c590e774dbeb4a81635647cf5e365cb03153a41957a658d51e3bb0024", - "signature": "9eca45081668c36972113a8dde131955dbbd83711418cf2a703f14f4d5870fb1" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/sources/file_data_source.ts": { - "version": "8e0fa2ab2a58f3c174e14578d70d949c7810e6e9fcc20045113387e88e082f49", - "signature": "da2ef7e2d610de3f1ee96ad44d5311a16722a71e53fab23d016a2a52b0df0328" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/sources/url_data_source.ts": { - "version": "fb5014936f2ccceeec1363553c563ca47d1067f296299f8842afc8f93ee43a70", - "signature": "73e1c0506968adf9af241cb4a6b330377e027e9293ed86d05fb59f68c7dc35be" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/readers.ts": { - "version": "203042dab7c368e9be60b8da0f73a60ecedd48542231d8d2307c68588dbf75dd", - "signature": "907ae084795a603ec05a0762b51d9bf9b87f544106f937ceb437928ec5371bac" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/version.ts": { - "version": "c1de9d8f48a22c963515458c32125814760337a0b7e2b3157725c531609543f1", - "signature": "6a4911ec90ecea7527148d73599b8b40708772c2b8592df3bfb951d440857741" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/index.ts": { - "version": "cf3f205165ed99660e52877d732d35f750e7abf31cf9bead77a80f8184b41011", - "signature": "45c7079fce43d59743a9b049faae1356fa1aeed319a02051fb2e340a3a92065b" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.d.ts": { - "version": "df33db95c35009a6da8b26ddb2703ca7c99a98b373b283dfba13e5d088a9de65", - "signature": "df33db95c35009a6da8b26ddb2703ca7c99a98b373b283dfba13e5d088a9de65" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/util/test_utils.ts": { - "version": "b91c525dba8e67b5baa6bc373fa7fc33761eb7211d4311cea281491d7811cdcf", - "signature": "e6b9777670c2b9ec7ddea551b76cecc9f3deacef07881b149d3f77479bc3c81e" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/dataset_test.ts": { - "version": "89db5b191af0c94fede28bdcc0d8e34cd5563863c058751ccc9b4d9a4fe221eb", - "signature": "bc076db006fa18db283749db402126e58a104d92bc0453b6fe933364950f822f" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/readers_test.ts": { - "version": "0624af2058ffcbf156d3e5e44d6a9ebcc323a23360e0306e5b1fdf6fe2d133e8", - "signature": "7ab4599ea84fe926131e6209c3cea2a8a2a2bda6b1bb31739736492a2e2ebf52" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/statistics.ts": { - "version": "2a11ab7260cb53db4d128563d22d60a90df34275082963c3e3b476ac3af4ad66", - "signature": "35a5fde04432847c417d6ccb4effdc3fa0543d78895061297831c1af883bb0e7" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/statistics_test.ts": { - "version": "a0f851c3146fb91034681028c14ba7e159ea62492c6a35b3a2a4d6fd01c68491", - "signature": "300199727b212159d3bdc890d5b206e3e0c87a6fda559b05ba3f8ecdf579e161" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts": { - "version": "44b1fbef93b4ca93bd59cee4da7916070c035e55198accec24438d4c61d6e680", - "signature": "44b1fbef93b4ca93bd59cee4da7916070c035e55198accec24438d4c61d6e680" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/abs.d.ts": { - "version": "f11ce27db76fe05e817e9ed1f5d333ff3b35e4d5c62b4da129671aebe2811817", - "signature": "f11ce27db76fe05e817e9ed1f5d333ff3b35e4d5c62b4da129671aebe2811817" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/add.d.ts": { - "version": "39f0464c9c08f8985b194fb154ab8a60bde16291a80c748ab97b8c175d38a58e", - "signature": "39f0464c9c08f8985b194fb154ab8a60bde16291a80c748ab97b8c175d38a58e" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/bincount_impl.d.ts": { - "version": "9659828681b7b7082e980b0ea68ac12a1d21e21e1ef7840107083b0b10522ae2", - "signature": "9659828681b7b7082e980b0ea68ac12a1d21e21e1ef7840107083b0b10522ae2" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts": { - "version": "8d1a624a8c99cb27f02a355ac5b5f02952563c18e37336b46f1054df0796652d", - "signature": "8d1a624a8c99cb27f02a355ac5b5f02952563c18e37336b46f1054df0796652d" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ceil.d.ts": { - "version": "3a3c95fc1f93f8c12da29e830da071d56f4a4da25da9fd58a444240e589e34f2", - "signature": "3a3c95fc1f93f8c12da29e830da071d56f4a4da25da9fd58a444240e589e34f2" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/concat_impl.d.ts": { - "version": "041d8fdbe234c00ed74ca9c4575c508b589cdac3b5ae6fddb213cf35b6a8e5b5", - "signature": "041d8fdbe234c00ed74ca9c4575c508b589cdac3b5ae6fddb213cf35b6a8e5b5" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/exp.d.ts": { - "version": "7fbb43be1f78af4c2dedbbbf578d976c36107fe9ef40a40320ef2603a049080b", - "signature": "7fbb43be1f78af4c2dedbbbf578d976c36107fe9ef40a40320ef2603a049080b" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/expm1.d.ts": { - "version": "4c86d1e1aaa27a35210b1656a610f63ccb75f49b74afcdcbf160516827b92996", - "signature": "4c86d1e1aaa27a35210b1656a610f63ccb75f49b74afcdcbf160516827b92996" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/floor.d.ts": { - "version": "b810b5d85042d5fde78dfa964453a3dc949a911ef94fa1a8efb52c9378a858e4", - "signature": "b810b5d85042d5fde78dfa964453a3dc949a911ef94fa1a8efb52c9378a858e4" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/gatherv2_impl.d.ts": { - "version": "d8acfe7994e794625e6cb6665e8fcd9d40c5f8981dd7081f60ab6e63daff9bb7", - "signature": "d8acfe7994e794625e6cb6665e8fcd9d40c5f8981dd7081f60ab6e63daff9bb7" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/greater.d.ts": { - "version": "f38868f7d0aae87e644142b5a5fbfc062ecc57ab9535c03869b47791f022f1f5", - "signature": "f38868f7d0aae87e644142b5a5fbfc062ecc57ab9535c03869b47791f022f1f5" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/less.d.ts": { - "version": "a7d0885cc4b1f233dd3dd97fadd8e4e59c69f6fb8aff61ed95b376315cbac4f5", - "signature": "a7d0885cc4b1f233dd3dd97fadd8e4e59c69f6fb8aff61ed95b376315cbac4f5" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/linspace_impl.d.ts": { - "version": "e9c37e8f77721a3fc2a409561c49441eb70d112170c204a9a1fcd4538e3c936c", - "signature": "e9c37e8f77721a3fc2a409561c49441eb70d112170c204a9a1fcd4538e3c936c" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/log.d.ts": { - "version": "7b409fa170070a8da0965171132736dfaf18909900a7ea6b1e78620fb0431239", - "signature": "7b409fa170070a8da0965171132736dfaf18909900a7ea6b1e78620fb0431239" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/max_impl.d.ts": { - "version": "5799c368be85cba206864ec0a26185bb8b6b073205b0b846a609ed2a16131a65", - "signature": "5799c368be85cba206864ec0a26185bb8b6b073205b0b846a609ed2a16131a65" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/maximum.d.ts": { - "version": "4fc71e0df1212078642650dfec6ef92e5f679e5988469befe46afbefe3bde6d5", - "signature": "4fc71e0df1212078642650dfec6ef92e5f679e5988469befe46afbefe3bde6d5" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/minimum.d.ts": { - "version": "d66d059667a71fc5ac69d2d63c1587c4a7f3910d660a43516c5755276e7fb06c", - "signature": "d66d059667a71fc5ac69d2d63c1587c4a7f3910d660a43516c5755276e7fb06c" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/multiply.d.ts": { - "version": "70b9eeb73ad07f0dfdcc7387762c96c4f3e80a8e99035c62a8a8097fe3618ffc", - "signature": "70b9eeb73ad07f0dfdcc7387762c96c4f3e80a8e99035c62a8a8097fe3618ffc" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/neg.d.ts": { - "version": "920a76dd5bd0555e29fd1dc2ad76ead46efa2c5b13f70b4fb32f1e8f38f8a01b", - "signature": "920a76dd5bd0555e29fd1dc2ad76ead46efa2c5b13f70b4fb32f1e8f38f8a01b" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/notequal.d.ts": { - "version": "e084466eb25f3e1428bca0c09bde58700764fcf08793cfcc3b126504120d5a20", - "signature": "e084466eb25f3e1428bca0c09bde58700764fcf08793cfcc3b126504120d5a20" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/prod.d.ts": { - "version": "56d19a60a58d1869a7e1f29cf6f5c15efe21022e849bb72f8f3b40ce8df2fca5", - "signature": "56d19a60a58d1869a7e1f29cf6f5c15efe21022e849bb72f8f3b40ce8df2fca5" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/range_impl.d.ts": { - "version": "0be18aded4466ff961dceb469c4bec795953726a7cf9b865a3896e47b6c5abe0", - "signature": "0be18aded4466ff961dceb469c4bec795953726a7cf9b865a3896e47b6c5abe0" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/rsqrt.d.ts": { - "version": "745fba44dfedf962b50f7a8828dcc9ea5ea5e35eb27d52c0b2c71b265a8cbfe6", - "signature": "745fba44dfedf962b50f7a8828dcc9ea5ea5e35eb27d52c0b2c71b265a8cbfe6" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/slice.d.ts": { - "version": "2b5aaff17c0701143ec24dbc73f2bb0ddcf7b220bc0a71e38f384518c6d88a4f", - "signature": "2b5aaff17c0701143ec24dbc73f2bb0ddcf7b220bc0a71e38f384518c6d88a4f" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsefillemptyrows_impl.d.ts": { - "version": "400e9e4aa9c433f2bb693a8fae24ff675527691a270a63da9cb3a40ab9d28154", - "signature": "400e9e4aa9c433f2bb693a8fae24ff675527691a270a63da9cb3a40ab9d28154" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsereshape_impl.d.ts": { - "version": "b0d010e95a4964aef0e17ba4353c52e6bc766a1be2b4901fdbe76f16a5420735", - "signature": "b0d010e95a4964aef0e17ba4353c52e6bc766a1be2b4901fdbe76f16a5420735" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/squareddifference.d.ts": { - "version": "aa8c80d3a04b5bb4f0a51d64168a30cafc8ef6bef0eb46b5dd137e19775613cc", - "signature": "aa8c80d3a04b5bb4f0a51d64168a30cafc8ef6bef0eb46b5dd137e19775613cc" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/stridedslice_impl.d.ts": { - "version": "86ac2e63cde417edc528df02d0542640310c803eb589eb4de520037b2763b389", - "signature": "86ac2e63cde417edc528df02d0542640310c803eb589eb4de520037b2763b389" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sub.d.ts": { - "version": "b9fb743e4cca9acab98e7236806f180e1426997b7d2520e9a918878a67217485", - "signature": "b9fb743e4cca9acab98e7236806f180e1426997b7d2520e9a918878a67217485" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/tile_impl.d.ts": { - "version": "f9b00a106118ef7c7909a13dacd6738c2d5998fddb2321933f0862608ede9e79", - "signature": "f9b00a106118ef7c7909a13dacd6738c2d5998fddb2321933f0862608ede9e79" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/topk_impl.d.ts": { - "version": "f40cee4c39dcc6224977ee27a4ebb2ee4504c81508ac12cbde1906362c405fea", - "signature": "f40cee4c39dcc6224977ee27a4ebb2ee4504c81508ac12cbde1906362c405fea" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/transpose_impl.d.ts": { - "version": "21bbca7d159962db3a39761906cb39a205ef927b94e9acc2e9330a6fe16f747b", - "signature": "21bbca7d159962db3a39761906cb39a205ef927b94e9acc2e9330a6fe16f747b" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/unique_impl.d.ts": { - "version": "3d37946e11188a1c8a06c652734ae08d9025ded293f43f4d19a2fb098d59f701", - "signature": "3d37946e11188a1c8a06c652734ae08d9025ded293f43f4d19a2fb098d59f701" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/binary_types.d.ts": { - "version": "e51e2517c253d86256f3eac5fa39f25a65489c9ac0d2694e6628a7ae87f5aa8a", - "signature": "e51e2517c253d86256f3eac5fa39f25a65489c9ac0d2694e6628a7ae87f5aa8a" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts": { - "version": "57bfe17cb530761ad65d2e6163f17915807db9d739bef97972662d9194bbe6f7", - "signature": "57bfe17cb530761ad65d2e6163f17915807db9d739bef97972662d9194bbe6f7" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/version.d.ts": { - "version": "6a4911ec90ecea7527148d73599b8b40708772c2b8592df3bfb951d440857741", - "signature": "6a4911ec90ecea7527148d73599b8b40708772c2b8592df3bfb951d440857741" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/base.d.ts": { - "version": "aceecabeef1218dc0b6c94e9a813cff98166761611469bec20b9cfe9824edcdc", - "signature": "aceecabeef1218dc0b6c94e9a813cff98166761611469bec20b9cfe9824edcdc" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/register_all_kernels.d.ts": { - "version": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881", - "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/index.d.ts": { - "version": "8215b66a65d44aadfd9823f55033907c4fb29ce0a49b6916d34759d5927cdba6", - "signature": "8215b66a65d44aadfd9823f55033907c4fb29ce0a49b6916d34759d5927cdba6" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/test_node.ts": { - "version": "964779189038edda6836344bc874476fc56d2836c97f98c3f6ab557636654617", - "signature": "637c387d700348bd5ffe9ecb3ac1d0c6ef56bf1a73b0183fe7c9844b04bc1e9c" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/csv_dataset_test.ts": { - "version": "a03a30afdec764919ecb6b6161e772c8234932567320ecb44501877b435236aa", - "signature": "c8414b4638111ad4383c782b46c943683b2b8e755b7298286360c179a3fba61e" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/text_line_dataset_test.ts": { - "version": "ca14aab0f43e186e9b31c6edd8d1567497acfadb6001f34784d00cd2213f6be1", - "signature": "c8414b4638111ad4383c782b46c943683b2b8e755b7298286360c179a3fba61e" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/byte_chunk_iterator_test.ts": { - "version": "27d954b15a3ea34222054756aea9a52ca2466d523144c4efb7668e5565c3756f", - "signature": "c8414b4638111ad4383c782b46c943683b2b8e755b7298286360c179a3fba61e" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator_test.ts": { - "version": "13fc470e10b0781c8dbbe44be6742c3b8c79c763bc266b524c4e2b8ad2ec2b5a", - "signature": "6db494182fbbf5169d7c73627ea690c620263838e2cceeb2ecebee9b6b1708b8" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/chained_iterator_test.ts": { - "version": "2cbda2b3f6efa0e1d1717560f9e4d502abc9069c0e803f9a96665e0bab6bde15", - "signature": "c8414b4638111ad4383c782b46c943683b2b8e755b7298286360c179a3fba61e" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/file_chunk_iterator_test.ts": { - "version": "39f7d96aeb5c98f28ead39f24d2ba00f86fdba6407a33c190df5bcbe2e5d9a01", - "signature": "c8414b4638111ad4383c782b46c943683b2b8e755b7298286360c179a3fba61e" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/microphone_iterator_test.ts": { - "version": "51370d734c20bc32c356486961a84417b07892d7358e468314d898733f5394cc", - "signature": "00648b2ca068dd5957069dd2a14494277d91e8124aa5f0618d1d90e6748f46b9" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/prefetch_iterator_test.ts": { - "version": "9d35e523e382f82bb64561f2f04e2e8c13c47280aa5edf06213282c00d0f9499", - "signature": "c8414b4638111ad4383c782b46c943683b2b8e755b7298286360c179a3fba61e" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/shuffle_iterator_test.ts": { - "version": "f83d24a27ec75d77c33f612aed7448e1b55ea8a84b817c67795caa634559705f", - "signature": "c8414b4638111ad4383c782b46c943683b2b8e755b7298286360c179a3fba61e" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/string_iterator_test.ts": { - "version": "ed39c2f8b1e47ed1c44c371aa4da5d29dcc209a0923d27fd046195094ba234a4", - "signature": "c8414b4638111ad4383c782b46c943683b2b8e755b7298286360c179a3fba61e" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/url_chunk_iterator_test.ts": { - "version": "00b3249212e3116c2f226ba2fd984d576a45a9c892a5f936ceb87999cc93cd79", - "signature": "c8414b4638111ad4383c782b46c943683b2b8e755b7298286360c179a3fba61e" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/webcam_iterator_test.ts": { - "version": "1eff7af8c60514598d604e0b18ecc1954bb1d79041589791dc7f501bbd53bf62", - "signature": "00648b2ca068dd5957069dd2a14494277d91e8124aa5f0618d1d90e6748f46b9" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/util/deep_map_test.ts": { - "version": "c4c2086aa5d44d93ee7551fc01dfe2f7f277aff8adea8ab26030ec61a987c626", - "signature": "c8414b4638111ad4383c782b46c943683b2b8e755b7298286360c179a3fba61e" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/util/ring_buffer_test.ts": { - "version": "320068e17bcf3efb895109598e3238ba57c47880ea8d7278597f0db035ea94a7", - "signature": "c8414b4638111ad4383c782b46c943683b2b8e755b7298286360c179a3fba61e" - }, - "/private/tmp/tfjs-publish/tfjs-data/src/util/source_util_test.ts": { - "version": "83a07262afe1846577be2cc15c2d8499053e0cacf8241a73ccea19060537e773", - "signature": "c8414b4638111ad4383c782b46c943683b2b8e755b7298286360c179a3fba61e" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/component-emitter/index.d.ts": { - "version": "a3a88c1869ba1022dfaefac47ff7a984ec62510e9b4d60988f91d5e523266c34", - "signature": "a3a88c1869ba1022dfaefac47ff7a984ec62510e9b4d60988f91d5e523266c34" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/cookie/index.d.ts": { - "version": "405ad6db8aa3d5618c3be21cde8125de28a3e40690eb05136c123f420c05c082", - "signature": "405ad6db8aa3d5618c3be21cde8125de28a3e40690eb05136c123f420c05c082" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/cors/index.d.ts": { - "version": "a68969f643e0cb091046a9437b64cb1880a081fc07c70a4717b0edef2a38bc85", - "signature": "a68969f643e0cb091046a9437b64cb1880a081fc07c70a4717b0edef2a38bc85" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/estree/index.d.ts": { - "version": "f1e8ecd1d960d12e57316fd2889b0a57635f38f8c4c976d8deafa29650bbf320", - "signature": "f1e8ecd1d960d12e57316fd2889b0a57635f38f8c4c976d8deafa29650bbf320" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/jasmine/index.d.ts": { - "version": "ead8cd125d2c92993ec86f60fd88ab821275e7cd902d65650cc27146c9d5225a", - "signature": "ead8cd125d2c92993ec86f60fd88ab821275e7cd902d65650cc27146c9d5225a" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/globals.d.ts": { - "version": "25b4a0c4fab47c373ee49df4c239826ee3430019fc0c1b5e59edc3e398b7468d", - "signature": "25b4a0c4fab47c373ee49df4c239826ee3430019fc0c1b5e59edc3e398b7468d" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/async_hooks.d.ts": { - "version": "7698983d080f951eaf53ff81e5c7bd61abc02e4a1a21266f1bd79ea85c0dc641", - "signature": "7698983d080f951eaf53ff81e5c7bd61abc02e4a1a21266f1bd79ea85c0dc641" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/buffer.d.ts": { - "version": "5726b5ce952dc5beaeb08d5f64236632501568a54a390363d2339ba1dc5393b1", - "signature": "5726b5ce952dc5beaeb08d5f64236632501568a54a390363d2339ba1dc5393b1" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/child_process.d.ts": { - "version": "674bedbfd2004e233e2a266a3d2286e524f0d58787a98522d834d6ccda1d215a", - "signature": "674bedbfd2004e233e2a266a3d2286e524f0d58787a98522d834d6ccda1d215a" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/cluster.d.ts": { - "version": "714637d594e1a38a075091fe464ca91c6abc0b154784b4287f6883200e28ccef", - "signature": "714637d594e1a38a075091fe464ca91c6abc0b154784b4287f6883200e28ccef" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/console.d.ts": { - "version": "23edba5f47d3409810c563fe8034ae2c59e718e1ef8570f4152ccdde1915a096", - "signature": "23edba5f47d3409810c563fe8034ae2c59e718e1ef8570f4152ccdde1915a096" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/constants.d.ts": { - "version": "0e9c55f894ca2d9cf63b5b0d43a8cec1772dd560233fd16275bc7a485eb82f83", - "signature": "0e9c55f894ca2d9cf63b5b0d43a8cec1772dd560233fd16275bc7a485eb82f83" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/crypto.d.ts": { - "version": "d53b352a01645c470a0d8c31bf290ba791fc28ade0ce187a4a50f5c2f826f75e", - "signature": "d53b352a01645c470a0d8c31bf290ba791fc28ade0ce187a4a50f5c2f826f75e" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/dgram.d.ts": { - "version": "5f0a09de75bd965c21dc6d73671ba88830272f9ed62897bb0aa9754b369b1eed", - "signature": "5f0a09de75bd965c21dc6d73671ba88830272f9ed62897bb0aa9754b369b1eed" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/dns.d.ts": { - "version": "2b34e7fcba9e1f24e7f54ba5c8be5a8895b0b8b444ccf6548e04acdee0899317", - "signature": "2b34e7fcba9e1f24e7f54ba5c8be5a8895b0b8b444ccf6548e04acdee0899317" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/domain.d.ts": { - "version": "06d2be99c3dd2ff52114d02ee443ba486ab482423df1941d3c97d6a92e924d70", - "signature": "06d2be99c3dd2ff52114d02ee443ba486ab482423df1941d3c97d6a92e924d70" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts": { - "version": "bfd4f140c07091b5e8a963c89e6fa3f44b6cfcbc11471b465cf63e2d020ad0eb", - "signature": "bfd4f140c07091b5e8a963c89e6fa3f44b6cfcbc11471b465cf63e2d020ad0eb" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs.d.ts": { - "version": "a106a0bea088b70879ac88ff606dc253c0cc474ea05ad3a282b8bfb1091ae576", - "signature": "a106a0bea088b70879ac88ff606dc253c0cc474ea05ad3a282b8bfb1091ae576" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs/promises.d.ts": { - "version": "c98ce957db9eebd75f53edda3f6893e05ab2d2283b5667b18e31bcdb6427ed10", - "signature": "c98ce957db9eebd75f53edda3f6893e05ab2d2283b5667b18e31bcdb6427ed10" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http.d.ts": { - "version": "1f08bd8305d4a789a68f71ab622156dfff993aa51a2aa58b9ccf166cc6f9fcf7", - "signature": "1f08bd8305d4a789a68f71ab622156dfff993aa51a2aa58b9ccf166cc6f9fcf7" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http2.d.ts": { - "version": "9aff68f1b847b846d3d50a58c9f8f99389bedd0258d1b1c201f11b97ecfd36f8", - "signature": "9aff68f1b847b846d3d50a58c9f8f99389bedd0258d1b1c201f11b97ecfd36f8" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/https.d.ts": { - "version": "1978992206803f5761e99e893d93b25abc818c5fe619674fdf2ae02b29f641ba", - "signature": "1978992206803f5761e99e893d93b25abc818c5fe619674fdf2ae02b29f641ba" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/inspector.d.ts": { - "version": "05fbe81f09fc455a2c343d2458d2b3c600c90b92b22926be765ee79326be9466", - "signature": "05fbe81f09fc455a2c343d2458d2b3c600c90b92b22926be765ee79326be9466" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/module.d.ts": { - "version": "8e7d6dae9e19bbe47600dcfd4418db85b30ae7351474ea0aad5e628f9845d340", - "signature": "8e7d6dae9e19bbe47600dcfd4418db85b30ae7351474ea0aad5e628f9845d340" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts": { - "version": "f20ea392f7f27feb7a90e5a24319a4e365b07bf83c39a547711fe7ff9df68657", - "signature": "f20ea392f7f27feb7a90e5a24319a4e365b07bf83c39a547711fe7ff9df68657" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/os.d.ts": { - "version": "32542c4660ecda892a333a533feedba31738ee538ef6a78eb73af647137bc3fc", - "signature": "32542c4660ecda892a333a533feedba31738ee538ef6a78eb73af647137bc3fc" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/path.d.ts": { - "version": "0ecacea5047d1a7d350e7049dbd22f26435be5e8736a81a56afec5b3264db1ca", - "signature": "0ecacea5047d1a7d350e7049dbd22f26435be5e8736a81a56afec5b3264db1ca" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/perf_hooks.d.ts": { - "version": "ffcb4ebde21f83370ed402583888b28651d2eb7f05bfec9482eb46d82adedd7f", - "signature": "ffcb4ebde21f83370ed402583888b28651d2eb7f05bfec9482eb46d82adedd7f" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/process.d.ts": { - "version": "06c004006016a51c4d1855527a523562c329dc44c473931c65f10373281f730e", - "signature": "06c004006016a51c4d1855527a523562c329dc44c473931c65f10373281f730e" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/punycode.d.ts": { - "version": "a7b43c69f9602d198825e403ee34e5d64f83c48b391b2897e8c0e6f72bca35f8", - "signature": "a7b43c69f9602d198825e403ee34e5d64f83c48b391b2897e8c0e6f72bca35f8" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/querystring.d.ts": { - "version": "f4a3fc4efc6944e7b7bd4ccfa45e0df68b6359808e6cf9d061f04fd964a7b2d3", - "signature": "f4a3fc4efc6944e7b7bd4ccfa45e0df68b6359808e6cf9d061f04fd964a7b2d3" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/readline.d.ts": { - "version": "73cad675aead7a2c05cf934e7e700c61d84b2037ac1d576c3f751199b25331da", - "signature": "73cad675aead7a2c05cf934e7e700c61d84b2037ac1d576c3f751199b25331da" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/repl.d.ts": { - "version": "8c3137ba3583ec18484429ec1c8eff89efdc42730542f157b38b102fdccc0c71", - "signature": "8c3137ba3583ec18484429ec1c8eff89efdc42730542f157b38b102fdccc0c71" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts": { - "version": "d84300d886b45a198c346158e4ff7ae361cc7bc1c3deab44afb3db7de56b5d25", - "signature": "d84300d886b45a198c346158e4ff7ae361cc7bc1c3deab44afb3db7de56b5d25" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/string_decoder.d.ts": { - "version": "94ca7beec4e274d32362b54e0133152f7b4be9487db7b005070c03880b6363aa", - "signature": "94ca7beec4e274d32362b54e0133152f7b4be9487db7b005070c03880b6363aa" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/timers.d.ts": { - "version": "2d713cbcbd5bcc38d91546eaeea7bb1c8686dc4a2995a28556d957b1b9de11d9", - "signature": "2d713cbcbd5bcc38d91546eaeea7bb1c8686dc4a2995a28556d957b1b9de11d9" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tls.d.ts": { - "version": "bbf21f210782db4193359010a4710786add43e3b50aa42fc0d371f45b4e4d8d3", - "signature": "bbf21f210782db4193359010a4710786add43e3b50aa42fc0d371f45b4e4d8d3" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/trace_events.d.ts": { - "version": "0b7733d83619ac4e3963e2a9f7c75dc1e9af6850cb2354c9554977813092c10a", - "signature": "0b7733d83619ac4e3963e2a9f7c75dc1e9af6850cb2354c9554977813092c10a" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tty.d.ts": { - "version": "3ce933f0c3955f67f67eb7d6b5c83c2c54a18472c1d6f2bb651e51dd40c84837", - "signature": "3ce933f0c3955f67f67eb7d6b5c83c2c54a18472c1d6f2bb651e51dd40c84837" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts": { - "version": "631e96db896d645f7132c488ad34a16d71fd2be9f44696f8c98289ee1c8cbfa9", - "signature": "631e96db896d645f7132c488ad34a16d71fd2be9f44696f8c98289ee1c8cbfa9" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/util.d.ts": { - "version": "2c77230d381cba81eb6f87cda2fbfff6c0427c6546c2e2590110effff37c58f7", - "signature": "2c77230d381cba81eb6f87cda2fbfff6c0427c6546c2e2590110effff37c58f7" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/v8.d.ts": { - "version": "da86ee9a2f09a4583db1d5e37815894967e1f694ad9f3c25e84e0e4d40411e14", - "signature": "da86ee9a2f09a4583db1d5e37815894967e1f694ad9f3c25e84e0e4d40411e14" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/vm.d.ts": { - "version": "66679e8ffbf1fddef1796c60757e54e6e6551dd9823f75ef2f80176473bdaaff", - "signature": "66679e8ffbf1fddef1796c60757e54e6e6551dd9823f75ef2f80176473bdaaff" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/worker_threads.d.ts": { - "version": "ddc086b1adac44e2fccf55422da1e90fa970e659d77f99712422a421564b4877", - "signature": "ddc086b1adac44e2fccf55422da1e90fa970e659d77f99712422a421564b4877" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/zlib.d.ts": { - "version": "515ef1d99036ff0dafa5bf738e02222edea94e0d97a0aa0ff277ac5e96b57977", - "signature": "515ef1d99036ff0dafa5bf738e02222edea94e0d97a0aa0ff277ac5e96b57977" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/globals.global.d.ts": { - "version": "2708349d5a11a5c2e5f3a0765259ebe7ee00cdcc8161cb9990cb4910328442a1", - "signature": "2708349d5a11a5c2e5f3a0765259ebe7ee00cdcc8161cb9990cb4910328442a1" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/wasi.d.ts": { - "version": "780058f4a804c8bdcdd2f60e7af64b2bc57d149c1586ee3db732a84d659a50bf", - "signature": "780058f4a804c8bdcdd2f60e7af64b2bc57d149c1586ee3db732a84d659a50bf" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/base.d.ts": { - "version": "ae68a04912ee5a0f589276f9ec60b095f8c40d48128a4575b3fdd7d93806931c", - "signature": "ae68a04912ee5a0f589276f9ec60b095f8c40d48128a4575b3fdd7d93806931c" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/assert.d.ts": { - "version": "1aa743b5b89d2f3c7eff2c20661d119623e4dbfa33f992a16583f16af7b70c75", - "signature": "1aa743b5b89d2f3c7eff2c20661d119623e4dbfa33f992a16583f16af7b70c75" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/index.d.ts": { - "version": "092cf35ca0f8f72a652d9a9e3dbdb892927de37a1704cd8d77e04ec1efbb148b", - "signature": "092cf35ca0f8f72a652d9a9e3dbdb892927de37a1704cd8d77e04ec1efbb148b" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/form-data/index.d.ts": { - "version": "736097ddbb2903bef918bb3b5811ef1c9c5656f2a73bd39b22a91b9cc2525e50", - "signature": "736097ddbb2903bef918bb3b5811ef1c9c5656f2a73bd39b22a91b9cc2525e50" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node-fetch/externals.d.ts": { - "version": "972f1e91dab93b182624a17eeed02f683b8cb3fefbda7b689cc84570029d5f73", - "signature": "972f1e91dab93b182624a17eeed02f683b8cb3fefbda7b689cc84570029d5f73" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node-fetch/index.d.ts": { - "version": "9895aad6ad1d505e2b03c8e41c8643b60a813ad130eb68f843b736b2db7d42e1", - "signature": "9895aad6ad1d505e2b03c8e41c8643b60a813ad130eb68f843b736b2db7d42e1" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/offscreencanvas/index.d.ts": { - "version": "fc35a74dd14f55d6fea9e5a4804ae812d559519352fa3836eb5f5555a64dd0ac", - "signature": "fc35a74dd14f55d6fea9e5a4804ae812d559519352fa3836eb5f5555a64dd0ac" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/resolve/index.d.ts": { - "version": "2880728492d6a6baa55411d14cc42fa55714a24b1d1d27ff9a8a610abd47c761", - "signature": "2880728492d6a6baa55411d14cc42fa55714a24b1d1d27ff9a8a610abd47c761" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/utf8/index.d.ts": { - "version": "a6a80d576cb7beda26af64d1e0a23e382c9986fae214de994870f4cd7b4e0ea1", - "signature": "a6a80d576cb7beda26af64d1e0a23e382c9986fae214de994870f4cd7b4e0ea1" - }, - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/webgl-ext/index.d.ts": { - "version": "49febed15cc962e5823a8b0781f0fcd8f5f63f6bcadcdda5e30e4d173ce738d4", - "signature": "49febed15cc962e5823a8b0781f0fcd8f5f63f6bcadcdda5e30e4d173ce738d4" - }, - "/private/tmp/tfjs-publish/node_modules/@types/argparse/index.d.ts": { - "version": "dc3b172ee27054dbcedcf5007b78c256021db936f6313a9ce9a3ecbb503fd646", - "signature": "dc3b172ee27054dbcedcf5007b78c256021db936f6313a9ce9a3ecbb503fd646" - }, - "/private/tmp/tfjs-publish/node_modules/@types/minimatch/index.d.ts": { - "version": "95c22bc19835e28e2e524a4bb8898eb5f2107b640d7279a6d3aade261916bbf2", - "signature": "95c22bc19835e28e2e524a4bb8898eb5f2107b640d7279a6d3aade261916bbf2" - }, - "/private/tmp/tfjs-publish/node_modules/@types/glob/index.d.ts": { - "version": "393137c76bd922ba70a2f8bf1ade4f59a16171a02fb25918c168d48875b0cfb0", - "signature": "393137c76bd922ba70a2f8bf1ade4f59a16171a02fb25918c168d48875b0cfb0" - }, - "/private/tmp/tfjs-publish/node_modules/@types/is-windows/index.d.ts": { - "version": "b938f24d3af55eba025debac20bcf2d6a3be6033f1bb41462d6ca7d6c81e0314", - "signature": "b938f24d3af55eba025debac20bcf2d6a3be6033f1bb41462d6ca7d6c81e0314" - }, - "/private/tmp/tfjs-publish/node_modules/@types/istanbul-lib-coverage/index.d.ts": { - "version": "de18acda71730bac52f4b256ce7511bb56cc21f6f114c59c46782eff2f632857", - "signature": "de18acda71730bac52f4b256ce7511bb56cc21f6f114c59c46782eff2f632857" - }, - "/private/tmp/tfjs-publish/node_modules/@types/long/index.d.ts": { - "version": "e8465811693dfe4e96ef2b3dffda539d6edfe896961b7af37b44db2c0e48532b", - "signature": "e8465811693dfe4e96ef2b3dffda539d6edfe896961b7af37b44db2c0e48532b" - }, - "/private/tmp/tfjs-publish/node_modules/@types/mkdirp/index.d.ts": { - "version": "6396a7a06f3ef0fc31a7c89330e015146b78a2256b030c698b6d404594c37b8f", - "signature": "6396a7a06f3ef0fc31a7c89330e015146b78a2256b030c698b6d404594c37b8f" - }, - "/private/tmp/tfjs-publish/node_modules/@types/shelljs/index.d.ts": { - "version": "b73abc91e3166b1951d302f8008c17e62d32e570e71b2680141f7c3f5d0a990d", - "signature": "b73abc91e3166b1951d302f8008c17e62d32e570e71b2680141f7c3f5d0a990d" - } - }, - "options": { - "module": 5, - "moduleResolution": 2, - "noImplicitAny": true, - "sourceMap": true, - "inlineSources": true, - "removeComments": false, - "preserveConstEnums": true, - "allowSyntheticDefaultImports": true, - "declaration": true, - "target": 4, - "lib": [ - "lib.es2017.d.ts", - "lib.dom.d.ts" - ], - "outDir": "/private/tmp/tfjs-publish/tfjs-data/dist", - "noUnusedLocals": true, - "noImplicitReturns": true, - "noImplicitThis": true, - "alwaysStrict": true, - "noUnusedParameters": false, - "pretty": true, - "noFallthroughCasesInSwitch": true, - "allowUnreachableCode": false, - "incremental": true, - "plugins": [ - { - "name": "@bazel/tsetse", - "disabledRules": [ - "must-use-promises", - "must-type-assert-json-parse", - "ban-promise-as-condition" - ] - } - ], - "configFilePath": "/private/tmp/tfjs-publish/tfjs-data/tsconfig.json" - }, - "referencedMap": { - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tape.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tape.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tape.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_browser.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_node.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/base_side_effects.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_browser.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_node.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/http.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/model_management.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/io.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/model_management.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/confusion_matrix.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/math.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/confusion_matrix.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/browser.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/test_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/util_base.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/util_base.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/model_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/abs.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/acos.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/acosh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/add.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/add_n.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/all.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/any.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/arg_max.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/arg_min.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/asin.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/asinh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/atan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/atan2.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/atanh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/basic_lstm_cell.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batch_to_space_nd.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/bincount.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/buffer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cast.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ceil.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/clone.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/complex.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_transpose.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cos.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cosh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cumsum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dense_bincount.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/depth_to_space.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/diag.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dilation2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/div.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/div_no_nan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dot.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/einsum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/elu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/erf.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/exp.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/expand_dims.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/expm1.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/eye.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fill.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/floor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/floordiv.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/gather.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/greater.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/greater_equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/imag.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/is_finite.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/is_inf.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/is_nan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/less.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/less_equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/linspace.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log1p.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log_sigmoid.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log_softmax.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log_sum_exp.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_and.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_not.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_or.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_xor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_with_argmax.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/maximum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mean.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/meshgrid.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/min.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/minimum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mirror_pad.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mod.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/moments.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mul.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/multi_rnn_cell.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/neg.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/not_equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ones.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ones_like.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/outer_product.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pool.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pow.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/prelu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/print.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/prod.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/rand.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/random_gamma.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/random_normal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/random_uniform.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/range.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/real.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reciprocal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/relu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/relu6.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reshape.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/round.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/rsqrt.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/scalar.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/selu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/separable_conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/setdiff1d_async.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sign.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sin.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sinh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/softplus.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/space_to_batch_nd.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/fft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/ifft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/irfft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/rfft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/split.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sqrt.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/square.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/squared_difference.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/stack.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/step.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sub.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tanh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor5d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor6d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tile.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/topk.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/truncated_normal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/unique.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/unsorted_segment_sum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/unstack.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/variable.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/where.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/where_async.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/zeros.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/zeros_like.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/boolean_mask.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/norm.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sparse_to_dense.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dropout.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/signal_ops_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/in_top_k.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused/conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused/depthwise_conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused/mat_mul.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_ops.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ops.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/add_n.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/basic_lstm_cell.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/bincount.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/buffer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/clone.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/complex.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dense_bincount.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/diag.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/einsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/eye.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fill.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/imag.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/linspace.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_with_argmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/meshgrid.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/moments.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/multi_rnn_cell.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ones.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/outer_product.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/print.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/rand.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/random_gamma.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/random_normal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/random_uniform.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/range.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/real.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/setdiff1d_async.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor6d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/truncated_normal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/variable.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/where_async.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/zeros.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/zeros_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/boolean_mask.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sparse_to_dense.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dropout.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/signal_ops_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/in_top_k.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/operation.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_ops.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops_utils.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/train.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/globals.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/gradients.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/complex_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/einsum_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/split_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/backend_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reduce_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/rotate_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/erf_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/complex_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/einsum_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/split_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/non_max_suppression_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/where_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/kernel_impls.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/non_max_suppression_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/where_impl.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_names.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/base.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/io.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/math.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/browser.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/test_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/version.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/model_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ops.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops_utils.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/train.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/globals.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/gradients.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/browser_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/backend_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/device_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/kernel_impls.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_names.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/base_side_effects.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/base.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/util/deep_map.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/util/deep_clone.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/deep_map.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/util/growing_ring_buffer.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/util/ring_buffer.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/seedrandom/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/deep_clone.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/deep_map.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/growing_ring_buffer.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/ring_buffer.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/dataset.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/seedrandom/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/deep_map.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/string_iterator.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/byte_chunk_iterator.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/string_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/datasource.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/byte_chunk_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/text_line_dataset.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/dataset.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/datasource.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/csv_dataset.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/dataset.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/datasource.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/text_line_dataset.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/microphone_iterator.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/webcam_iterator.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/file_chunk_iterator.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/byte_chunk_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/url_chunk_iterator.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/file_chunk_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/sources/file_data_source.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/datasource.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/byte_chunk_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/file_chunk_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/source_util.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/sources/url_data_source.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/datasource.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/byte_chunk_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/file_chunk_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/url_chunk_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/source_util.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/sources/file_data_source.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/readers.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/dataset.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/csv_dataset.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/microphone_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/webcam_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/sources/url_data_source.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/index.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/dataset.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/csv_dataset.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/text_line_dataset.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/readers.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/sources/file_data_source.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/sources/url_data_source.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/version.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/util/test_utils.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/dataset_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/dataset.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/test_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/readers_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/readers.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/test_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/statistics.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/dataset.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/statistics_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/dataset.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/dataset_test.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/statistics.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/test_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/abs.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/add.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/bincount_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ceil.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/concat_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/exp.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/expm1.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/floor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/gatherv2_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/greater.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/less.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/linspace_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/log.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/max_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/maximum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/minimum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/multiply.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/neg.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/notequal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/prod.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/range_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/rsqrt.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/slice.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsefillemptyrows_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsereshape_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/squareddifference.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/stridedslice_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sub.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/tile_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/topk_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/transpose_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/unique_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/binary_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/bincount_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/concat_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/gatherv2_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/linspace_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/max_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/multiply.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/notequal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/range_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsefillemptyrows_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsereshape_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/squareddifference.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/stridedslice_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/tile_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/topk_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/transpose_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/unique_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/binary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/base.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/version.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/base.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/register_all_kernels.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/test_node.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/csv_dataset_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/sources/file_data_source.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/csv_dataset.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/text_line_dataset_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/sources/file_data_source.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/text_line_dataset.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/byte_chunk_iterator_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/file_chunk_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/chained_iterator_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator_test.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/file_chunk_iterator_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/file_chunk_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/microphone_iterator_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/readers.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/test_utils.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/prefetch_iterator_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator_test.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/shuffle_iterator_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator_test.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/string_iterator_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/file_chunk_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/url_chunk_iterator_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/url_chunk_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/webcam_iterator_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/webcam_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/util/deep_map_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/deep_map.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/util/ring_buffer_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/util/ring_buffer.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/util/source_util_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/source_util.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/cors/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/async_hooks.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/async_hooks.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/buffer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/buffer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/child_process.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/child_process.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/cluster.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/cluster.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/child_process.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/console.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/constants.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/constants.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/os.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/crypto.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/crypto.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/crypto.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/dgram.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/dgram.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/dns.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/dns.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/dns.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/domain.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/domain.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs/promises.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs/promises.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs/promises.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http2.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http2.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tls.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/https.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/https.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tls.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/inspector.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/inspector.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/module.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/module.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/dns.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/os.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/os.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/path.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/path.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/perf_hooks.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/perf_hooks.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/async_hooks.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/process.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tty.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/punycode.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/punycode.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/querystring.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/querystring.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/readline.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/readline.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/repl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/repl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/readline.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/vm.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/string_decoder.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/string_decoder.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/timers.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/timers.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tls.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tls.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/trace_events.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/trace_events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tty.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tty.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/querystring.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/v8.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/v8.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/vm.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/vm.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/worker_threads.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/worker_threads.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/vm.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs/promises.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/zlib.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/zlib.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/wasi.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/wasi.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/base.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/globals.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/async_hooks.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/buffer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/child_process.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/cluster.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/console.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/constants.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/crypto.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/dgram.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/dns.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/domain.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs/promises.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http2.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/https.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/inspector.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/module.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/os.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/path.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/perf_hooks.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/process.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/punycode.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/querystring.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/readline.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/repl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/string_decoder.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/timers.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tls.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/trace_events.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tty.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/v8.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/vm.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/worker_threads.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/zlib.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/globals.global.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/wasi.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/assert.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/assert.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/base.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/assert.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/form-data/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node-fetch/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/form-data/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node-fetch/externals.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/resolve/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/index.d.ts" - ], - "/private/tmp/tfjs-publish/node_modules/@types/glob/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/node_modules/@types/minimatch/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/index.d.ts" - ], - "/private/tmp/tfjs-publish/node_modules/@types/mkdirp/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/index.d.ts" - ], - "/private/tmp/tfjs-publish/node_modules/@types/shelljs/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/child_process.d.ts", - "/private/tmp/tfjs-publish/node_modules/@types/glob/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/index.d.ts" - ] - }, - "exportedModulesMap": { - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/base.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/io.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/math.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/browser.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/test_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/version.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/model_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ops.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops_utils.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/train.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/globals.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/gradients.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/browser_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/backend_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/device_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/kernel_impls.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_names.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/base_side_effects.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/base.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/binary_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/bincount_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/concat_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/gatherv2_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/linspace_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/max_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/multiply.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/notequal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/range_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsefillemptyrows_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsereshape_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/squareddifference.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/stridedslice_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/tile_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/topk_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/transpose_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/unique_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/binary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/base.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/version.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/base.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/register_all_kernels.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/test_node.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sub.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/squareddifference.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/notequal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/multiply.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/minimum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/maximum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/less.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/greater.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/add.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/unique_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/transpose_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/topk_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/tile_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/stridedslice_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsereshape_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsefillemptyrows_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/slice.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/rsqrt.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/range_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/prod.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/neg.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/max_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/log.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/linspace_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/gatherv2_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/floor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/expm1.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/exp.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/concat_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ceil.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/bincount_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/abs.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/statistics.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/dataset.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/dataset_test.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/readers.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/csv_dataset.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/dataset.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/webcam_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/microphone_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/index.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/dataset.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/csv_dataset.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/text_line_dataset.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/readers.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/sources/file_data_source.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/sources/url_data_source.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/version.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/sources/file_data_source.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/file_chunk_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/byte_chunk_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/datasource.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/sources/url_data_source.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/file_chunk_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/byte_chunk_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/datasource.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/url_chunk_iterator.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/file_chunk_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/file_chunk_iterator.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/byte_chunk_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/webcam_iterator.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/microphone_iterator.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/csv_dataset.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/datasource.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/text_line_dataset.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/dataset.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/byte_chunk_iterator.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/string_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/datasource.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/byte_chunk_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/text_line_dataset.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/datasource.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/dataset.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/dataset.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/deep_map.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/ring_buffer.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/string_iterator.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ops.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/add_n.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/basic_lstm_cell.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/bincount.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/buffer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/clone.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/complex.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dense_bincount.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/diag.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/einsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/eye.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fill.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/imag.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/linspace.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_with_argmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/meshgrid.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/moments.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/multi_rnn_cell.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ones.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/outer_product.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/print.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/rand.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/random_gamma.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/random_normal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/random_uniform.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/range.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/real.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/setdiff1d_async.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor6d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/truncated_normal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/variable.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/where_async.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/zeros.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/zeros_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/boolean_mask.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sparse_to_dense.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dropout.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/signal_ops_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/in_top_k.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/operation.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_ops.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops_utils.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_names.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/where_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/kernel_impls.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/non_max_suppression_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/where_impl.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/non_max_suppression_impl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/backend_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reduce_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/rotate_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/erf_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/complex_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/einsum_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/split_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/complex_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/gradients.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused/mat_mul.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_ops.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused/depthwise_conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused/conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/in_top_k.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dropout.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sparse_to_dense.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/norm.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/boolean_mask.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/zeros_like.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/zeros.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/where_async.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/where.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/variable.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/unstack.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/unsorted_segment_sum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/unique.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/truncated_normal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/topk.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tile.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor6d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor5d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tanh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sub.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/step.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/stack.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/squared_difference.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/square.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sqrt.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/split.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/space_to_batch_nd.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/softplus.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sinh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sin.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sign.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/setdiff1d_async.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/separable_conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/selu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/scalar.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/rsqrt.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/round.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reshape.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/relu6.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/relu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reciprocal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/real.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/random_uniform.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/random_normal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/random_gamma.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/rand.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/prod.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/prelu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pow.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pool.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/outer_product.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ones_like.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ones.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/not_equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/neg.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/multi_rnn_cell.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mul.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/moments.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mod.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mirror_pad.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/minimum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/min.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/meshgrid.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mean.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/maximum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_with_argmax.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_xor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_or.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_not.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_and.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log_sum_exp.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log_softmax.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log_sigmoid.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log1p.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/less_equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/less.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/is_nan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/is_inf.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/is_finite.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/imag.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/greater_equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/greater.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/gather.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/floordiv.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/floor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fill.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/eye.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/expm1.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/expand_dims.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/exp.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/erf.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/equal.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/elu.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dot.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/div_no_nan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/div.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dilation2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/depth_to_space.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dense_bincount.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cumsum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cosh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cos.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_transpose.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_1d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/complex.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/clone.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ceil.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cast.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/buffer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/bincount.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm4d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm2d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batch_to_space_nd.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/basic_lstm_cell.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/atanh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/atan2.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/atan.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/asinh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/asin.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/arg_min.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/arg_max.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/any.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/all.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/add_n.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/add.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/acosh.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/acos.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/abs.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/model_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/util_base.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/util_base.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/test_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/browser.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/confusion_matrix.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/math.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/confusion_matrix.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/io.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/model_management.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tape.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/globals.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/base_side_effects.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_browser.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_node.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_browser.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tape.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/split_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/einsum_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/signal_ops_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/rfft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/irfft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/ifft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/fft.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/range.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/print.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/linspace.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/einsum.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/diag.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/train.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tape.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/model_management.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/http.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_node.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/src/util/growing_ring_buffer.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/src/util/ring_buffer.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/cors/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/async_hooks.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/async_hooks.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/base.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/globals.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/async_hooks.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/buffer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/child_process.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/cluster.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/console.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/constants.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/crypto.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/dgram.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/dns.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/domain.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs/promises.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http2.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/https.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/inspector.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/module.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/os.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/path.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/perf_hooks.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/process.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/punycode.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/querystring.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/readline.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/repl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/string_decoder.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/timers.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tls.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/trace_events.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tty.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/v8.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/vm.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/worker_threads.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/zlib.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/globals.global.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/wasi.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/base.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/assert.d.ts" - ], - "/private/tmp/tfjs-publish/node_modules/@types/shelljs/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/child_process.d.ts", - "/private/tmp/tfjs-publish/node_modules/@types/glob/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/index.d.ts" - ], - "/private/tmp/tfjs-publish/node_modules/@types/mkdirp/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/index.d.ts" - ], - "/private/tmp/tfjs-publish/node_modules/@types/glob/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/node_modules/@types/minimatch/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/resolve/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node-fetch/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/form-data/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node-fetch/externals.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/form-data/index.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/index.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/perf_hooks.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/perf_hooks.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/async_hooks.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/buffer.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/buffer.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/child_process.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/child_process.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/cluster.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/cluster.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/child_process.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/console.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/constants.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/constants.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/os.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/crypto.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/crypto.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/crypto.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/dgram.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/dgram.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/dns.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/dns.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/dns.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/dns.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tty.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tty.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/process.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tty.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tls.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tls.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/https.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/https.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tls.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http2.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http2.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tls.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/domain.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/domain.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs/promises.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs/promises.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs/promises.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/worker_threads.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/worker_threads.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/vm.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs/promises.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/inspector.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/inspector.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/module.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/module.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/os.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/os.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/path.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/path.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/punycode.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/punycode.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/querystring.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/querystring.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/querystring.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/readline.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/readline.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/repl.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/repl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/readline.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/vm.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/zlib.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/zlib.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/v8.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/v8.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/string_decoder.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/string_decoder.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/timers.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/timers.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/trace_events.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/trace_events.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/util.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/util.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/vm.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/vm.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/wasi.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/wasi.d.ts" - ], - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/assert.d.ts": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/assert.d.ts" - ] - }, - "semanticDiagnosticsPerFile": [ - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es5.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2015.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2016.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2017.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2018.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.dom.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2015.core.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2015.collection.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2015.generator.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2015.iterable.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2015.promise.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2015.proxy.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2015.reflect.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2015.symbol.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2016.array.include.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2017.object.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2017.string.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2017.intl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2018.intl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2018.promise.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.es2018.regexp.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.esnext.intl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/typescript/lib/lib.esnext.bigint.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/backend.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/environment.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tape.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/engine.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/flags.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_browser.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/platforms/platform_node.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/base_side_effects.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/router_registry.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/indexed_db.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/local_storage.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/browser_files.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/io_utils.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/passthrough.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/weights_loader.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/model_management.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/io/io.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/confusion_matrix.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/math.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/browser.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/serialization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/tensor_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/test_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/util_base.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/version.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/model_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adadelta_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adagrad_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adam_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/adamax_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/sgd_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/momentum_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/rmsprop_optimizer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/acos.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/acosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/add_n.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/all.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/any.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/arg_max.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/arg_min.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/asin.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/asinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/atan.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/atan2.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/atanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/avg_pool_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/basic_lstm_cell.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batch_to_space_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/batchnorm4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/bincount.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_to.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/buffer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cast.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/clip_by_value.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/clone.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/complex.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv2d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/conv3d_transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cos.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cosh.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/cumsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dense_bincount.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/depth_to_space.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/diag.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dilation2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/div.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/div_no_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dot.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/einsum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/elu.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/erf.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/expand_dims.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/eye.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fill.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/floordiv.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/gather.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/greater_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/imag.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/is_finite.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/is_inf.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/is_nan.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/leaky_relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/less_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/linspace.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/local_response_normalization.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log1p.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log_sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log_softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/log_sum_exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_and.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_not.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_or.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/logical_xor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/max_pool_with_argmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mean.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/meshgrid.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/min.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mirror_pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mod.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/moments.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/multi_rnn_cell.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/multinomial.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/not_equal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/one_hot.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ones.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ones_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/outer_product.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pad4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pool.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/pow.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/prelu.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/print.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/rand.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/random_gamma.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/random_normal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/random_uniform.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/range.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/real.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reciprocal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/relu.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/relu6.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reshape.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reverse_4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/round.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/scalar.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/selu.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/separable_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/setdiff1d_async.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sigmoid.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sign.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sin.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sinh.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/slice4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/softmax.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/softplus.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/space_to_batch_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/fft.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/ifft.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/irfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/spectral/rfft.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/split.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/square.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/squared_difference.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/squeeze.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/stack.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/step.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/strided_slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tan.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tanh.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor1d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor3d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor4d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor5d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tensor6d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/tile.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/topk.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/truncated_normal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/unique.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/unsorted_segment_sum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/unstack.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/variable.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/where.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/where_async.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/zeros.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/zeros_like.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/boolean_mask.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/transpose.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/norm.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/moving_average.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/scatter_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/sparse_to_dense.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/gather_nd.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/dropout.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/signal_ops_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/in_top_k.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/operation.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused/conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused/depthwise_conv2d.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused/mat_mul.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_ops.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/loss_ops_utils.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/ops.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/optimizers/optimizer_constructors.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/train.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/globals.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/gradients.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/browser_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/axis_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/broadcast_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/concat_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/fused_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/reduce_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/rotate_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/array_ops_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/selu_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/erf_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/complex_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/einsum_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/split_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/ops/segment_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/backend_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/device_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/non_max_suppression_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/where_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/backends/kernel_impls.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/kernel_names.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/base.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/seedrandom/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/types.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/deep_map.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/deep_clone.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/ring_buffer.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/growing_ring_buffer.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/dataset.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/string_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/byte_chunk_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/datasource.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/text_line_dataset.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/csv_dataset.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/microphone_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/webcam_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/file_chunk_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/url_chunk_iterator.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/source_util.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/sources/file_data_source.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/sources/url_data_source.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/readers.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/version.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/index.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-core/dist/jasmine_util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/test_utils.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/dataset_test.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/readers_test.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/statistics.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/statistics_test.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/backend_cpu.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/abs.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/add.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/bincount_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/unary_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/ceil.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/concat_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/exp.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/expm1.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/floor.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/gatherv2_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/greater.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/less.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/linspace_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/log.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/max_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/maximum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/minimum.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/multiply.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/neg.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/notequal.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/prod.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/range_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/rsqrt.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/slice.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsefillemptyrows_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sparsereshape_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/squareddifference.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/stridedslice_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/sub.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/tile_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/topk_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/transpose_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/kernels/unique_impl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/utils/binary_types.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/shared.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/version.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/base.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/register_all_kernels.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@tensorflow/tfjs-backend-cpu/dist/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/test_node.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/csv_dataset_test.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/datasets/text_line_dataset_test.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/byte_chunk_iterator_test.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/lazy_iterator_test.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/chained_iterator_test.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/file_chunk_iterator_test.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/microphone_iterator_test.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/prefetch_iterator_test.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/shuffle_iterator_test.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/string_iterator_test.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/url_chunk_iterator_test.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/iterators/webcam_iterator_test.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/deep_map_test.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/ring_buffer_test.ts", - "/private/tmp/tfjs-publish/tfjs-data/src/util/source_util_test.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/component-emitter/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/cookie/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/cors/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/estree/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/jasmine/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/globals.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/async_hooks.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/buffer.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/child_process.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/cluster.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/console.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/constants.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/crypto.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/dgram.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/dns.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/domain.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/events.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/fs/promises.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/http2.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/https.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/inspector.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/module.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/net.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/os.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/path.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/perf_hooks.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/process.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/punycode.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/querystring.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/readline.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/repl.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/stream.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/string_decoder.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/timers.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tls.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/trace_events.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/tty.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/url.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/util.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/v8.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/vm.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/worker_threads.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/zlib.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/globals.global.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/wasi.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/base.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/assert.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node/ts3.6/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/form-data/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node-fetch/externals.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/node-fetch/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/offscreencanvas/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/resolve/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/utf8/index.d.ts", - "/private/tmp/tfjs-publish/tfjs-data/node_modules/@types/webgl-ext/index.d.ts", - "/private/tmp/tfjs-publish/node_modules/@types/argparse/index.d.ts", - "/private/tmp/tfjs-publish/node_modules/@types/minimatch/index.d.ts", - "/private/tmp/tfjs-publish/node_modules/@types/glob/index.d.ts", - "/private/tmp/tfjs-publish/node_modules/@types/is-windows/index.d.ts", - "/private/tmp/tfjs-publish/node_modules/@types/istanbul-lib-coverage/index.d.ts", - "/private/tmp/tfjs-publish/node_modules/@types/long/index.d.ts", - "/private/tmp/tfjs-publish/node_modules/@types/mkdirp/index.d.ts", - "/private/tmp/tfjs-publish/node_modules/@types/shelljs/index.d.ts" - ] - }, - "version": "3.5.3" -} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/types.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/types.d.ts deleted file mode 100644 index 45b9bf433..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/types.d.ts +++ /dev/null @@ -1,161 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -import { DataType, TensorContainer } from '@tensorflow/tfjs-core'; -export declare type Container = ContainerObject | ContainerArray; -export declare type ContainerOrT = Container | T; -export interface ContainerObject { - [x: string]: ContainerOrT; -} -export interface ContainerArray extends Array> { -} -/** - * Types supported by FileChunkIterator in both Browser and Node Environment. - */ -export declare type FileElement = File | Blob | Uint8Array; -/** - * A dictionary containing column level configurations when reading and decoding - * CSV file(s) from csv source. - * Has the following fields: - * - `required` If value in this column is required. If set to `true`, throw an - * error when it finds an empty value. - * - * - `dtype` Data type of this column. Could be int32, float32, bool, or string. - * - * - `default` Default value of this column. - * - * - `isLabel` Whether this column is label instead of features. If isLabel is - * `true` for at least one column, the .csv() API will return an array of two - * items: the first item is a dict of features key/value pairs, the second item - * is a dict of labels key/value pairs. If no column is marked as label returns - * a dict of features only. - */ -export interface ColumnConfig { - required?: boolean; - dtype?: DataType; - default?: TensorContainer; - isLabel?: boolean; -} -/** - * Interface for configuring dataset when reading and decoding from CSV file(s). - */ -export interface CSVConfig { - /** - * A boolean value that indicates whether the first row of provided CSV file - * is a header line with column names, and should not be included in the data. - */ - hasHeader?: boolean; - /** - * A list of strings that corresponds to the CSV column names, in order. If - * provided, it ignores the column names inferred from the header row. If not - * provided, infers the column names from the first row of the records. If - * `hasHeader` is false and `columnNames` is not provided, this method will - * throw an error. - */ - columnNames?: string[]; - /** - * A dictionary whose key is column names, value is an object stating if this - * column is required, column's data type, default value, and if this column - * is label. If provided, keys must correspond to names provided in - * `columnNames` or inferred from the file header lines. If any column is - * marked as label, the .csv() API will return an array of two items: the - * first item is a dict of features key/value pairs, the second item is a dict - * of labels key/value pairs. If no column is marked as label returns a dict - * of features only. - * - * Has the following fields: - * - `required` If value in this column is required. If set to `true`, throw - * an error when it finds an empty value. - * - * - `dtype` Data type of this column. Could be int32, float32, bool, or - * string. - * - * - `default` Default value of this column. - * - * - `isLabel` Whether this column is label instead of features. If isLabel is - * `true` for at least one column, the element in returned `CSVDataset` will - * be an object of {xs: features, ys: labels}: xs is a dict of features - * key/value pairs, ys is a dict of labels key/value pairs. If no column is - * marked as label, returns a dict of features only. - */ - columnConfigs?: { - [key: string]: ColumnConfig; - }; - /** - * If true, only columns provided in `columnConfigs` will be parsed and - * provided during iteration. - */ - configuredColumnsOnly?: boolean; - /** - * The string used to parse each line of the input file. - */ - delimiter?: string; - /** - * If true, delimiter field should be null. Parsing delimiter is whitespace - * and treat continuous multiple whitespace as one delimiter. - */ - delimWhitespace?: boolean; -} -/** - * Interface configuring data from webcam video stream. - */ -export interface WebcamConfig { - /** - * A string specifying which camera to use on device. If the value is - * 'user', it will use front camera. If the value is 'environment', it will - * use rear camera. - */ - facingMode?: 'user' | 'environment'; - /** - * A string used to request a specific camera. The deviceId can be obtained by - * calling `mediaDevices.enumerateDevices()`. - */ - deviceId?: string; - /** - * Specifies the width of the output tensor. The actual width of the - * HTMLVideoElement (if provided) can be different and the final image will be - * resized to match resizeWidth. - */ - resizeWidth?: number; - /** - * Specifies the height of the output tensor. The actual height of the - * HTMLVideoElement (if provided) can be different and the final image will be - * resized to match resizeHeight. - */ - resizeHeight?: number; - /** - * A boolean value that indicates whether to crop the video frame from center. - * If true, `resizeWidth` and `resizeHeight` must be specified; then an image - * of size `[resizeWidth, resizeHeight]` is taken from the center of the frame - * without scaling. If false, the entire image is returned (perhaps scaled to - * fit in `[resizeWidth, resizeHeight]`, if those are provided). - */ - centerCrop?: boolean; -} -/** - * Interface configuring data from microphone audio stream. - */ -export interface MicrophoneConfig { - sampleRateHz?: 44100 | 48000; - fftSize?: number; - columnTruncateLength?: number; - numFramesPerSpectrogram?: number; - audioTrackConstraints?: MediaTrackConstraints; - smoothingTimeConstant?: number; - includeSpectrogram?: boolean; - includeWaveform?: boolean; -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/types.js b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/types.js deleted file mode 100644 index a102819d6..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/types.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2018 Google LLC. All Rights Reserved. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ============================================================================= - */ -//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/types.js.map b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/types.js.map deleted file mode 100644 index ccebbf767..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG","sourcesContent":["/**\n * @license\n * Copyright 2018 Google LLC. All Rights Reserved.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n * =============================================================================\n */\n\nimport {DataType, TensorContainer} from '@tensorflow/tfjs-core';\n\n// Maybe this should be called 'NestedContainer'-- that's just a bit unwieldy.\nexport type Container = ContainerObject|ContainerArray;\n\nexport type ContainerOrT = Container|T;\n\nexport interface ContainerObject {\n [x: string]: ContainerOrT;\n}\nexport interface ContainerArray extends Array> {}\n\n/**\n * Types supported by FileChunkIterator in both Browser and Node Environment.\n */\nexport type FileElement = File|Blob|Uint8Array;\n\n/**\n * A dictionary containing column level configurations when reading and decoding\n * CSV file(s) from csv source.\n * Has the following fields:\n * - `required` If value in this column is required. If set to `true`, throw an\n * error when it finds an empty value.\n *\n * - `dtype` Data type of this column. Could be int32, float32, bool, or string.\n *\n * - `default` Default value of this column.\n *\n * - `isLabel` Whether this column is label instead of features. If isLabel is\n * `true` for at least one column, the .csv() API will return an array of two\n * items: the first item is a dict of features key/value pairs, the second item\n * is a dict of labels key/value pairs. If no column is marked as label returns\n * a dict of features only.\n */\nexport interface ColumnConfig {\n required?: boolean;\n dtype?: DataType;\n default?: TensorContainer;\n isLabel?: boolean;\n}\n\n/**\n * Interface for configuring dataset when reading and decoding from CSV file(s).\n */\nexport interface CSVConfig {\n /**\n * A boolean value that indicates whether the first row of provided CSV file\n * is a header line with column names, and should not be included in the data.\n */\n hasHeader?: boolean;\n\n /**\n * A list of strings that corresponds to the CSV column names, in order. If\n * provided, it ignores the column names inferred from the header row. If not\n * provided, infers the column names from the first row of the records. If\n * `hasHeader` is false and `columnNames` is not provided, this method will\n * throw an error.\n */\n columnNames?: string[];\n\n /**\n * A dictionary whose key is column names, value is an object stating if this\n * column is required, column's data type, default value, and if this column\n * is label. If provided, keys must correspond to names provided in\n * `columnNames` or inferred from the file header lines. If any column is\n * marked as label, the .csv() API will return an array of two items: the\n * first item is a dict of features key/value pairs, the second item is a dict\n * of labels key/value pairs. If no column is marked as label returns a dict\n * of features only.\n *\n * Has the following fields:\n * - `required` If value in this column is required. If set to `true`, throw\n * an error when it finds an empty value.\n *\n * - `dtype` Data type of this column. Could be int32, float32, bool, or\n * string.\n *\n * - `default` Default value of this column.\n *\n * - `isLabel` Whether this column is label instead of features. If isLabel is\n * `true` for at least one column, the element in returned `CSVDataset` will\n * be an object of {xs: features, ys: labels}: xs is a dict of features\n * key/value pairs, ys is a dict of labels key/value pairs. If no column is\n * marked as label, returns a dict of features only.\n */\n columnConfigs?: {[key: string]: ColumnConfig};\n\n /**\n * If true, only columns provided in `columnConfigs` will be parsed and\n * provided during iteration.\n */\n configuredColumnsOnly?: boolean;\n\n /**\n * The string used to parse each line of the input file.\n */\n delimiter?: string;\n\n /**\n * If true, delimiter field should be null. Parsing delimiter is whitespace\n * and treat continuous multiple whitespace as one delimiter.\n */\n delimWhitespace?: boolean;\n}\n\n/**\n * Interface configuring data from webcam video stream.\n */\nexport interface WebcamConfig {\n /**\n * A string specifying which camera to use on device. If the value is\n * 'user', it will use front camera. If the value is 'environment', it will\n * use rear camera.\n */\n facingMode?: 'user'|'environment';\n\n /**\n * A string used to request a specific camera. The deviceId can be obtained by\n * calling `mediaDevices.enumerateDevices()`.\n */\n deviceId?: string;\n\n /**\n * Specifies the width of the output tensor. The actual width of the\n * HTMLVideoElement (if provided) can be different and the final image will be\n * resized to match resizeWidth.\n */\n resizeWidth?: number;\n\n /**\n * Specifies the height of the output tensor. The actual height of the\n * HTMLVideoElement (if provided) can be different and the final image will be\n * resized to match resizeHeight.\n */\n resizeHeight?: number;\n\n /**\n * A boolean value that indicates whether to crop the video frame from center.\n * If true, `resizeWidth` and `resizeHeight` must be specified; then an image\n * of size `[resizeWidth, resizeHeight]` is taken from the center of the frame\n * without scaling. If false, the entire image is returned (perhaps scaled to\n * fit in `[resizeWidth, resizeHeight]`, if those are provided).\n */\n centerCrop?: boolean;\n}\n\n/**\n * Interface configuring data from microphone audio stream.\n */\nexport interface MicrophoneConfig {\n // A number representing Audio sampling rate in Hz. either 44,100 or 48,000.\n // If provided sample rate is not available on the device, it will throw an\n // error. Optional, defaults to the sample rate available on device.\n sampleRateHz?: 44100|48000;\n\n // The FFT length of each spectrogram column. A higher value will result in\n // more details in the frequency domain but fewer details in the time domain.\n // Must be a power of 2 between 2 to 4 and 2 to 14, so one of: 16, 32, 64,\n // 128, 256, 512, 1024, 2048, 4096, 8192, and 16384. It will throw an error if\n // it is an invalid number.Defaults to 1024.\n fftSize?: number;\n\n // Truncate each spectrogram column at how many frequency points. Each audio\n // frame contains fftSize, for example, 1024 samples which covers voice\n // frequency from 0 to 22,500 Hz. However, the frequency content relevant to\n // human speech is generally in the frequency range from 0 to 5000 Hz. So each\n // audio frame only need 232 columns to cover the frequency range of human\n // voice. This will be part of the output spectrogram tensor shape. Optional,\n // defaults to null which means no truncation.\n columnTruncateLength?: number;\n\n // Number of audio frames per spectrogram. The time duration of one\n // spectrogram equals to numFramesPerSpectrogram*fftSize/sampleRateHz second.\n // For example: the device sampling rate is 44,100 Hz, and fftSize is 1024,\n // then each frame duration between two sampling is 0.023 second. If the\n // purpose is for an audio model to recognize speech command that last 1\n // second, each spectrogram should contain 1/0.023, which is 43 frames. This\n // will be part of the output spectrogram tensor shape. Optional, defaults to\n // 43 so that each audio data last 1 second.\n numFramesPerSpectrogram?: number;\n\n // A dictionary specifying the requirements of audio to request, such as\n // deviceID, echoCancellation, etc. Optional.\n audioTrackConstraints?: MediaTrackConstraints;\n\n // The averaging constant with the last analysis frame -- basically, it makes\n // the transition between values over time smoother. It is used by\n // AnalyserNode interface during FFT. Optional, has to be between 0 and 1,\n // defaults to 0.\n smoothingTimeConstant?: number;\n\n // Whether to collect the frequency domain audio spectrogram in\n // MicrophoneIterator result. If both includeSpectrogram and includeWaveform\n // are false, it will throw an error. Defaults to true.\n includeSpectrogram?: boolean;\n\n // Whether to collect the time domain audio waveform in MicrophoneIterator\n // result. If both includeSpectrogram and includeWaveform are false, it will\n // throw an error. Defaults to false.\n includeWaveform?: boolean;\n}\n"]} \ No newline at end of file diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/version.d.ts b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/version.d.ts deleted file mode 100644 index 3a1e67793..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/dist/version.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -/** @license See the LICENSE file. */ -declare const version = "3.6.0"; -export { version }; diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/package.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/package.json deleted file mode 100644 index b1fa07d02..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/package.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "_args": [ - [ - "@tensorflow/tfjs-data@3.6.0", - "/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning" - ] - ], - "_from": "@tensorflow/tfjs-data@3.6.0", - "_id": "@tensorflow/tfjs-data@3.6.0", - "_inBundle": false, - "_integrity": "sha512-5KU7fnU7cj/opb4aCNDoW4qma64ggDwI0PCs5KEO41T3waVHDLk6bjlFlBVRdjfZqvM0K6EfWEyoiXzdvz/Ieg==", - "_location": "/@tensorflow/tfjs-data", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "@tensorflow/tfjs-data@3.6.0", - "name": "@tensorflow/tfjs-data", - "escapedName": "@tensorflow%2ftfjs-data", - "scope": "@tensorflow", - "rawSpec": "3.6.0", - "saveSpec": null, - "fetchSpec": "3.6.0" - }, - "_requiredBy": [ - "/@tensorflow/tfjs" - ], - "_resolved": "https://registry.npmjs.org/@tensorflow/tfjs-data/-/tfjs-data-3.6.0.tgz", - "_spec": "3.6.0", - "_where": "/home/brenden/Superalgos/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning", - "browser": { - "fs": false, - "node-fetch": false, - "string_decoder": false, - "crypto": false - }, - "dependencies": { - "@types/node-fetch": "^2.1.2", - "node-fetch": "~2.6.1" - }, - "description": "TensorFlow Data API in JavaScript", - "devDependencies": { - "@rollup/plugin-commonjs": "^11.0.2", - "@rollup/plugin-node-resolve": "^7.1.1", - "@rollup/plugin-typescript": "^3.0.0", - "@tensorflow/tfjs-backend-cpu": "3.6.0", - "@tensorflow/tfjs-core": "3.6.0", - "@tensorflow/tfjs-layers": "3.6.0", - "@types/jasmine": "~2.5.53", - "@types/seedrandom": "^2.4.27", - "@types/utf8": "~2.1.6", - "clang-format": "~1.2.2", - "http-server": "~0.12.3", - "jasmine": "3.1.0", - "jasmine-core": "~3.1.0", - "karma": "~6.3.1", - "karma-chrome-launcher": "~2.2.0", - "karma-firefox-launcher": "~1.1.0", - "karma-jasmine": "~1.1.1", - "karma-typescript": "~5.5.1", - "karma-typescript-es6-transform": "^5.0.2", - "nyc": "^15.1.0", - "rimraf": "~2.6.2", - "rollup": "~2.3.2", - "rollup-plugin-terser": "~7.0.2", - "rollup-plugin-visualizer": "~3.3.2", - "ts-node": "~7.0.0", - "tslint": "~6.1.3", - "tslint-no-circular-imports": "^0.7.0", - "typescript": "3.5.3", - "yalc": "^1.0.0-pre.50" - }, - "jsdelivr": "dist/tf-data.min.js", - "jsnext:main": "dist/index.js", - "license": "Apache-2.0", - "main": "dist/tf-data.node.js", - "miniprogram": "dist/miniprogram", - "module": "dist/index.js", - "name": "@tensorflow/tfjs-data", - "peerDependencies": { - "@tensorflow/tfjs-core": "3.6.0", - "seedrandom": "~2.4.3" - }, - "private": false, - "scripts": { - "build": "tsc && yarn bundle", - "build-backend-cpu": "cd ../tfjs-backend-cpu && yarn && yarn build", - "build-backend-cpu-ci": "cd ../tfjs-backend-cpu && yarn && yarn build-ci", - "build-ci": "tsc && yarn bundle-ci", - "build-core": "cd ../tfjs-core && yarn && yarn build", - "build-core-ci": "cd ../tfjs-core && yarn && yarn build-ci", - "build-deps": "yarn build-core && yarn build-layers && yarn build-backend-cpu", - "build-deps-ci": "yarn build-core-ci && yarn build-layers-ci && yarn build-backend-cpu-ci", - "build-layers": "cd ../tfjs-layers && yarn && yarn build", - "build-layers-ci": "cd ../tfjs-layers && yarn && yarn build-ci", - "build-npm": "./scripts/build-npm.sh", - "bundle": "rollup -c", - "bundle-ci": "rollup -c --ci", - "coverage": "yarn nyc yarn ts-node --transpile-only -P tsconfig.test.json src/test_node.ts", - "link-local": "yalc link", - "lint": "tslint -p . -t verbose", - "publish-local": "rimraf dist/ && yarn build-npm && yalc push", - "publish-npm": "npm publish", - "test": "yarn && yarn build-deps && yarn build && ts-node --transpile-only --project tsconfig.test.json src/test_node.ts", - "test-browsers": "karma start --browsers='Chrome,Firefox'", - "test-ci": "ts-node --transpile-only --skip-ignore -P tsconfig.test.json src/test_node.ts", - "test-dev": "tsc && ts-node --transpile-only --project tsconfig.test.json src/test_node.ts", - "test-snippets": "yarn && yarn build-deps && yarn build && ts-node --skip-ignore --project tsconfig.test.json ./scripts/test_snippets.ts", - "test-snippets-ci": "ts-node --skip-ignore --project tsconfig.test.json ./scripts/test_snippets.ts" - }, - "types": "dist/index.d.ts", - "unpkg": "dist/tf-data.min.js", - "version": "3.6.0" -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/tsconfig.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/tsconfig.json deleted file mode 100644 index ecb732e21..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "../tsconfig", - "include": [ - "src/" - ], - "exclude": [ - "node_modules/" - ], - "compilerOptions": { - "outDir": "./dist" - } -} diff --git a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/tsconfig.test.json b/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/tsconfig.test.json deleted file mode 100644 index 537324152..000000000 --- a/Projects/TensorFlow/TS/Bot-Modules/Learning-Bot/Low-Frequency-Learning/node_modules/@tensorflow/tfjs-data/tsconfig.test.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "../tsconfig.test", - "include": [ - "src/" - ], - "exclude": [ - "node_modules/" - ], - "compilerOptions": { - "outDir": "./dist" - } -}